@skyux/popovers 5.0.2 → 5.5.0

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 (152) hide show
  1. package/README.md +6 -4
  2. package/bundles/skyux-popovers-testing.umd.js +8 -8
  3. package/bundles/skyux-popovers.umd.js +43 -39
  4. package/documentation.json +241 -44
  5. package/esm2015/index.js +23 -0
  6. package/esm2015/index.js.map +1 -0
  7. package/esm2015/lib/modules/dropdown/dropdown-button.component.js +14 -0
  8. package/esm2015/lib/modules/dropdown/dropdown-button.component.js.map +1 -0
  9. package/esm2015/lib/modules/dropdown/dropdown-extensions.js +14 -0
  10. package/esm2015/lib/modules/dropdown/dropdown-extensions.js.map +1 -0
  11. package/esm2015/lib/modules/dropdown/dropdown-item.component.js +72 -0
  12. package/esm2015/lib/modules/dropdown/dropdown-item.component.js.map +1 -0
  13. package/esm2015/lib/modules/dropdown/dropdown-menu.component.js +307 -0
  14. package/esm2015/lib/modules/dropdown/dropdown-menu.component.js.map +1 -0
  15. package/esm2015/lib/modules/dropdown/dropdown.component.js +360 -0
  16. package/esm2015/lib/modules/dropdown/dropdown.component.js.map +1 -0
  17. package/esm2015/lib/modules/dropdown/dropdown.module.js +60 -0
  18. package/esm2015/lib/modules/dropdown/dropdown.module.js.map +1 -0
  19. package/esm2015/lib/modules/dropdown/types/dropdown-horizontal-alignment.js +2 -0
  20. package/esm2015/lib/modules/dropdown/types/dropdown-horizontal-alignment.js.map +1 -0
  21. package/esm2015/lib/modules/dropdown/types/dropdown-menu-change.js +2 -0
  22. package/esm2015/lib/modules/dropdown/types/dropdown-menu-change.js.map +1 -0
  23. package/esm2015/lib/modules/dropdown/types/dropdown-message-type.js +37 -0
  24. package/esm2015/lib/modules/dropdown/types/dropdown-message-type.js.map +1 -0
  25. package/esm2015/lib/modules/dropdown/types/dropdown-message.js +2 -0
  26. package/esm2015/lib/modules/dropdown/types/dropdown-message.js.map +1 -0
  27. package/esm2015/lib/modules/dropdown/types/dropdown-trigger-type.js +2 -0
  28. package/esm2015/lib/modules/dropdown/types/dropdown-trigger-type.js.map +1 -0
  29. package/esm2015/lib/modules/popover/popover-adapter.service.js +74 -0
  30. package/esm2015/lib/modules/popover/popover-adapter.service.js.map +1 -0
  31. package/esm2015/lib/modules/popover/popover-animation-state.js +2 -0
  32. package/esm2015/lib/modules/popover/popover-animation-state.js.map +1 -0
  33. package/esm2015/lib/modules/popover/popover-animation.js +19 -0
  34. package/esm2015/lib/modules/popover/popover-animation.js.map +1 -0
  35. package/esm2015/lib/modules/popover/popover-content.component.js +268 -0
  36. package/esm2015/lib/modules/popover/popover-content.component.js.map +1 -0
  37. package/esm2015/lib/modules/popover/popover-context.js +10 -0
  38. package/esm2015/lib/modules/popover/popover-context.js.map +1 -0
  39. package/esm2015/lib/modules/popover/popover-extensions.js +29 -0
  40. package/esm2015/lib/modules/popover/popover-extensions.js.map +1 -0
  41. package/esm2015/lib/modules/popover/popover.component.js +203 -0
  42. package/esm2015/lib/modules/popover/popover.component.js.map +1 -0
  43. package/esm2015/lib/modules/popover/popover.directive.js +176 -0
  44. package/esm2015/lib/modules/popover/popover.directive.js.map +1 -0
  45. package/esm2015/lib/modules/popover/popover.module.js +56 -0
  46. package/esm2015/lib/modules/popover/popover.module.js.map +1 -0
  47. package/esm2015/lib/modules/popover/types/popover-adapter-arrow-coordinates.js +2 -0
  48. package/esm2015/lib/modules/popover/types/popover-adapter-arrow-coordinates.js.map +1 -0
  49. package/esm2015/lib/modules/popover/types/popover-adapter-elements.js +2 -0
  50. package/esm2015/lib/modules/popover/types/popover-adapter-elements.js.map +1 -0
  51. package/esm2015/lib/modules/popover/types/popover-alignment.js +2 -0
  52. package/esm2015/lib/modules/popover/types/popover-alignment.js.map +1 -0
  53. package/esm2015/lib/modules/popover/types/popover-message-type.js +24 -0
  54. package/esm2015/lib/modules/popover/types/popover-message-type.js.map +1 -0
  55. package/esm2015/lib/modules/popover/types/popover-message.js +2 -0
  56. package/esm2015/lib/modules/popover/types/popover-message.js.map +1 -0
  57. package/esm2015/lib/modules/popover/types/popover-placement.js +2 -0
  58. package/esm2015/lib/modules/popover/types/popover-placement.js.map +1 -0
  59. package/esm2015/lib/modules/popover/types/popover-position.js +2 -0
  60. package/esm2015/lib/modules/popover/types/popover-position.js.map +1 -0
  61. package/esm2015/lib/modules/popover/types/popover-trigger.js +2 -0
  62. package/esm2015/lib/modules/popover/types/popover-trigger.js.map +1 -0
  63. package/esm2015/lib/modules/shared/sky-popovers-resources.module.js +47 -0
  64. package/esm2015/lib/modules/shared/sky-popovers-resources.module.js.map +1 -0
  65. package/esm2015/skyux-popovers.js +2 -2
  66. package/esm2015/skyux-popovers.js.map +1 -0
  67. package/esm2015/testing/dropdown/dropdown-fixture.js +1 -1
  68. package/esm2015/testing/dropdown/dropdown-fixture.js.map +1 -0
  69. package/esm2015/testing/dropdown/dropdown-testing.module.js +5 -5
  70. package/esm2015/testing/dropdown/dropdown-testing.module.js.map +1 -0
  71. package/esm2015/testing/dropdown/popovers-fixture-dropdown-item.js +1 -1
  72. package/esm2015/testing/dropdown/popovers-fixture-dropdown-item.js.map +1 -0
  73. package/esm2015/testing/dropdown/popovers-fixture-dropdown-menu.js +1 -1
  74. package/esm2015/testing/dropdown/popovers-fixture-dropdown-menu.js.map +1 -0
  75. package/esm2015/testing/dropdown/popovers-fixture-dropdown.js +1 -1
  76. package/esm2015/testing/dropdown/popovers-fixture-dropdown.js.map +1 -0
  77. package/esm2015/testing/popover/popover-fixture.js +1 -1
  78. package/esm2015/testing/popover/popover-fixture.js.map +1 -0
  79. package/esm2015/testing/popover/popover-testing.module.js +5 -5
  80. package/esm2015/testing/popover/popover-testing.module.js.map +1 -0
  81. package/esm2015/testing/public-api.js +1 -1
  82. package/esm2015/testing/public-api.js.map +1 -0
  83. package/esm2015/testing/skyux-popovers-testing.js +1 -1
  84. package/esm2015/testing/skyux-popovers-testing.js.map +1 -0
  85. package/fesm2015/skyux-popovers-testing.js +8 -8
  86. package/fesm2015/skyux-popovers-testing.js.map +1 -1
  87. package/fesm2015/skyux-popovers.js +53 -49
  88. package/fesm2015/skyux-popovers.js.map +1 -1
  89. package/index.d.ts +20 -0
  90. package/{modules → lib/modules}/dropdown/dropdown-button.component.d.ts +0 -0
  91. package/{modules → lib/modules}/dropdown/dropdown-extensions.d.ts +0 -0
  92. package/{modules → lib/modules}/dropdown/dropdown-item.component.d.ts +0 -0
  93. package/{modules → lib/modules}/dropdown/dropdown-menu.component.d.ts +0 -0
  94. package/{modules → lib/modules}/dropdown/dropdown.component.d.ts +0 -0
  95. package/{modules → lib/modules}/dropdown/dropdown.module.d.ts +0 -0
  96. package/{modules → lib/modules}/dropdown/types/dropdown-horizontal-alignment.d.ts +0 -0
  97. package/{modules → lib/modules}/dropdown/types/dropdown-menu-change.d.ts +0 -0
  98. package/{modules → lib/modules}/dropdown/types/dropdown-message-type.d.ts +0 -0
  99. package/{modules → lib/modules}/dropdown/types/dropdown-message.d.ts +0 -0
  100. package/{modules → lib/modules}/dropdown/types/dropdown-trigger-type.d.ts +0 -0
  101. package/{modules → lib/modules}/popover/popover-adapter.service.d.ts +0 -0
  102. package/{modules → lib/modules}/popover/popover-animation-state.d.ts +0 -0
  103. package/{modules → lib/modules}/popover/popover-animation.d.ts +0 -0
  104. package/{modules → lib/modules}/popover/popover-content.component.d.ts +0 -0
  105. package/{modules → lib/modules}/popover/popover-context.d.ts +0 -0
  106. package/{modules → lib/modules}/popover/popover-extensions.d.ts +0 -0
  107. package/{modules → lib/modules}/popover/popover.component.d.ts +4 -1
  108. package/{modules → lib/modules}/popover/popover.directive.d.ts +2 -0
  109. package/{modules → lib/modules}/popover/popover.module.d.ts +0 -0
  110. package/{modules → lib/modules}/popover/types/popover-adapter-arrow-coordinates.d.ts +0 -0
  111. package/{modules → lib/modules}/popover/types/popover-adapter-elements.d.ts +0 -0
  112. package/{modules → lib/modules}/popover/types/popover-alignment.d.ts +0 -0
  113. package/{modules → lib/modules}/popover/types/popover-message-type.d.ts +0 -0
  114. package/{modules → lib/modules}/popover/types/popover-message.d.ts +0 -0
  115. package/{modules → lib/modules}/popover/types/popover-placement.d.ts +0 -0
  116. package/{modules → lib/modules}/popover/types/popover-position.d.ts +0 -0
  117. package/{modules → lib/modules}/popover/types/popover-trigger.d.ts +0 -0
  118. package/{modules → lib/modules}/shared/sky-popovers-resources.module.d.ts +0 -0
  119. package/package.json +23 -9
  120. package/skyux-popovers.d.ts +1 -1
  121. package/LICENSE +0 -21
  122. package/esm2015/modules/dropdown/dropdown-button.component.js +0 -14
  123. package/esm2015/modules/dropdown/dropdown-extensions.js +0 -14
  124. package/esm2015/modules/dropdown/dropdown-item.component.js +0 -72
  125. package/esm2015/modules/dropdown/dropdown-menu.component.js +0 -306
  126. package/esm2015/modules/dropdown/dropdown.component.js +0 -357
  127. package/esm2015/modules/dropdown/dropdown.module.js +0 -60
  128. package/esm2015/modules/dropdown/types/dropdown-horizontal-alignment.js +0 -2
  129. package/esm2015/modules/dropdown/types/dropdown-menu-change.js +0 -2
  130. package/esm2015/modules/dropdown/types/dropdown-message-type.js +0 -37
  131. package/esm2015/modules/dropdown/types/dropdown-message.js +0 -2
  132. package/esm2015/modules/dropdown/types/dropdown-trigger-type.js +0 -2
  133. package/esm2015/modules/popover/popover-adapter.service.js +0 -74
  134. package/esm2015/modules/popover/popover-animation-state.js +0 -2
  135. package/esm2015/modules/popover/popover-animation.js +0 -19
  136. package/esm2015/modules/popover/popover-content.component.js +0 -266
  137. package/esm2015/modules/popover/popover-context.js +0 -10
  138. package/esm2015/modules/popover/popover-extensions.js +0 -29
  139. package/esm2015/modules/popover/popover.component.js +0 -200
  140. package/esm2015/modules/popover/popover.directive.js +0 -175
  141. package/esm2015/modules/popover/popover.module.js +0 -56
  142. package/esm2015/modules/popover/types/popover-adapter-arrow-coordinates.js +0 -2
  143. package/esm2015/modules/popover/types/popover-adapter-elements.js +0 -2
  144. package/esm2015/modules/popover/types/popover-alignment.js +0 -2
  145. package/esm2015/modules/popover/types/popover-message-type.js +0 -24
  146. package/esm2015/modules/popover/types/popover-message.js +0 -2
  147. package/esm2015/modules/popover/types/popover-placement.js +0 -2
  148. package/esm2015/modules/popover/types/popover-position.js +0 -2
  149. package/esm2015/modules/popover/types/popover-trigger.js +0 -2
  150. package/esm2015/modules/shared/sky-popovers-resources.module.js +0 -47
  151. package/esm2015/public-api.js +0 -23
  152. package/public-api.d.ts +0 -20
@@ -0,0 +1,360 @@
1
+ import { ChangeDetectionStrategy, ChangeDetectorRef, Component, ElementRef, Input, Optional, TemplateRef, ViewChild, } from '@angular/core';
2
+ import { SkyAffixAutoFitContext, SkyAffixService, SkyOverlayService, } from '@skyux/core';
3
+ import { SkyThemeService } from '@skyux/theme';
4
+ import { fromEvent as observableFromEvent, Subject } from 'rxjs';
5
+ import { takeUntil } from 'rxjs/operators';
6
+ import { SkyDropdownMessageType } from './types/dropdown-message-type';
7
+ import { parseAffixHorizontalAlignment } from './dropdown-extensions';
8
+ import * as i0 from "@angular/core";
9
+ import * as i1 from "@skyux/core";
10
+ import * as i2 from "@skyux/theme";
11
+ import * as i3 from "@skyux/indicators";
12
+ import * as i4 from "@angular/common";
13
+ import * as i5 from "@skyux/i18n";
14
+ export class SkyDropdownComponent {
15
+ constructor(changeDetector, affixService, overlayService, themeSvc) {
16
+ this.changeDetector = changeDetector;
17
+ this.affixService = affixService;
18
+ this.overlayService = overlayService;
19
+ this.themeSvc = themeSvc;
20
+ /**
21
+ * Provides an observable to send commands to the dropdown. The commands should respect
22
+ * the [[SkyDropdownMessage]] type.
23
+ */
24
+ this.messageStream = new Subject();
25
+ this.isMouseEnter = false;
26
+ this.isVisible = false;
27
+ this.ngUnsubscribe = new Subject();
28
+ this._isOpen = false;
29
+ }
30
+ /**
31
+ * Specifies a background color for the dropdown button. Available values are `default` and
32
+ * `primary`. These values set the background color from the
33
+ * [secondary and primary button classes](https://developer.blackbaud.com/skyux/components/button) respectively.
34
+ * @default "default"
35
+ */
36
+ set buttonStyle(value) {
37
+ this._buttonStyle = value;
38
+ }
39
+ get buttonStyle() {
40
+ return this._buttonStyle || 'default';
41
+ }
42
+ /**
43
+ * Specifies the type of button to render as the dropdown's trigger element. To display a button
44
+ * with text and a caret, specify `select` and then enter the button text in a
45
+ * `sky-dropdown-button` element. To display a round button with an ellipsis, specify
46
+ * `context-menu`. And to display a button with a [Font Awesome icon](http://fontawesome.io/icons/), specify the icon's class name.
47
+ * For example, to display the `fa-filter` icon, specify `filter`.
48
+ * @default "select"
49
+ */
50
+ set buttonType(value) {
51
+ this._buttonType = value;
52
+ }
53
+ get buttonType() {
54
+ return this._buttonType || 'select';
55
+ }
56
+ /**
57
+ * Indicates whether to disable the dropdown button.
58
+ * @default false
59
+ */
60
+ set disabled(value) {
61
+ this._disabled = value;
62
+ }
63
+ get disabled() {
64
+ return this._disabled || false;
65
+ }
66
+ /**
67
+ * Indicates whether to close the dropdown when users click away from the menu.
68
+ * @default true
69
+ */
70
+ set dismissOnBlur(value) {
71
+ this._dismissOnBlur = value;
72
+ }
73
+ get dismissOnBlur() {
74
+ if (this._dismissOnBlur === undefined) {
75
+ return true;
76
+ }
77
+ return this._dismissOnBlur;
78
+ }
79
+ /**
80
+ * Specifies the horizontal alignment of the dropdown menu in relation to the dropdown button.
81
+ * @default "left"
82
+ */
83
+ set horizontalAlignment(value) {
84
+ this._horizontalAlignment = value;
85
+ }
86
+ get horizontalAlignment() {
87
+ return this._horizontalAlignment || 'left';
88
+ }
89
+ /**
90
+ * Specifies how users interact with the dropdown button to expose the dropdown menu.
91
+ * We recommend the default `click` value because the `hover` value can pose
92
+ * [accessibility](https://developer.blackbaud.com/skyux/learn/accessibility) issues
93
+ * for users on touch devices such as phones and tablets.
94
+ * @deprecated We recommend against using this property. If you choose to use the deprecated
95
+ * `hover` value anyway, we recommend that you not use it in combination with the `title`
96
+ * property. (This property will be removed in the next major version release.)
97
+ * @default "click"
98
+ */
99
+ set trigger(value) {
100
+ this._trigger = value;
101
+ }
102
+ get trigger() {
103
+ return this._trigger || 'click';
104
+ }
105
+ set isOpen(value) {
106
+ this._isOpen = value;
107
+ this.changeDetector.markForCheck();
108
+ }
109
+ get isOpen() {
110
+ return this._isOpen || false;
111
+ }
112
+ set menuContainerElementRef(value) {
113
+ if (value) {
114
+ this._menuContainerElementRef = value;
115
+ this.destroyAffixer();
116
+ this.createAffixer();
117
+ this.changeDetector.markForCheck();
118
+ }
119
+ }
120
+ get menuContainerElementRef() {
121
+ return this._menuContainerElementRef;
122
+ }
123
+ ngOnInit() {
124
+ var _a;
125
+ this.addEventListeners();
126
+ this.messageStream
127
+ .pipe(takeUntil(this.ngUnsubscribe))
128
+ .subscribe((message) => {
129
+ this.handleIncomingMessages(message);
130
+ });
131
+ // Load proper icons on theme change.
132
+ (_a = this.themeSvc) === null || _a === void 0 ? void 0 : _a.settingsChange.pipe(takeUntil(this.ngUnsubscribe)).subscribe(() => {
133
+ this.changeDetector.markForCheck();
134
+ });
135
+ }
136
+ ngOnDestroy() {
137
+ this.destroyAffixer();
138
+ this.destroyOverlay();
139
+ clearTimeout(this._positionTimeout);
140
+ this.ngUnsubscribe.next();
141
+ this.ngUnsubscribe.complete();
142
+ this.ngUnsubscribe = undefined;
143
+ }
144
+ addEventListeners() {
145
+ const buttonElement = this.triggerButton.nativeElement;
146
+ observableFromEvent(buttonElement, 'click')
147
+ .pipe(takeUntil(this.ngUnsubscribe))
148
+ .subscribe(() => {
149
+ if (this.isOpen) {
150
+ this.sendMessage(SkyDropdownMessageType.Close);
151
+ }
152
+ else {
153
+ this.sendMessage(SkyDropdownMessageType.Open);
154
+ // Wait for dropdown to open, then set focus on first item.
155
+ setTimeout(() => {
156
+ this.sendMessage(SkyDropdownMessageType.FocusFirstItem);
157
+ });
158
+ }
159
+ });
160
+ observableFromEvent(buttonElement, 'keydown')
161
+ .pipe(takeUntil(this.ngUnsubscribe))
162
+ .subscribe((event) => {
163
+ const key = event.key.toLowerCase();
164
+ /* tslint:disable-next-line:switch-default */
165
+ switch (key) {
166
+ case 'escape':
167
+ /*istanbul ignore else*/
168
+ if (this.isOpen) {
169
+ this.sendMessage(SkyDropdownMessageType.Close);
170
+ this.sendMessage(SkyDropdownMessageType.FocusTriggerButton);
171
+ event.stopPropagation();
172
+ }
173
+ break;
174
+ case 'tab':
175
+ if (this.isOpen && this.dismissOnBlur) {
176
+ this.sendMessage(SkyDropdownMessageType.Close);
177
+ }
178
+ break;
179
+ case 'arrowup':
180
+ case 'up':
181
+ if (!this.isOpen) {
182
+ this.sendMessage(SkyDropdownMessageType.Open);
183
+ this.sendMessage(SkyDropdownMessageType.FocusLastItem);
184
+ event.preventDefault();
185
+ event.stopPropagation();
186
+ }
187
+ break;
188
+ case 'enter':
189
+ case 'arrowdown':
190
+ case 'down':
191
+ case ' ': // Spacebar.
192
+ /*istanbul ignore else*/
193
+ if (!this.isOpen) {
194
+ this.sendMessage(SkyDropdownMessageType.Open);
195
+ this.sendMessage(SkyDropdownMessageType.FocusFirstItem);
196
+ event.preventDefault();
197
+ event.stopPropagation();
198
+ }
199
+ break;
200
+ }
201
+ });
202
+ observableFromEvent(buttonElement, 'mouseenter')
203
+ .pipe(takeUntil(this.ngUnsubscribe))
204
+ .subscribe(() => {
205
+ this.isMouseEnter = true;
206
+ if (this.trigger === 'hover') {
207
+ this.sendMessage(SkyDropdownMessageType.Open);
208
+ }
209
+ });
210
+ observableFromEvent(buttonElement, 'mouseleave')
211
+ .pipe(takeUntil(this.ngUnsubscribe))
212
+ .subscribe(() => {
213
+ this.isMouseEnter = false;
214
+ if (this.trigger === 'hover') {
215
+ // Allow the dropdown menu to set isMouseEnter before checking if the close action
216
+ // should be taken.
217
+ setTimeout(() => {
218
+ if (!this.isMouseEnter) {
219
+ this.sendMessage(SkyDropdownMessageType.Close);
220
+ }
221
+ });
222
+ }
223
+ });
224
+ }
225
+ createOverlay() {
226
+ if (this.overlay) {
227
+ return;
228
+ }
229
+ const overlay = this.overlayService.create({
230
+ enableScroll: true,
231
+ enablePointerEvents: true,
232
+ });
233
+ overlay.attachTemplate(this.menuContainerTemplateRef);
234
+ overlay.backdropClick.pipe(takeUntil(this.ngUnsubscribe)).subscribe(() => {
235
+ if (this.dismissOnBlur) {
236
+ this.sendMessage(SkyDropdownMessageType.Close);
237
+ }
238
+ });
239
+ this.overlay = overlay;
240
+ }
241
+ destroyAffixer() {
242
+ /*istanbul ignore else*/
243
+ if (this.affixer) {
244
+ this.affixer.destroy();
245
+ this.affixer = undefined;
246
+ }
247
+ }
248
+ destroyOverlay() {
249
+ /*istanbul ignore else*/
250
+ if (this.overlay) {
251
+ this.overlayService.close(this.overlay);
252
+ this.overlay = undefined;
253
+ }
254
+ }
255
+ createAffixer() {
256
+ const affixer = this.affixService.createAffixer(this.menuContainerElementRef);
257
+ affixer.placementChange
258
+ .pipe(takeUntil(this.ngUnsubscribe))
259
+ .subscribe((change) => {
260
+ this.isVisible = change.placement !== null;
261
+ this.changeDetector.markForCheck();
262
+ });
263
+ this.affixer = affixer;
264
+ }
265
+ handleIncomingMessages(message) {
266
+ if (!this.disabled) {
267
+ /* tslint:disable-next-line:switch-default */
268
+ switch (message.type) {
269
+ case SkyDropdownMessageType.Open:
270
+ this.isOpen = true;
271
+ this.positionDropdownMenu();
272
+ break;
273
+ case SkyDropdownMessageType.Close:
274
+ this.isOpen = false;
275
+ this.destroyOverlay();
276
+ break;
277
+ case SkyDropdownMessageType.Reposition:
278
+ // Only reposition the dropdown if it is already open.
279
+ /* istanbul ignore else */
280
+ if (this.isOpen && this.affixer) {
281
+ this.affixer.reaffix();
282
+ }
283
+ break;
284
+ case SkyDropdownMessageType.FocusTriggerButton:
285
+ this.triggerButton.nativeElement.focus();
286
+ break;
287
+ }
288
+ }
289
+ }
290
+ sendMessage(type) {
291
+ this.messageStream.next({ type });
292
+ }
293
+ positionDropdownMenu() {
294
+ this.isVisible = false;
295
+ this.createOverlay();
296
+ this.changeDetector.markForCheck();
297
+ // Explicitly declare the `setTimeout` from the `window` object in order to use the DOM typings
298
+ // during a unit test (instead of confusing this with Node's `setTimeout`).
299
+ this._positionTimeout = window.setTimeout(() => {
300
+ this.affixer.affixTo(this.triggerButton.nativeElement, {
301
+ autoFitContext: SkyAffixAutoFitContext.Viewport,
302
+ enableAutoFit: true,
303
+ horizontalAlignment: parseAffixHorizontalAlignment(this.horizontalAlignment),
304
+ isSticky: true,
305
+ placement: 'below',
306
+ });
307
+ this.isVisible = true;
308
+ this.changeDetector.markForCheck();
309
+ });
310
+ }
311
+ }
312
+ 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 });
313
+ 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 });
314
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyDropdownComponent, decorators: [{
315
+ type: Component,
316
+ args: [{
317
+ selector: 'sky-dropdown',
318
+ templateUrl: './dropdown.component.html',
319
+ styleUrls: ['./dropdown.component.scss'],
320
+ changeDetection: ChangeDetectionStrategy.OnPush,
321
+ }]
322
+ }], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }, { type: i1.SkyAffixService }, { type: i1.SkyOverlayService }, { type: i2.SkyThemeService, decorators: [{
323
+ type: Optional
324
+ }] }]; }, propDecorators: { buttonStyle: [{
325
+ type: Input
326
+ }], buttonType: [{
327
+ type: Input
328
+ }], disabled: [{
329
+ type: Input
330
+ }], dismissOnBlur: [{
331
+ type: Input
332
+ }], label: [{
333
+ type: Input
334
+ }], horizontalAlignment: [{
335
+ type: Input
336
+ }], messageStream: [{
337
+ type: Input
338
+ }], title: [{
339
+ type: Input
340
+ }], trigger: [{
341
+ type: Input
342
+ }], menuContainerElementRef: [{
343
+ type: ViewChild,
344
+ args: ['menuContainerElementRef', {
345
+ read: ElementRef,
346
+ }]
347
+ }], menuContainerTemplateRef: [{
348
+ type: ViewChild,
349
+ args: ['menuContainerTemplateRef', {
350
+ read: TemplateRef,
351
+ static: true,
352
+ }]
353
+ }], triggerButton: [{
354
+ type: ViewChild,
355
+ args: ['triggerButton', {
356
+ read: ElementRef,
357
+ static: true,
358
+ }]
359
+ }] } });
360
+ //# sourceMappingURL=dropdown.component.js.map
@@ -0,0 +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;AAEvB,OAAO,EACL,sBAAsB,EAEtB,eAAe,EAEf,iBAAiB,GAClB,MAAM,aAAa,CAAC;AAErB,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAE/C,OAAO,EAAE,SAAS,IAAI,mBAAmB,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAEjE,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAM3C,OAAO,EAAE,sBAAsB,EAAE,MAAM,+BAA+B,CAAC;AAIvE,OAAO,EAAE,6BAA6B,EAAE,MAAM,uBAAuB,CAAC;;;;;;;AAQtE,MAAM,OAAO,oBAAoB;IAyL/B,YACU,cAAiC,EACjC,YAA6B,EAC7B,cAAiC,EACrB,QAA0B;QAHtC,mBAAc,GAAd,cAAc,CAAmB;QACjC,iBAAY,GAAZ,YAAY,CAAiB;QAC7B,mBAAc,GAAd,cAAc,CAAmB;QACrB,aAAQ,GAAR,QAAQ,CAAkB;QA1GhD;;;WAGG;QAGI,kBAAa,GAAG,IAAI,OAAO,EAAsB,CAAC;QAoDlD,iBAAY,GAAY,KAAK,CAAC;QAE9B,cAAS,GAAY,KAAK,CAAC;QAoB1B,kBAAa,GAAG,IAAI,OAAO,EAAE,CAAC;QAc9B,YAAO,GAAG,KAAK,CAAC;IAarB,CAAC;IA7LJ;;;;;OAKG;IACH,IACW,WAAW,CAAC,KAAa;QAClC,IAAI,CAAC,YAAY,GAAG,KAAK,CAAC;IAC5B,CAAC;IAED,IAA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AAS;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';\n\nimport {\n SkyAffixAutoFitContext,\n SkyAffixer,\n SkyAffixService,\n SkyOverlayInstance,\n SkyOverlayService,\n} from '@skyux/core';\n\nimport { SkyThemeService } from '@skyux/theme';\n\nimport { fromEvent as observableFromEvent, Subject } from 'rxjs';\n\nimport { takeUntil } from 'rxjs/operators';\n\nimport { SkyDropdownHorizontalAlignment } from './types/dropdown-horizontal-alignment';\n\nimport { SkyDropdownMessage } from './types/dropdown-message';\n\nimport { SkyDropdownMessageType } from './types/dropdown-message-type';\n\nimport { SkyDropdownTriggerType } from './types/dropdown-trigger-type';\n\nimport { parseAffixHorizontalAlignment } from './dropdown-extensions';\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: boolean = false;\n\n public isVisible: boolean = false;\n\n public menuId: string;\n\n public menuAriaRole: string;\n\n @ViewChild('menuContainerTemplateRef', {\n read: TemplateRef,\n static: true,\n })\n private menuContainerTemplateRef: TemplateRef<any>;\n\n @ViewChild('triggerButton', {\n read: ElementRef,\n static: true,\n })\n private triggerButton: ElementRef;\n\n private affixer: SkyAffixer;\n\n private ngUnsubscribe = new Subject();\n\n private overlay: SkyOverlayInstance;\n\n private _buttonStyle: string;\n\n private _buttonType: string;\n\n private _disabled: boolean;\n\n private _dismissOnBlur: boolean;\n\n private _horizontalAlignment: SkyDropdownHorizontalAlignment;\n\n private _isOpen = false;\n\n private _menuContainerElementRef: ElementRef;\n\n private _trigger: SkyDropdownTriggerType;\n\n private _positionTimeout: number;\n\n constructor(\n private changeDetector: ChangeDetectorRef,\n private affixService: SkyAffixService,\n private overlayService: SkyOverlayService,\n @Optional() private themeSvc?: SkyThemeService\n ) {}\n\n public ngOnInit(): void {\n this.addEventListeners();\n\n this.messageStream\n .pipe(takeUntil(this.ngUnsubscribe))\n .subscribe((message: SkyDropdownMessage) => {\n this.handleIncomingMessages(message);\n });\n\n // Load proper icons on theme change.\n this.themeSvc?.settingsChange\n .pipe(takeUntil(this.ngUnsubscribe))\n .subscribe(() => {\n this.changeDetector.markForCheck();\n });\n }\n\n public ngOnDestroy(): void {\n this.destroyAffixer();\n this.destroyOverlay();\n clearTimeout(this._positionTimeout);\n\n this.ngUnsubscribe.next();\n this.ngUnsubscribe.complete();\n this.ngUnsubscribe = undefined;\n }\n\n private addEventListeners(): void {\n const buttonElement = this.triggerButton.nativeElement;\n\n observableFromEvent(buttonElement, 'click')\n .pipe(takeUntil(this.ngUnsubscribe))\n .subscribe(() => {\n if (this.isOpen) {\n this.sendMessage(SkyDropdownMessageType.Close);\n } else {\n this.sendMessage(SkyDropdownMessageType.Open);\n // Wait for dropdown to open, then set focus on first item.\n setTimeout(() => {\n this.sendMessage(SkyDropdownMessageType.FocusFirstItem);\n });\n }\n });\n\n observableFromEvent(buttonElement, 'keydown')\n .pipe(takeUntil(this.ngUnsubscribe))\n .subscribe((event: KeyboardEvent) => {\n const key = event.key.toLowerCase();\n\n /* tslint:disable-next-line:switch-default */\n switch (key) {\n case 'escape':\n /*istanbul ignore else*/\n if (this.isOpen) {\n this.sendMessage(SkyDropdownMessageType.Close);\n this.sendMessage(SkyDropdownMessageType.FocusTriggerButton);\n event.stopPropagation();\n }\n break;\n\n case 'tab':\n if (this.isOpen && this.dismissOnBlur) {\n this.sendMessage(SkyDropdownMessageType.Close);\n }\n break;\n\n case 'arrowup':\n case 'up':\n if (!this.isOpen) {\n this.sendMessage(SkyDropdownMessageType.Open);\n this.sendMessage(SkyDropdownMessageType.FocusLastItem);\n event.preventDefault();\n event.stopPropagation();\n }\n break;\n\n case 'enter':\n case 'arrowdown':\n case 'down':\n case ' ': // Spacebar.\n /*istanbul ignore else*/\n if (!this.isOpen) {\n this.sendMessage(SkyDropdownMessageType.Open);\n this.sendMessage(SkyDropdownMessageType.FocusFirstItem);\n event.preventDefault();\n event.stopPropagation();\n }\n break;\n }\n });\n\n observableFromEvent(buttonElement, 'mouseenter')\n .pipe(takeUntil(this.ngUnsubscribe))\n .subscribe(() => {\n this.isMouseEnter = true;\n if (this.trigger === 'hover') {\n this.sendMessage(SkyDropdownMessageType.Open);\n }\n });\n\n observableFromEvent(buttonElement, 'mouseleave')\n .pipe(takeUntil(this.ngUnsubscribe))\n .subscribe(() => {\n this.isMouseEnter = false;\n if (this.trigger === 'hover') {\n // Allow the dropdown menu to set isMouseEnter before checking if the close action\n // should be taken.\n setTimeout(() => {\n if (!this.isMouseEnter) {\n this.sendMessage(SkyDropdownMessageType.Close);\n }\n });\n }\n });\n }\n\n private createOverlay(): void {\n if (this.overlay) {\n return;\n }\n\n const overlay = this.overlayService.create({\n enableScroll: true,\n enablePointerEvents: true,\n });\n\n overlay.attachTemplate(this.menuContainerTemplateRef);\n\n overlay.backdropClick.pipe(takeUntil(this.ngUnsubscribe)).subscribe(() => {\n if (this.dismissOnBlur) {\n this.sendMessage(SkyDropdownMessageType.Close);\n }\n });\n\n this.overlay = overlay;\n }\n\n private destroyAffixer(): void {\n /*istanbul ignore else*/\n if (this.affixer) {\n this.affixer.destroy();\n this.affixer = undefined;\n }\n }\n\n private destroyOverlay(): void {\n /*istanbul ignore else*/\n if (this.overlay) {\n this.overlayService.close(this.overlay);\n this.overlay = undefined;\n }\n }\n\n private createAffixer(): void {\n const affixer = this.affixService.createAffixer(\n this.menuContainerElementRef\n );\n\n affixer.placementChange\n .pipe(takeUntil(this.ngUnsubscribe))\n .subscribe((change) => {\n this.isVisible = change.placement !== null;\n this.changeDetector.markForCheck();\n });\n\n this.affixer = affixer;\n }\n\n private handleIncomingMessages(message: SkyDropdownMessage): void {\n if (!this.disabled) {\n /* tslint:disable-next-line:switch-default */\n switch (message.type) {\n case SkyDropdownMessageType.Open:\n this.isOpen = true;\n this.positionDropdownMenu();\n break;\n\n case SkyDropdownMessageType.Close:\n this.isOpen = false;\n this.destroyOverlay();\n break;\n\n case SkyDropdownMessageType.Reposition:\n // Only reposition the dropdown if it is already open.\n /* istanbul ignore else */\n if (this.isOpen && this.affixer) {\n this.affixer.reaffix();\n }\n break;\n\n case SkyDropdownMessageType.FocusTriggerButton:\n this.triggerButton.nativeElement.focus();\n break;\n }\n }\n }\n\n private sendMessage(type: SkyDropdownMessageType): void {\n this.messageStream.next({ type });\n }\n\n private positionDropdownMenu(): void {\n this.isVisible = false;\n this.createOverlay();\n this.changeDetector.markForCheck();\n\n // Explicitly declare the `setTimeout` from the `window` object in order to use the DOM typings\n // during a unit test (instead of confusing this with Node's `setTimeout`).\n this._positionTimeout = window.setTimeout(() => {\n this.affixer.affixTo(this.triggerButton.nativeElement, {\n autoFitContext: SkyAffixAutoFitContext.Viewport,\n enableAutoFit: true,\n horizontalAlignment: parseAffixHorizontalAlignment(\n this.horizontalAlignment\n ),\n isSticky: true,\n placement: 'below',\n });\n\n this.isVisible = true;\n this.changeDetector.markForCheck();\n });\n }\n}\n","<div class=\"sky-dropdown\">\n <button\n class=\"sky-btn sky-dropdown-button\"\n type=\"button\"\n [attr.aria-expanded]=\"isOpen\"\n [attr.aria-controls]=\"isOpen ? menuId : null\"\n [attr.aria-haspopup]=\"menuAriaRole\"\n [attr.aria-label]=\"\n label || ('skyux_dropdown_context_menu_default_label' | skyLibResources)\n \"\n [attr.title]=\"title\"\n [disabled]=\"disabled\"\n [ngClass]=\"[\n 'sky-dropdown-button-type-' + buttonType,\n 'sky-btn-' + buttonStyle\n ]\"\n #triggerButton\n >\n <ng-container [ngSwitch]=\"buttonType\">\n <ng-template ngSwitchCase=\"context-menu\">\n <sky-icon *skyThemeIf=\"'default'\" icon=\"ellipsis-h\"></sky-icon>\n <sky-icon\n *skyThemeIf=\"'modern'\"\n icon=\"ellipsis\"\n iconType=\"skyux\"\n ></sky-icon>\n </ng-template>\n\n <ng-template ngSwitchDefault>\n <div\n *ngIf=\"buttonType === 'select' || buttonType === 'tab' || !buttonType\"\n class=\"sky-dropdown-button-container\"\n >\n <div class=\"sky-dropdown-button-content-container\">\n <ng-content select=\"sky-dropdown-button\"> </ng-content>\n </div>\n <div class=\"sky-dropdown-button-icon-container\">\n <sky-icon\n *skyThemeIf=\"'default'\"\n class=\"sky-dropdown-caret\"\n icon=\"caret-down\"\n >\n </sky-icon>\n <sky-icon\n *skyThemeIf=\"'modern'\"\n class=\"sky-dropdown-caret\"\n icon=\"chevron-down\"\n iconType=\"skyux\"\n >\n </sky-icon>\n </div>\n </div>\n <div\n *ngIf=\"buttonType !== 'select' && buttonType !== 'tab' && buttonType\"\n >\n <sky-icon [icon]=\"buttonType\" size=\"lg\"></sky-icon>\n </div>\n </ng-template>\n </ng-container>\n </button>\n</div>\n\n<ng-template #menuContainerTemplateRef>\n <div\n class=\"sky-dropdown-menu-container\"\n [class.hidden]=\"!isVisible\"\n #menuContainerElementRef\n >\n <ng-content select=\"sky-dropdown-menu\"></ng-content>\n </div>\n</ng-template>\n"]}
@@ -0,0 +1,60 @@
1
+ import { CommonModule } from '@angular/common';
2
+ import { NgModule } from '@angular/core';
3
+ import { SkyAffixModule, SkyOverlayModule } from '@skyux/core';
4
+ import { SkyIconModule } from '@skyux/indicators';
5
+ import { SkyThemeModule } from '@skyux/theme';
6
+ import { SkyPopoversResourcesModule } from '../shared/sky-popovers-resources.module';
7
+ import { SkyDropdownButtonComponent } from './dropdown-button.component';
8
+ import { SkyDropdownItemComponent } from './dropdown-item.component';
9
+ import { SkyDropdownMenuComponent } from './dropdown-menu.component';
10
+ import { SkyDropdownComponent } from './dropdown.component';
11
+ import * as i0 from "@angular/core";
12
+ export class SkyDropdownModule {
13
+ }
14
+ SkyDropdownModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyDropdownModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
15
+ SkyDropdownModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyDropdownModule, declarations: [SkyDropdownButtonComponent,
16
+ SkyDropdownComponent,
17
+ SkyDropdownItemComponent,
18
+ SkyDropdownMenuComponent], imports: [CommonModule,
19
+ SkyAffixModule,
20
+ SkyIconModule,
21
+ SkyOverlayModule,
22
+ SkyPopoversResourcesModule,
23
+ SkyThemeModule], exports: [SkyDropdownButtonComponent,
24
+ SkyDropdownComponent,
25
+ SkyDropdownItemComponent,
26
+ SkyDropdownMenuComponent] });
27
+ SkyDropdownModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyDropdownModule, imports: [[
28
+ CommonModule,
29
+ SkyAffixModule,
30
+ SkyIconModule,
31
+ SkyOverlayModule,
32
+ SkyPopoversResourcesModule,
33
+ SkyThemeModule,
34
+ ]] });
35
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyDropdownModule, decorators: [{
36
+ type: NgModule,
37
+ args: [{
38
+ declarations: [
39
+ SkyDropdownButtonComponent,
40
+ SkyDropdownComponent,
41
+ SkyDropdownItemComponent,
42
+ SkyDropdownMenuComponent,
43
+ ],
44
+ imports: [
45
+ CommonModule,
46
+ SkyAffixModule,
47
+ SkyIconModule,
48
+ SkyOverlayModule,
49
+ SkyPopoversResourcesModule,
50
+ SkyThemeModule,
51
+ ],
52
+ exports: [
53
+ SkyDropdownButtonComponent,
54
+ SkyDropdownComponent,
55
+ SkyDropdownItemComponent,
56
+ SkyDropdownMenuComponent,
57
+ ],
58
+ }]
59
+ }] });
60
+ //# sourceMappingURL=dropdown.module.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dropdown.module.js","sourceRoot":"","sources":["../../../../../../../../libs/components/popovers/src/lib/modules/dropdown/dropdown.module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAE/C,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEzC,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAE/D,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAElD,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAE9C,OAAO,EAAE,0BAA0B,EAAE,MAAM,yCAAyC,CAAC;AAErF,OAAO,EAAE,0BAA0B,EAAE,MAAM,6BAA6B,CAAC;AAEzE,OAAO,EAAE,wBAAwB,EAAE,MAAM,2BAA2B,CAAC;AAErE,OAAO,EAAE,wBAAwB,EAAE,MAAM,2BAA2B,CAAC;AAErE,OAAO,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;;AAwB5D,MAAM,OAAO,iBAAiB;;+GAAjB,iBAAiB;gHAAjB,iBAAiB,iBApB1B,0BAA0B;QAC1B,oBAAoB;QACpB,wBAAwB;QACxB,wBAAwB,aAGxB,YAAY;QACZ,cAAc;QACd,aAAa;QACb,gBAAgB;QAChB,0BAA0B;QAC1B,cAAc,aAGd,0BAA0B;QAC1B,oBAAoB;QACpB,wBAAwB;QACxB,wBAAwB;gHAGf,iBAAiB,YAfnB;YACP,YAAY;YACZ,cAAc;YACd,aAAa;YACb,gBAAgB;YAChB,0BAA0B;YAC1B,cAAc;SACf;4FAQU,iBAAiB;kBAtB7B,QAAQ;mBAAC;oBACR,YAAY,EAAE;wBACZ,0BAA0B;wBAC1B,oBAAoB;wBACpB,wBAAwB;wBACxB,wBAAwB;qBACzB;oBACD,OAAO,EAAE;wBACP,YAAY;wBACZ,cAAc;wBACd,aAAa;wBACb,gBAAgB;wBAChB,0BAA0B;wBAC1B,cAAc;qBACf;oBACD,OAAO,EAAE;wBACP,0BAA0B;wBAC1B,oBAAoB;wBACpB,wBAAwB;wBACxB,wBAAwB;qBACzB;iBACF","sourcesContent":["import { CommonModule } from '@angular/common';\n\nimport { NgModule } from '@angular/core';\n\nimport { SkyAffixModule, SkyOverlayModule } from '@skyux/core';\n\nimport { SkyIconModule } from '@skyux/indicators';\n\nimport { SkyThemeModule } from '@skyux/theme';\n\nimport { SkyPopoversResourcesModule } from '../shared/sky-popovers-resources.module';\n\nimport { SkyDropdownButtonComponent } from './dropdown-button.component';\n\nimport { SkyDropdownItemComponent } from './dropdown-item.component';\n\nimport { SkyDropdownMenuComponent } from './dropdown-menu.component';\n\nimport { SkyDropdownComponent } from './dropdown.component';\n\n@NgModule({\n declarations: [\n SkyDropdownButtonComponent,\n SkyDropdownComponent,\n SkyDropdownItemComponent,\n SkyDropdownMenuComponent,\n ],\n imports: [\n CommonModule,\n SkyAffixModule,\n SkyIconModule,\n SkyOverlayModule,\n SkyPopoversResourcesModule,\n SkyThemeModule,\n ],\n exports: [\n SkyDropdownButtonComponent,\n SkyDropdownComponent,\n SkyDropdownItemComponent,\n SkyDropdownMenuComponent,\n ],\n})\nexport class SkyDropdownModule {}\n"]}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=dropdown-horizontal-alignment.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dropdown-horizontal-alignment.js","sourceRoot":"","sources":["../../../../../../../../../libs/components/popovers/src/lib/modules/dropdown/types/dropdown-horizontal-alignment.ts"],"names":[],"mappings":"","sourcesContent":["import { SkyAffixHorizontalAlignment } from '@skyux/core';\n\nexport type SkyDropdownHorizontalAlignment = SkyAffixHorizontalAlignment;\n"]}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=dropdown-menu-change.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dropdown-menu-change.js","sourceRoot":"","sources":["../../../../../../../../../libs/components/popovers/src/lib/modules/dropdown/types/dropdown-menu-change.ts"],"names":[],"mappings":"","sourcesContent":["import { SkyDropdownItemComponent } from '../dropdown-item.component';\n\nexport interface SkyDropdownMenuChange {\n /**\n * Indicates the active menu index.\n */\n activeIndex?: number;\n\n /**\n * Indicates the items in the menu.\n */\n items?: SkyDropdownItemComponent[];\n\n /**\n * Indicates the selected item in the menu.\n */\n selectedItem?: SkyDropdownItemComponent;\n}\n"]}
@@ -0,0 +1,37 @@
1
+ export var SkyDropdownMessageType;
2
+ (function (SkyDropdownMessageType) {
3
+ /**
4
+ * Opens the dropdown menu.
5
+ */
6
+ SkyDropdownMessageType[SkyDropdownMessageType["Open"] = 0] = "Open";
7
+ /**
8
+ * Closes the dropdown menu.
9
+ */
10
+ SkyDropdownMessageType[SkyDropdownMessageType["Close"] = 1] = "Close";
11
+ /**
12
+ * Puts focus on the dropdown button.
13
+ */
14
+ SkyDropdownMessageType[SkyDropdownMessageType["FocusTriggerButton"] = 2] = "FocusTriggerButton";
15
+ /**
16
+ * Puts focus on the next item in the dropdown menu.
17
+ */
18
+ SkyDropdownMessageType[SkyDropdownMessageType["FocusNextItem"] = 3] = "FocusNextItem";
19
+ /**
20
+ * Puts focus on the previous item in the dropdown menu.
21
+ */
22
+ SkyDropdownMessageType[SkyDropdownMessageType["FocusPreviousItem"] = 4] = "FocusPreviousItem";
23
+ /**
24
+ * Repositions the dropdown menu next to the dropdown button. This is useful for when the
25
+ * dropdown menu's width and height change while it is open.
26
+ */
27
+ SkyDropdownMessageType[SkyDropdownMessageType["Reposition"] = 5] = "Reposition";
28
+ /**
29
+ * Puts focus on the first item in the dropdown menu.
30
+ */
31
+ SkyDropdownMessageType[SkyDropdownMessageType["FocusFirstItem"] = 6] = "FocusFirstItem";
32
+ /**
33
+ * Puts focus on the last item in the dropdown menu.
34
+ */
35
+ SkyDropdownMessageType[SkyDropdownMessageType["FocusLastItem"] = 7] = "FocusLastItem";
36
+ })(SkyDropdownMessageType || (SkyDropdownMessageType = {}));
37
+ //# sourceMappingURL=dropdown-message-type.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dropdown-message-type.js","sourceRoot":"","sources":["../../../../../../../../../libs/components/popovers/src/lib/modules/dropdown/types/dropdown-message-type.ts"],"names":[],"mappings":"AAAA,MAAM,CAAN,IAAY,sBAyCX;AAzCD,WAAY,sBAAsB;IAChC;;OAEG;IACH,mEAAQ,CAAA;IAER;;OAEG;IACH,qEAAS,CAAA;IAET;;OAEG;IACH,+FAAsB,CAAA;IAEtB;;OAEG;IACH,qFAAiB,CAAA;IAEjB;;OAEG;IACH,6FAAqB,CAAA;IAErB;;;OAGG;IACH,+EAAc,CAAA;IAEd;;OAEG;IACH,uFAAkB,CAAA;IAElB;;OAEG;IACH,qFAAiB,CAAA;AACnB,CAAC,EAzCW,sBAAsB,KAAtB,sBAAsB,QAyCjC","sourcesContent":["export enum SkyDropdownMessageType {\n /**\n * Opens the dropdown menu.\n */\n Open = 0,\n\n /**\n * Closes the dropdown menu.\n */\n Close = 1,\n\n /**\n * Puts focus on the dropdown button.\n */\n FocusTriggerButton = 2,\n\n /**\n * Puts focus on the next item in the dropdown menu.\n */\n FocusNextItem = 3,\n\n /**\n * Puts focus on the previous item in the dropdown menu.\n */\n FocusPreviousItem = 4,\n\n /**\n * Repositions the dropdown menu next to the dropdown button. This is useful for when the\n * dropdown menu's width and height change while it is open.\n */\n Reposition = 5,\n\n /**\n * Puts focus on the first item in the dropdown menu.\n */\n FocusFirstItem = 6,\n\n /**\n * Puts focus on the last item in the dropdown menu.\n */\n FocusLastItem = 7,\n}\n"]}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=dropdown-message.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dropdown-message.js","sourceRoot":"","sources":["../../../../../../../../../libs/components/popovers/src/lib/modules/dropdown/types/dropdown-message.ts"],"names":[],"mappings":"","sourcesContent":["import { SkyDropdownMessageType } from './dropdown-message-type';\n\nexport interface SkyDropdownMessage {\n /**\n * Indicates the type of message to send.\n */\n type?: SkyDropdownMessageType;\n}\n"]}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=dropdown-trigger-type.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dropdown-trigger-type.js","sourceRoot":"","sources":["../../../../../../../../../libs/components/popovers/src/lib/modules/dropdown/types/dropdown-trigger-type.ts"],"names":[],"mappings":"","sourcesContent":["export type SkyDropdownTriggerType = 'click' | 'hover';\n"]}
@@ -0,0 +1,74 @@
1
+ import { Injectable } from '@angular/core';
2
+ import * as i0 from "@angular/core";
3
+ /**
4
+ * @internal
5
+ */
6
+ export class SkyPopoverAdapterService {
7
+ getArrowCoordinates(elements, placement, themeName) {
8
+ const callerRect = elements.caller.nativeElement.getBoundingClientRect();
9
+ const popoverRect = elements.popover.nativeElement.getBoundingClientRect();
10
+ const arrowRect = elements.popoverArrow.nativeElement.getBoundingClientRect();
11
+ const pixelTolerance = 20;
12
+ let top;
13
+ let left;
14
+ if (placement === 'above' || placement === 'below') {
15
+ left = callerRect.left + callerRect.width * 0.5;
16
+ // Make sure the arrow never detaches from the popover.
17
+ if (left - pixelTolerance < popoverRect.left) {
18
+ left = popoverRect.left + pixelTolerance;
19
+ }
20
+ else if (left + pixelTolerance > popoverRect.right) {
21
+ left = popoverRect.right - pixelTolerance;
22
+ }
23
+ if (placement === 'above') {
24
+ if (themeName !== 'modern') {
25
+ top = callerRect.top - arrowRect.height;
26
+ }
27
+ else {
28
+ top = callerRect.top - arrowRect.height + 5;
29
+ }
30
+ }
31
+ else {
32
+ if (themeName !== 'modern') {
33
+ top = callerRect.bottom;
34
+ }
35
+ else {
36
+ top = callerRect.bottom + 4;
37
+ }
38
+ }
39
+ }
40
+ else {
41
+ top = callerRect.top + callerRect.height * 0.5;
42
+ // Make sure the arrow never detaches from the popover.
43
+ if (top - pixelTolerance < popoverRect.top) {
44
+ top = popoverRect.top + pixelTolerance;
45
+ }
46
+ else if (top + pixelTolerance > popoverRect.bottom) {
47
+ top = popoverRect.bottom - pixelTolerance;
48
+ }
49
+ if (placement === 'left') {
50
+ if (themeName !== 'modern') {
51
+ left = callerRect.left - arrowRect.width;
52
+ }
53
+ else {
54
+ left = callerRect.left - arrowRect.width + 5;
55
+ }
56
+ }
57
+ else {
58
+ if (themeName !== 'modern') {
59
+ left = callerRect.right;
60
+ }
61
+ else {
62
+ left = callerRect.right + 4;
63
+ }
64
+ }
65
+ }
66
+ return { top, left };
67
+ }
68
+ }
69
+ SkyPopoverAdapterService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyPopoverAdapterService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
70
+ SkyPopoverAdapterService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyPopoverAdapterService });
71
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyPopoverAdapterService, decorators: [{
72
+ type: Injectable
73
+ }] });
74
+ //# sourceMappingURL=popover-adapter.service.js.map