@skyux/popovers 5.7.2 → 6.0.0-beta.2

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 (135) hide show
  1. package/documentation.json +2 -2
  2. package/esm2020/index.mjs +23 -0
  3. package/esm2020/lib/modules/dropdown/dropdown-button.component.mjs +14 -0
  4. package/esm2020/lib/modules/dropdown/dropdown-extensions.mjs +14 -0
  5. package/esm2020/lib/modules/dropdown/dropdown-item.component.mjs +69 -0
  6. package/esm2020/lib/modules/dropdown/dropdown-menu.component.mjs +305 -0
  7. package/esm2020/lib/modules/dropdown/dropdown.component.mjs +359 -0
  8. package/esm2020/lib/modules/dropdown/dropdown.module.mjs +60 -0
  9. package/esm2020/lib/modules/dropdown/types/dropdown-horizontal-alignment.mjs +2 -0
  10. package/esm2020/lib/modules/dropdown/types/dropdown-menu-change.mjs +2 -0
  11. package/esm2020/lib/modules/dropdown/types/dropdown-message-type.mjs +40 -0
  12. package/esm2020/lib/modules/dropdown/types/dropdown-message.mjs +2 -0
  13. package/esm2020/lib/modules/dropdown/types/dropdown-trigger-type.mjs +2 -0
  14. package/esm2020/lib/modules/popover/popover-adapter.service.mjs +74 -0
  15. package/esm2020/lib/modules/popover/popover-animation-state.mjs +2 -0
  16. package/esm2020/lib/modules/popover/popover-animation.mjs +19 -0
  17. package/esm2020/lib/modules/popover/popover-content.component.mjs +261 -0
  18. package/esm2020/lib/modules/popover/popover-context.mjs +10 -0
  19. package/esm2020/lib/modules/popover/popover-extensions.mjs +29 -0
  20. package/esm2020/lib/modules/popover/popover.component.mjs +198 -0
  21. package/esm2020/lib/modules/popover/popover.directive.mjs +176 -0
  22. package/esm2020/lib/modules/popover/popover.module.mjs +55 -0
  23. package/esm2020/lib/modules/popover/types/popover-adapter-arrow-coordinates.mjs +2 -0
  24. package/esm2020/lib/modules/popover/types/popover-adapter-elements.mjs +2 -0
  25. package/esm2020/lib/modules/popover/types/popover-alignment.mjs +2 -0
  26. package/esm2020/lib/modules/popover/types/popover-message-type.mjs +24 -0
  27. package/esm2020/lib/modules/popover/types/popover-message.mjs +2 -0
  28. package/esm2020/lib/modules/popover/types/popover-placement.mjs +2 -0
  29. package/esm2020/lib/modules/popover/types/popover-position.mjs +2 -0
  30. package/esm2020/lib/modules/popover/types/popover-trigger.mjs +2 -0
  31. package/esm2020/lib/modules/shared/sky-popovers-resources.module.mjs +47 -0
  32. package/esm2020/skyux-popovers.mjs +5 -0
  33. package/esm2020/testing/dropdown/dropdown-fixture.mjs +133 -0
  34. package/esm2020/testing/dropdown/dropdown-testing.module.mjs +15 -0
  35. package/esm2020/testing/dropdown/popovers-fixture-dropdown-item.mjs +2 -0
  36. package/esm2020/testing/dropdown/popovers-fixture-dropdown-menu.mjs +2 -0
  37. package/esm2020/testing/dropdown/popovers-fixture-dropdown.mjs +2 -0
  38. package/esm2020/testing/popover/popover-fixture.mjs +86 -0
  39. package/esm2020/testing/popover/popover-testing.module.mjs +29 -0
  40. package/esm2020/testing/public-api.mjs +8 -0
  41. package/esm2020/testing/skyux-popovers-testing.mjs +5 -0
  42. package/fesm2015/{skyux-popovers-testing.js → skyux-popovers-testing.mjs} +9 -9
  43. package/fesm2015/skyux-popovers-testing.mjs.map +1 -0
  44. package/fesm2015/skyux-popovers.mjs +1705 -0
  45. package/fesm2015/skyux-popovers.mjs.map +1 -0
  46. package/fesm2020/skyux-popovers-testing.mjs +266 -0
  47. package/fesm2020/skyux-popovers-testing.mjs.map +1 -0
  48. package/{fesm2015/skyux-popovers.js → fesm2020/skyux-popovers.mjs} +53 -88
  49. package/fesm2020/skyux-popovers.mjs.map +1 -0
  50. package/package.json +40 -16
  51. package/testing/package.json +5 -5
  52. package/bundles/skyux-popovers-testing.umd.js +0 -682
  53. package/bundles/skyux-popovers.umd.js +0 -1889
  54. package/esm2015/index.js +0 -23
  55. package/esm2015/index.js.map +0 -1
  56. package/esm2015/lib/modules/dropdown/dropdown-button.component.js +0 -17
  57. package/esm2015/lib/modules/dropdown/dropdown-button.component.js.map +0 -1
  58. package/esm2015/lib/modules/dropdown/dropdown-extensions.js +0 -14
  59. package/esm2015/lib/modules/dropdown/dropdown-extensions.js.map +0 -1
  60. package/esm2015/lib/modules/dropdown/dropdown-item.component.js +0 -75
  61. package/esm2015/lib/modules/dropdown/dropdown-item.component.js.map +0 -1
  62. package/esm2015/lib/modules/dropdown/dropdown-menu.component.js +0 -311
  63. package/esm2015/lib/modules/dropdown/dropdown-menu.component.js.map +0 -1
  64. package/esm2015/lib/modules/dropdown/dropdown.component.js +0 -363
  65. package/esm2015/lib/modules/dropdown/dropdown.component.js.map +0 -1
  66. package/esm2015/lib/modules/dropdown/dropdown.module.js +0 -60
  67. package/esm2015/lib/modules/dropdown/dropdown.module.js.map +0 -1
  68. package/esm2015/lib/modules/dropdown/types/dropdown-horizontal-alignment.js +0 -2
  69. package/esm2015/lib/modules/dropdown/types/dropdown-horizontal-alignment.js.map +0 -1
  70. package/esm2015/lib/modules/dropdown/types/dropdown-menu-change.js +0 -2
  71. package/esm2015/lib/modules/dropdown/types/dropdown-menu-change.js.map +0 -1
  72. package/esm2015/lib/modules/dropdown/types/dropdown-message-type.js +0 -40
  73. package/esm2015/lib/modules/dropdown/types/dropdown-message-type.js.map +0 -1
  74. package/esm2015/lib/modules/dropdown/types/dropdown-message.js +0 -2
  75. package/esm2015/lib/modules/dropdown/types/dropdown-message.js.map +0 -1
  76. package/esm2015/lib/modules/dropdown/types/dropdown-trigger-type.js +0 -2
  77. package/esm2015/lib/modules/dropdown/types/dropdown-trigger-type.js.map +0 -1
  78. package/esm2015/lib/modules/popover/popover-adapter.service.js +0 -74
  79. package/esm2015/lib/modules/popover/popover-adapter.service.js.map +0 -1
  80. package/esm2015/lib/modules/popover/popover-animation-state.js +0 -2
  81. package/esm2015/lib/modules/popover/popover-animation-state.js.map +0 -1
  82. package/esm2015/lib/modules/popover/popover-animation.js +0 -19
  83. package/esm2015/lib/modules/popover/popover-animation.js.map +0 -1
  84. package/esm2015/lib/modules/popover/popover-content.component.js +0 -271
  85. package/esm2015/lib/modules/popover/popover-content.component.js.map +0 -1
  86. package/esm2015/lib/modules/popover/popover-context.js +0 -10
  87. package/esm2015/lib/modules/popover/popover-context.js.map +0 -1
  88. package/esm2015/lib/modules/popover/popover-extensions.js +0 -29
  89. package/esm2015/lib/modules/popover/popover-extensions.js.map +0 -1
  90. package/esm2015/lib/modules/popover/popover.component.js +0 -203
  91. package/esm2015/lib/modules/popover/popover.component.js.map +0 -1
  92. package/esm2015/lib/modules/popover/popover.directive.js +0 -176
  93. package/esm2015/lib/modules/popover/popover.directive.js.map +0 -1
  94. package/esm2015/lib/modules/popover/popover.module.js +0 -56
  95. package/esm2015/lib/modules/popover/popover.module.js.map +0 -1
  96. package/esm2015/lib/modules/popover/types/popover-adapter-arrow-coordinates.js +0 -2
  97. package/esm2015/lib/modules/popover/types/popover-adapter-arrow-coordinates.js.map +0 -1
  98. package/esm2015/lib/modules/popover/types/popover-adapter-elements.js +0 -2
  99. package/esm2015/lib/modules/popover/types/popover-adapter-elements.js.map +0 -1
  100. package/esm2015/lib/modules/popover/types/popover-alignment.js +0 -2
  101. package/esm2015/lib/modules/popover/types/popover-alignment.js.map +0 -1
  102. package/esm2015/lib/modules/popover/types/popover-message-type.js +0 -24
  103. package/esm2015/lib/modules/popover/types/popover-message-type.js.map +0 -1
  104. package/esm2015/lib/modules/popover/types/popover-message.js +0 -2
  105. package/esm2015/lib/modules/popover/types/popover-message.js.map +0 -1
  106. package/esm2015/lib/modules/popover/types/popover-placement.js +0 -2
  107. package/esm2015/lib/modules/popover/types/popover-placement.js.map +0 -1
  108. package/esm2015/lib/modules/popover/types/popover-position.js +0 -2
  109. package/esm2015/lib/modules/popover/types/popover-position.js.map +0 -1
  110. package/esm2015/lib/modules/popover/types/popover-trigger.js +0 -2
  111. package/esm2015/lib/modules/popover/types/popover-trigger.js.map +0 -1
  112. package/esm2015/lib/modules/shared/sky-popovers-resources.module.js +0 -47
  113. package/esm2015/lib/modules/shared/sky-popovers-resources.module.js.map +0 -1
  114. package/esm2015/skyux-popovers.js +0 -5
  115. package/esm2015/skyux-popovers.js.map +0 -1
  116. package/esm2015/testing/dropdown/dropdown-fixture.js +0 -138
  117. package/esm2015/testing/dropdown/dropdown-fixture.js.map +0 -1
  118. package/esm2015/testing/dropdown/dropdown-testing.module.js +0 -15
  119. package/esm2015/testing/dropdown/dropdown-testing.module.js.map +0 -1
  120. package/esm2015/testing/dropdown/popovers-fixture-dropdown-item.js +0 -2
  121. package/esm2015/testing/dropdown/popovers-fixture-dropdown-item.js.map +0 -1
  122. package/esm2015/testing/dropdown/popovers-fixture-dropdown-menu.js +0 -2
  123. package/esm2015/testing/dropdown/popovers-fixture-dropdown-menu.js.map +0 -1
  124. package/esm2015/testing/dropdown/popovers-fixture-dropdown.js +0 -2
  125. package/esm2015/testing/dropdown/popovers-fixture-dropdown.js.map +0 -1
  126. package/esm2015/testing/popover/popover-fixture.js +0 -86
  127. package/esm2015/testing/popover/popover-fixture.js.map +0 -1
  128. package/esm2015/testing/popover/popover-testing.module.js +0 -29
  129. package/esm2015/testing/popover/popover-testing.module.js.map +0 -1
  130. package/esm2015/testing/public-api.js +0 -8
  131. package/esm2015/testing/public-api.js.map +0 -1
  132. package/esm2015/testing/skyux-popovers-testing.js +0 -5
  133. package/esm2015/testing/skyux-popovers-testing.js.map +0 -1
  134. package/fesm2015/skyux-popovers-testing.js.map +0 -1
  135. package/fesm2015/skyux-popovers.js.map +0 -1
@@ -1,74 +0,0 @@
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
@@ -1 +0,0 @@
1
- {"version":3,"file":"popover-adapter.service.js","sourceRoot":"","sources":["../../../../../../../../libs/components/popovers/src/lib/modules/popover/popover-adapter.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;;AAM3C;;GAEG;AAEH,MAAM,OAAO,wBAAwB;IAC5B,mBAAmB,CACxB,QAAmC,EACnC,SAA8B,EAC9B,SAAkB;QAElB,MAAM,UAAU,GAAG,QAAQ,CAAC,MAAM,CAAC,aAAa,CAAC,qBAAqB,EAAE,CAAC;QACzE,MAAM,WAAW,GAAG,QAAQ,CAAC,OAAO,CAAC,aAAa,CAAC,qBAAqB,EAAE,CAAC;QAC3E,MAAM,SAAS,GACb,QAAQ,CAAC,YAAY,CAAC,aAAa,CAAC,qBAAqB,EAAE,CAAC;QAE9D,MAAM,cAAc,GAAG,EAAE,CAAC;QAE1B,IAAI,GAAW,CAAC;QAChB,IAAI,IAAY,CAAC;QAEjB,IAAI,SAAS,KAAK,OAAO,IAAI,SAAS,KAAK,OAAO,EAAE;YAClD,IAAI,GAAG,UAAU,CAAC,IAAI,GAAG,UAAU,CAAC,KAAK,GAAG,GAAG,CAAC;YAEhD,uDAAuD;YACvD,IAAI,IAAI,GAAG,cAAc,GAAG,WAAW,CAAC,IAAI,EAAE;gBAC5C,IAAI,GAAG,WAAW,CAAC,IAAI,GAAG,cAAc,CAAC;aAC1C;iBAAM,IAAI,IAAI,GAAG,cAAc,GAAG,WAAW,CAAC,KAAK,EAAE;gBACpD,IAAI,GAAG,WAAW,CAAC,KAAK,GAAG,cAAc,CAAC;aAC3C;YAED,IAAI,SAAS,KAAK,OAAO,EAAE;gBACzB,IAAI,SAAS,KAAK,QAAQ,EAAE;oBAC1B,GAAG,GAAG,UAAU,CAAC,GAAG,GAAG,SAAS,CAAC,MAAM,CAAC;iBACzC;qBAAM;oBACL,GAAG,GAAG,UAAU,CAAC,GAAG,GAAG,SAAS,CAAC,MAAM,GAAG,CAAC,CAAC;iBAC7C;aACF;iBAAM;gBACL,IAAI,SAAS,KAAK,QAAQ,EAAE;oBAC1B,GAAG,GAAG,UAAU,CAAC,MAAM,CAAC;iBACzB;qBAAM;oBACL,GAAG,GAAG,UAAU,CAAC,MAAM,GAAG,CAAC,CAAC;iBAC7B;aACF;SACF;aAAM;YACL,GAAG,GAAG,UAAU,CAAC,GAAG,GAAG,UAAU,CAAC,MAAM,GAAG,GAAG,CAAC;YAE/C,uDAAuD;YACvD,IAAI,GAAG,GAAG,cAAc,GAAG,WAAW,CAAC,GAAG,EAAE;gBAC1C,GAAG,GAAG,WAAW,CAAC,GAAG,GAAG,cAAc,CAAC;aACxC;iBAAM,IAAI,GAAG,GAAG,cAAc,GAAG,WAAW,CAAC,MAAM,EAAE;gBACpD,GAAG,GAAG,WAAW,CAAC,MAAM,GAAG,cAAc,CAAC;aAC3C;YAED,IAAI,SAAS,KAAK,MAAM,EAAE;gBACxB,IAAI,SAAS,KAAK,QAAQ,EAAE;oBAC1B,IAAI,GAAG,UAAU,CAAC,IAAI,GAAG,SAAS,CAAC,KAAK,CAAC;iBAC1C;qBAAM;oBACL,IAAI,GAAG,UAAU,CAAC,IAAI,GAAG,SAAS,CAAC,KAAK,GAAG,CAAC,CAAC;iBAC9C;aACF;iBAAM;gBACL,IAAI,SAAS,KAAK,QAAQ,EAAE;oBAC1B,IAAI,GAAG,UAAU,CAAC,KAAK,CAAC;iBACzB;qBAAM;oBACL,IAAI,GAAG,UAAU,CAAC,KAAK,GAAG,CAAC,CAAC;iBAC7B;aACF;SACF;QAED,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,CAAC;IACvB,CAAC;;sHAjEU,wBAAwB;0HAAxB,wBAAwB;4FAAxB,wBAAwB;kBADpC,UAAU","sourcesContent":["import { Injectable } from '@angular/core';\n\nimport { SkyPopoverAdapterArrowCoordinates } from './types/popover-adapter-arrow-coordinates';\nimport { SkyPopoverAdapterElements } from './types/popover-adapter-elements';\nimport { SkyPopoverPlacement } from './types/popover-placement';\n\n/**\n * @internal\n */\n@Injectable()\nexport class SkyPopoverAdapterService {\n public getArrowCoordinates(\n elements: SkyPopoverAdapterElements,\n placement: SkyPopoverPlacement,\n themeName?: string\n ): SkyPopoverAdapterArrowCoordinates {\n const callerRect = elements.caller.nativeElement.getBoundingClientRect();\n const popoverRect = elements.popover.nativeElement.getBoundingClientRect();\n const arrowRect =\n elements.popoverArrow.nativeElement.getBoundingClientRect();\n\n const pixelTolerance = 20;\n\n let top: number;\n let left: number;\n\n if (placement === 'above' || placement === 'below') {\n left = callerRect.left + callerRect.width * 0.5;\n\n // Make sure the arrow never detaches from the popover.\n if (left - pixelTolerance < popoverRect.left) {\n left = popoverRect.left + pixelTolerance;\n } else if (left + pixelTolerance > popoverRect.right) {\n left = popoverRect.right - pixelTolerance;\n }\n\n if (placement === 'above') {\n if (themeName !== 'modern') {\n top = callerRect.top - arrowRect.height;\n } else {\n top = callerRect.top - arrowRect.height + 5;\n }\n } else {\n if (themeName !== 'modern') {\n top = callerRect.bottom;\n } else {\n top = callerRect.bottom + 4;\n }\n }\n } else {\n top = callerRect.top + callerRect.height * 0.5;\n\n // Make sure the arrow never detaches from the popover.\n if (top - pixelTolerance < popoverRect.top) {\n top = popoverRect.top + pixelTolerance;\n } else if (top + pixelTolerance > popoverRect.bottom) {\n top = popoverRect.bottom - pixelTolerance;\n }\n\n if (placement === 'left') {\n if (themeName !== 'modern') {\n left = callerRect.left - arrowRect.width;\n } else {\n left = callerRect.left - arrowRect.width + 5;\n }\n } else {\n if (themeName !== 'modern') {\n left = callerRect.right;\n } else {\n left = callerRect.right + 4;\n }\n }\n }\n\n return { top, left };\n }\n}\n"]}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=popover-animation-state.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"popover-animation-state.js","sourceRoot":"","sources":["../../../../../../../../libs/components/popovers/src/lib/modules/popover/popover-animation-state.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * @internal\n */\nexport type SkyPopoverAnimationState = 'open' | 'closed';\n"]}
@@ -1,19 +0,0 @@
1
- import { animate, state, style, transition, trigger, } from '@angular/animations';
2
- /**
3
- * @internal
4
- */
5
- export const skyPopoverAnimation = trigger('skyPopoverAnimation', [
6
- state('void', style({
7
- opacity: 0,
8
- })),
9
- state('open', style({
10
- opacity: 1,
11
- })),
12
- state('closed', style({
13
- opacity: 0,
14
- })),
15
- transition('void => *', [animate('250ms')]),
16
- transition('open => closed', [animate('150ms')]),
17
- transition('closed => open', [animate('150ms')]),
18
- ]);
19
- //# sourceMappingURL=popover-animation.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"popover-animation.js","sourceRoot":"","sources":["../../../../../../../../libs/components/popovers/src/lib/modules/popover/popover-animation.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,OAAO,EACP,KAAK,EACL,KAAK,EACL,UAAU,EACV,OAAO,GACR,MAAM,qBAAqB,CAAC;AAE7B;;GAEG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAA6B,OAAO,CAClE,qBAAqB,EACrB;IACE,KAAK,CACH,MAAM,EACN,KAAK,CAAC;QACJ,OAAO,EAAE,CAAC;KACX,CAAC,CACH;IACD,KAAK,CACH,MAAM,EACN,KAAK,CAAC;QACJ,OAAO,EAAE,CAAC;KACX,CAAC,CACH;IACD,KAAK,CACH,QAAQ,EACR,KAAK,CAAC;QACJ,OAAO,EAAE,CAAC;KACX,CAAC,CACH;IACD,UAAU,CAAC,WAAW,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC;IAC3C,UAAU,CAAC,gBAAgB,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC;IAChD,UAAU,CAAC,gBAAgB,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC;CACjD,CACF,CAAC","sourcesContent":["import {\n AnimationTriggerMetadata,\n animate,\n state,\n style,\n transition,\n trigger,\n} from '@angular/animations';\n\n/**\n * @internal\n */\nexport const skyPopoverAnimation: AnimationTriggerMetadata = trigger(\n 'skyPopoverAnimation',\n [\n state(\n 'void',\n style({\n opacity: 0,\n })\n ),\n state(\n 'open',\n style({\n opacity: 1,\n })\n ),\n state(\n 'closed',\n style({\n opacity: 0,\n })\n ),\n transition('void => *', [animate('250ms')]),\n transition('open => closed', [animate('150ms')]),\n transition('closed => open', [animate('150ms')]),\n ]\n);\n"]}
@@ -1,271 +0,0 @@
1
- import { ChangeDetectorRef, Component, ElementRef, Optional, ViewChild, ViewContainerRef, } from '@angular/core';
2
- import { SkyAffixAutoFitContext, SkyAffixService, SkyCoreAdapterService, } from '@skyux/core';
3
- import { SkyThemeService } from '@skyux/theme';
4
- import { Subject, fromEvent as observableFromEvent } from 'rxjs';
5
- import { takeUntil } from 'rxjs/operators';
6
- import { SkyPopoverAdapterService } from './popover-adapter.service';
7
- import { skyPopoverAnimation } from './popover-animation';
8
- import { SkyPopoverContext } from './popover-context';
9
- import { parseAffixHorizontalAlignment, parseAffixPlacement, } from './popover-extensions';
10
- import * as i0 from "@angular/core";
11
- import * as i1 from "@skyux/core";
12
- import * as i2 from "./popover-adapter.service";
13
- import * as i3 from "./popover-context";
14
- import * as i4 from "@skyux/theme";
15
- import * as i5 from "@angular/common";
16
- /**
17
- * @internal
18
- */
19
- export class SkyPopoverContentComponent {
20
- constructor(changeDetector, elementRef, affixService, coreAdapterService, adapterService, context, themeSvc) {
21
- this.changeDetector = changeDetector;
22
- this.elementRef = elementRef;
23
- this.affixService = affixService;
24
- this.coreAdapterService = coreAdapterService;
25
- this.adapterService = adapterService;
26
- this.context = context;
27
- this.themeSvc = themeSvc;
28
- this.dismissOnBlur = true;
29
- this.enableAnimations = true;
30
- this.isOpen = false;
31
- this.popoverType = 'info';
32
- this.ngUnsubscribe = new Subject();
33
- this._closed = new Subject();
34
- this._isMouseEnter = new Subject();
35
- this._opened = new Subject();
36
- }
37
- get animationState() {
38
- return this.isOpen ? 'open' : 'closed';
39
- }
40
- get closed() {
41
- return this._closed.asObservable();
42
- }
43
- get opened() {
44
- return this._opened.asObservable();
45
- }
46
- get isMouseEnter() {
47
- return this._isMouseEnter.asObservable();
48
- }
49
- ngOnInit() {
50
- var _a;
51
- /*istanbul ignore next*/
52
- this.contentTarget.createEmbeddedView((_a = this.context) === null || _a === void 0 ? void 0 : _a.contentTemplateRef);
53
- this.addEventListeners();
54
- /*istanbul ignore else*/
55
- if (this.themeSvc) {
56
- this.themeSvc.settingsChange
57
- .pipe(takeUntil(this.ngUnsubscribe))
58
- .subscribe((themeSettings) => {
59
- var _a, _b;
60
- /*istanbul ignore next*/
61
- this.themeName = (_b = (_a = themeSettings.currentSettings) === null || _a === void 0 ? void 0 : _a.theme) === null || _b === void 0 ? void 0 : _b.name;
62
- });
63
- }
64
- }
65
- ngOnDestroy() {
66
- this.ngUnsubscribe.next();
67
- this.ngUnsubscribe.complete();
68
- this._closed.complete();
69
- this._isMouseEnter.complete();
70
- this._opened.complete();
71
- /* istanbul ignore else */
72
- if (this.affixer) {
73
- this.affixer.destroy();
74
- }
75
- this._closed =
76
- this._isMouseEnter =
77
- this._opened =
78
- this.affixer =
79
- this.ngUnsubscribe =
80
- undefined;
81
- }
82
- onAnimationEvent(event) {
83
- var _a, _b;
84
- if (event.fromState === 'void') {
85
- return;
86
- }
87
- if (event.phaseName === 'done') {
88
- if (event.toState === 'open') {
89
- /*istanbul ignore next*/
90
- (_a = this._opened) === null || _a === void 0 ? void 0 : _a.next();
91
- }
92
- else {
93
- /*istanbul ignore next*/
94
- (_b = this._closed) === null || _b === void 0 ? void 0 : _b.next();
95
- }
96
- }
97
- }
98
- open(caller, config) {
99
- this.caller = caller;
100
- this.dismissOnBlur = config.dismissOnBlur;
101
- this.enableAnimations = config.enableAnimations;
102
- this.horizontalAlignment = config.horizontalAlignment;
103
- this.placement = config.placement;
104
- this.popoverTitle = config.popoverTitle;
105
- if (config.popoverType) {
106
- this.popoverType = config.popoverType;
107
- }
108
- this.changeDetector.markForCheck();
109
- // Indicates if the popover should be displayed statically.
110
- // Please note: This feature is internal-only and used by the visual tests to capture multiple
111
- // states simultaneously without the overhead of event listeners.
112
- /* istanbul ignore if */
113
- if (config.isStatic) {
114
- this.isOpen = true;
115
- this.changeDetector.markForCheck();
116
- return;
117
- }
118
- // Let the styles render before gauging the affix dimensions.
119
- 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) {
125
- return;
126
- }
127
- if (!this.affixer) {
128
- this.setupAffixer();
129
- }
130
- const affixOptions = {
131
- autoFitContext: SkyAffixAutoFitContext.Viewport,
132
- enableAutoFit: true,
133
- horizontalAlignment: parseAffixHorizontalAlignment(this.horizontalAlignment),
134
- isSticky: true,
135
- placement: parseAffixPlacement(this.placement),
136
- };
137
- // Ensure that we are positioning the vertical alginment correctly. These
138
- // are the default alignments for all popovers but ensure that we are future proof here.
139
- if (affixOptions.placement === 'left' ||
140
- affixOptions.placement === 'right') {
141
- affixOptions.verticalAlignment = 'middle';
142
- }
143
- else if (affixOptions.placement === 'above') {
144
- affixOptions.verticalAlignment = 'bottom';
145
- }
146
- else {
147
- affixOptions.verticalAlignment = 'top';
148
- }
149
- this.affixer.affixTo(this.caller.nativeElement, affixOptions);
150
- this.updateArrowOffset();
151
- this.isOpen = true;
152
- this.changeDetector.markForCheck();
153
- });
154
- }
155
- close() {
156
- this.isOpen = false;
157
- this.changeDetector.markForCheck();
158
- }
159
- applyFocus() {
160
- if (this.isOpen) {
161
- this.coreAdapterService.getFocusableChildrenAndApplyFocus(this.popoverRef, '.sky-popover', true);
162
- }
163
- }
164
- setupAffixer() {
165
- const affixer = this.affixService.createAffixer(this.popoverRef);
166
- affixer.offsetChange.pipe(takeUntil(this.ngUnsubscribe)).subscribe(() => {
167
- this.updateArrowOffset();
168
- this.changeDetector.markForCheck();
169
- });
170
- affixer.overflowScroll.pipe(takeUntil(this.ngUnsubscribe)).subscribe(() => {
171
- this.updateArrowOffset();
172
- this.changeDetector.markForCheck();
173
- });
174
- affixer.placementChange
175
- .pipe(takeUntil(this.ngUnsubscribe))
176
- .subscribe((change) => {
177
- this.placement = change.placement;
178
- this.changeDetector.markForCheck();
179
- });
180
- this.affixer = affixer;
181
- }
182
- updateArrowOffset() {
183
- const { top, left } = this.adapterService.getArrowCoordinates({
184
- caller: this.caller,
185
- popover: this.popoverRef,
186
- popoverArrow: this.arrowRef,
187
- }, this.placement, this.themeName);
188
- this.arrowTop = top;
189
- this.arrowLeft = left;
190
- }
191
- isFocusLeavingElement(event) {
192
- const focusableItems = this.coreAdapterService.getFocusableChildren(this.elementRef.nativeElement);
193
- const isFirstItem = focusableItems[0] === event.target && event.shiftKey;
194
- const isLastItem = focusableItems[focusableItems.length - 1] === event.target &&
195
- !event.shiftKey;
196
- return focusableItems.length === 0 || isFirstItem || isLastItem;
197
- }
198
- addEventListeners() {
199
- const hostElement = this.elementRef.nativeElement;
200
- observableFromEvent(hostElement, 'mouseenter')
201
- .pipe(takeUntil(this.ngUnsubscribe))
202
- .subscribe(() => this._isMouseEnter.next(true));
203
- observableFromEvent(hostElement, 'mouseleave')
204
- .pipe(takeUntil(this.ngUnsubscribe))
205
- .subscribe(() => this._isMouseEnter.next(false));
206
- observableFromEvent(hostElement, 'keydown')
207
- .pipe(takeUntil(this.ngUnsubscribe))
208
- .subscribe((event) => {
209
- const key = event.key.toLowerCase();
210
- /* tslint:disable-next-line:switch-default */
211
- switch (key) {
212
- case 'escape':
213
- this.close();
214
- this.caller.nativeElement.focus();
215
- event.preventDefault();
216
- event.stopPropagation();
217
- break;
218
- // Since the popover now lives in an overlay at the bottom of the document body, we need
219
- // to handle the tab key ourselves. Otherwise, focus would be moved to the browser's
220
- // search bar.
221
- case 'tab':
222
- if (!this.dismissOnBlur) {
223
- return;
224
- }
225
- /*istanbul ignore else*/
226
- if (this.isFocusLeavingElement(event)) {
227
- this.close();
228
- this.caller.nativeElement.focus();
229
- event.preventDefault();
230
- event.stopPropagation();
231
- }
232
- break;
233
- }
234
- });
235
- }
236
- }
237
- 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 });
238
- 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] });
239
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyPopoverContentComponent, decorators: [{
240
- type: Component,
241
- args: [{
242
- selector: 'sky-popover-content',
243
- templateUrl: './popover-content.component.html',
244
- styleUrls: ['./popover-content.component.scss'],
245
- animations: [skyPopoverAnimation],
246
- providers: [SkyPopoverAdapterService],
247
- }]
248
- }], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }, { type: i0.ElementRef }, { type: i1.SkyAffixService }, { type: i1.SkyCoreAdapterService }, { type: i2.SkyPopoverAdapterService }, { type: i3.SkyPopoverContext, decorators: [{
249
- type: Optional
250
- }] }, { type: i4.SkyThemeService, decorators: [{
251
- type: Optional
252
- }] }]; }, propDecorators: { arrowRef: [{
253
- type: ViewChild,
254
- args: ['arrowRef', {
255
- read: ElementRef,
256
- static: true,
257
- }]
258
- }], popoverRef: [{
259
- type: ViewChild,
260
- args: ['popoverRef', {
261
- read: ElementRef,
262
- static: true,
263
- }]
264
- }], contentTarget: [{
265
- type: ViewChild,
266
- args: ['contentTarget', {
267
- read: ViewContainerRef,
268
- static: true,
269
- }]
270
- }] } });
271
- //# sourceMappingURL=popover-content.component.js.map
@@ -1 +0,0 @@
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.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AAwB,CAAC;iBACtC;;0BA0EI,QAAQ;;0BACR,QAAQ;4CA/BH,QAAQ;sBAJf,SAAS;uBAAC,UAAU,EAAE;wBACrB,IAAI,EAAE,UAAU;wBAChB,MAAM,EAAE,IAAI;qBACb;gBAOO,UAAU;sBAJjB,SAAS;uBAAC,YAAY,EAAE;wBACvB,IAAI,EAAE,UAAU;wBAChB,MAAM,EAAE,IAAI;qBACb;gBAOO,aAAa;sBAJpB,SAAS;uBAAC,eAAe,EAAE;wBAC1B,IAAI,EAAE,gBAAgB;wBACtB,MAAM,EAAE,IAAI;qBACb","sourcesContent":["import { AnimationEvent } from '@angular/animations';\nimport {\n ChangeDetectorRef,\n Component,\n ElementRef,\n OnDestroy,\n OnInit,\n Optional,\n ViewChild,\n ViewContainerRef,\n} from '@angular/core';\nimport {\n SkyAffixAutoFitContext,\n SkyAffixConfig,\n SkyAffixService,\n SkyAffixer,\n SkyCoreAdapterService,\n} from '@skyux/core';\nimport { SkyThemeService } from '@skyux/theme';\n\nimport { Observable, Subject, fromEvent as observableFromEvent } from 'rxjs';\nimport { takeUntil } from 'rxjs/operators';\n\nimport { SkyPopoverAdapterService } from './popover-adapter.service';\nimport { skyPopoverAnimation } from './popover-animation';\nimport { SkyPopoverAnimationState } from './popover-animation-state';\nimport { SkyPopoverContext } from './popover-context';\nimport {\n parseAffixHorizontalAlignment,\n parseAffixPlacement,\n} from './popover-extensions';\nimport { SkyPopoverAlignment } from './types/popover-alignment';\nimport { SkyPopoverPlacement } from './types/popover-placement';\n\n/**\n * @internal\n */\n@Component({\n selector: 'sky-popover-content',\n templateUrl: './popover-content.component.html',\n styleUrls: ['./popover-content.component.scss'],\n animations: [skyPopoverAnimation],\n providers: [SkyPopoverAdapterService],\n})\nexport class SkyPopoverContentComponent implements OnInit, OnDestroy {\n public get animationState(): SkyPopoverAnimationState {\n return this.isOpen ? 'open' : 'closed';\n }\n\n public get closed(): Observable<void> {\n return this._closed.asObservable();\n }\n\n public get opened(): Observable<void> {\n return this._opened.asObservable();\n }\n\n public get isMouseEnter(): Observable<boolean> {\n return this._isMouseEnter.asObservable();\n }\n\n public affixer: SkyAffixer;\n\n public arrowLeft: number;\n\n public arrowTop: number;\n\n public dismissOnBlur = true;\n\n public enableAnimations = true;\n\n public horizontalAlignment: SkyPopoverAlignment;\n\n public isOpen = false;\n\n public placement: SkyPopoverPlacement;\n\n public popoverTitle: string;\n\n public popoverType: 'danger' | 'info' = 'info';\n\n public themeName: string;\n\n @ViewChild('arrowRef', {\n read: ElementRef,\n static: true,\n })\n private arrowRef: ElementRef;\n\n @ViewChild('popoverRef', {\n read: ElementRef,\n static: true,\n })\n private popoverRef: ElementRef;\n\n @ViewChild('contentTarget', {\n read: ViewContainerRef,\n static: true,\n })\n private contentTarget: ViewContainerRef;\n\n private caller: ElementRef;\n\n private ngUnsubscribe = new Subject<void>();\n\n private _closed = new Subject<void>();\n\n private _isMouseEnter = new Subject<boolean>();\n\n private _opened = new Subject<void>();\n\n constructor(\n private changeDetector: ChangeDetectorRef,\n private elementRef: ElementRef,\n private affixService: SkyAffixService,\n private coreAdapterService: SkyCoreAdapterService,\n private adapterService: SkyPopoverAdapterService,\n @Optional() private context?: SkyPopoverContext,\n @Optional() private themeSvc?: SkyThemeService\n ) {}\n\n public ngOnInit(): void {\n /*istanbul ignore next*/\n this.contentTarget.createEmbeddedView(this.context?.contentTemplateRef);\n this.addEventListeners();\n\n /*istanbul ignore else*/\n if (this.themeSvc) {\n this.themeSvc.settingsChange\n .pipe(takeUntil(this.ngUnsubscribe))\n .subscribe((themeSettings) => {\n /*istanbul ignore next*/\n this.themeName = themeSettings.currentSettings?.theme?.name;\n });\n }\n }\n\n public ngOnDestroy(): void {\n this.ngUnsubscribe.next();\n this.ngUnsubscribe.complete();\n\n this._closed.complete();\n this._isMouseEnter.complete();\n this._opened.complete();\n\n /* istanbul ignore else */\n if (this.affixer) {\n this.affixer.destroy();\n }\n\n this._closed =\n this._isMouseEnter =\n this._opened =\n this.affixer =\n this.ngUnsubscribe =\n undefined;\n }\n\n public onAnimationEvent(event: AnimationEvent): void {\n if (event.fromState === 'void') {\n return;\n }\n\n if (event.phaseName === 'done') {\n if (event.toState === 'open') {\n /*istanbul ignore next*/\n this._opened?.next();\n } else {\n /*istanbul ignore next*/\n this._closed?.next();\n }\n }\n }\n\n public open(\n caller: ElementRef,\n config: {\n dismissOnBlur: boolean;\n enableAnimations: boolean;\n horizontalAlignment: SkyPopoverAlignment;\n isStatic: boolean;\n placement: SkyPopoverPlacement;\n popoverTitle: string;\n popoverType?: 'danger' | 'info';\n }\n ): void {\n this.caller = caller;\n this.dismissOnBlur = config.dismissOnBlur;\n this.enableAnimations = config.enableAnimations;\n this.horizontalAlignment = config.horizontalAlignment;\n this.placement = config.placement;\n this.popoverTitle = config.popoverTitle;\n if (config.popoverType) {\n this.popoverType = config.popoverType;\n }\n\n this.changeDetector.markForCheck();\n\n // Indicates if the popover should be displayed statically.\n // Please note: This feature is internal-only and used by the visual tests to capture multiple\n // states simultaneously without the overhead of event listeners.\n /* istanbul ignore if */\n if (config.isStatic) {\n this.isOpen = true;\n this.changeDetector.markForCheck();\n return;\n }\n\n // Let the styles render before gauging the affix dimensions.\n setTimeout(() => {\n /*istanbul ignore next*/\n if (\n !this.popoverRef?.nativeElement ||\n !this.ngUnsubscribe ||\n this.ngUnsubscribe.isStopped\n ) {\n return;\n }\n\n if (!this.affixer) {\n this.setupAffixer();\n }\n\n const affixOptions: SkyAffixConfig = {\n autoFitContext: SkyAffixAutoFitContext.Viewport,\n enableAutoFit: true,\n horizontalAlignment: parseAffixHorizontalAlignment(\n this.horizontalAlignment\n ),\n isSticky: true,\n placement: parseAffixPlacement(this.placement),\n };\n\n // Ensure that we are positioning the vertical alginment correctly. These\n // are the default alignments for all popovers but ensure that we are future proof here.\n if (\n affixOptions.placement === 'left' ||\n affixOptions.placement === 'right'\n ) {\n affixOptions.verticalAlignment = 'middle';\n } else if (affixOptions.placement === 'above') {\n affixOptions.verticalAlignment = 'bottom';\n } else {\n affixOptions.verticalAlignment = 'top';\n }\n\n this.affixer.affixTo(this.caller.nativeElement, affixOptions);\n\n this.updateArrowOffset();\n\n this.isOpen = true;\n this.changeDetector.markForCheck();\n });\n }\n\n public close(): void {\n this.isOpen = false;\n this.changeDetector.markForCheck();\n }\n\n public applyFocus(): void {\n if (this.isOpen) {\n this.coreAdapterService.getFocusableChildrenAndApplyFocus(\n this.popoverRef,\n '.sky-popover',\n true\n );\n }\n }\n\n private setupAffixer(): void {\n const affixer = this.affixService.createAffixer(this.popoverRef);\n\n affixer.offsetChange.pipe(takeUntil(this.ngUnsubscribe)).subscribe(() => {\n this.updateArrowOffset();\n this.changeDetector.markForCheck();\n });\n\n affixer.overflowScroll.pipe(takeUntil(this.ngUnsubscribe)).subscribe(() => {\n this.updateArrowOffset();\n this.changeDetector.markForCheck();\n });\n\n affixer.placementChange\n .pipe(takeUntil(this.ngUnsubscribe))\n .subscribe((change) => {\n this.placement = change.placement;\n this.changeDetector.markForCheck();\n });\n\n this.affixer = affixer;\n }\n\n private updateArrowOffset(): void {\n const { top, left } = this.adapterService.getArrowCoordinates(\n {\n caller: this.caller,\n popover: this.popoverRef,\n popoverArrow: this.arrowRef,\n },\n this.placement,\n this.themeName\n );\n\n this.arrowTop = top;\n this.arrowLeft = left;\n }\n\n private isFocusLeavingElement(event: KeyboardEvent): boolean {\n const focusableItems = this.coreAdapterService.getFocusableChildren(\n this.elementRef.nativeElement\n );\n\n const isFirstItem = focusableItems[0] === event.target && event.shiftKey;\n\n const isLastItem =\n focusableItems[focusableItems.length - 1] === event.target &&\n !event.shiftKey;\n\n return focusableItems.length === 0 || isFirstItem || isLastItem;\n }\n\n private addEventListeners(): void {\n const hostElement = this.elementRef.nativeElement;\n\n observableFromEvent(hostElement, 'mouseenter')\n .pipe(takeUntil(this.ngUnsubscribe))\n .subscribe(() => this._isMouseEnter.next(true));\n\n observableFromEvent(hostElement, 'mouseleave')\n .pipe(takeUntil(this.ngUnsubscribe))\n .subscribe(() => this._isMouseEnter.next(false));\n\n observableFromEvent(hostElement, 'keydown')\n .pipe(takeUntil(this.ngUnsubscribe))\n .subscribe((event: KeyboardEvent) => {\n const key = event.key.toLowerCase();\n\n /* tslint:disable-next-line:switch-default */\n switch (key) {\n case 'escape':\n this.close();\n this.caller.nativeElement.focus();\n event.preventDefault();\n event.stopPropagation();\n break;\n\n // Since the popover now lives in an overlay at the bottom of the document body, we need\n // to handle the tab key ourselves. Otherwise, focus would be moved to the browser's\n // search bar.\n case 'tab':\n if (!this.dismissOnBlur) {\n return;\n }\n\n /*istanbul ignore else*/\n if (this.isFocusLeavingElement(event)) {\n this.close();\n this.caller.nativeElement.focus();\n event.preventDefault();\n event.stopPropagation();\n }\n break;\n }\n });\n }\n}\n","<div\n class=\"sky-popover-container sky-popover-max-height\"\n [@.disabled]=\"!enableAnimations\"\n [@skyPopoverAnimation]=\"animationState\"\n [class.sky-popover-hidden]=\"!placement\"\n [ngClass]=\"[\n 'sky-popover-alignment-' + horizontalAlignment,\n 'sky-popover-placement-' + placement,\n 'sky-popover-' + popoverType\n ]\"\n (@skyPopoverAnimation.done)=\"onAnimationEvent($event)\"\n (@skyPopoverAnimation.start)=\"onAnimationEvent($event)\"\n #popoverRef\n>\n <div\n class=\"sky-popover\"\n tabindex=\"-1\"\n [skyThemeClass]=\"{\n 'sky-rounded-corners sky-shadow': 'default',\n 'sky-elevation-4': 'modern'\n }\"\n >\n <header\n *ngIf=\"popoverTitle\"\n class=\"sky-popover-header\"\n [skyThemeClass]=\"{\n 'sky-padding-even-default': 'default',\n 'sky-padding-even-lg sky-margin-stacked-lg': 'modern'\n }\"\n >\n <h1\n *ngIf=\"popoverTitle\"\n class=\"sky-popover-title\"\n [skyThemeClass]=\"{\n 'sky-emphasized': 'default',\n 'sky-font-emphasized': 'modern'\n }\"\n >\n {{ popoverTitle }}\n </h1>\n </header>\n <div\n class=\"sky-popover-body\"\n [skyThemeClass]=\"{\n 'sky-padding-even-default': 'default',\n 'sky-padding-even-lg': 'modern'\n }\"\n >\n <ng-container #contentTarget></ng-container>\n </div>\n <span\n aria-hidden=\"true\"\n class=\"sky-popover-arrow\"\n [style.left.px]=\"arrowLeft\"\n [style.top.px]=\"arrowTop\"\n #arrowRef\n ></span>\n </div>\n</div>\n"]}
@@ -1,10 +0,0 @@
1
- /**
2
- * @dynamic
3
- * @internal
4
- */
5
- export class SkyPopoverContext {
6
- constructor(args) {
7
- this.contentTemplateRef = args.contentTemplateRef;
8
- }
9
- }
10
- //# sourceMappingURL=popover-context.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"popover-context.js","sourceRoot":"","sources":["../../../../../../../../libs/components/popovers/src/lib/modules/popover/popover-context.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,MAAM,OAAO,iBAAiB;IAG5B,YAAY,IAA8C;QACxD,IAAI,CAAC,kBAAkB,GAAG,IAAI,CAAC,kBAAkB,CAAC;IACpD,CAAC;CACF","sourcesContent":["import { TemplateRef } from '@angular/core';\n\n/**\n * @dynamic\n * @internal\n */\nexport class SkyPopoverContext {\n public readonly contentTemplateRef: TemplateRef<any>;\n\n constructor(args: { contentTemplateRef: TemplateRef<any> }) {\n this.contentTemplateRef = args.contentTemplateRef;\n }\n}\n"]}
@@ -1,29 +0,0 @@
1
- export function parseAffixPlacement(placement) {
2
- switch (placement) {
3
- case 'above':
4
- return 'above';
5
- case 'below':
6
- return 'below';
7
- case 'right':
8
- return 'right';
9
- case 'left':
10
- return 'left';
11
- /* istanbul ignore next */
12
- default:
13
- throw `SkyAffixPlacement does not have a matching value for '${placement}'!`;
14
- }
15
- }
16
- export function parseAffixHorizontalAlignment(alignment) {
17
- switch (alignment) {
18
- case 'center':
19
- return 'center';
20
- case 'left':
21
- return 'left';
22
- case 'right':
23
- return 'right';
24
- /* istanbul ignore next */
25
- default:
26
- throw `SkyAffixHorizontalAlignment does not have a matching value for '${alignment}'!`;
27
- }
28
- }
29
- //# sourceMappingURL=popover-extensions.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"popover-extensions.js","sourceRoot":"","sources":["../../../../../../../../libs/components/popovers/src/lib/modules/popover/popover-extensions.ts"],"names":[],"mappings":"AAKA,MAAM,UAAU,mBAAmB,CACjC,SAA8B;IAE9B,QAAQ,SAAS,EAAE;QACjB,KAAK,OAAO;YACV,OAAO,OAAO,CAAC;QACjB,KAAK,OAAO;YACV,OAAO,OAAO,CAAC;QACjB,KAAK,OAAO;YACV,OAAO,OAAO,CAAC;QACjB,KAAK,MAAM;YACT,OAAO,MAAM,CAAC;QAChB,0BAA0B;QAC1B;YACE,MAAM,yDAAyD,SAAS,IAAI,CAAC;KAChF;AACH,CAAC;AAED,MAAM,UAAU,6BAA6B,CAC3C,SAA8B;IAE9B,QAAQ,SAAS,EAAE;QACjB,KAAK,QAAQ;YACX,OAAO,QAAQ,CAAC;QAClB,KAAK,MAAM;YACT,OAAO,MAAM,CAAC;QAChB,KAAK,OAAO;YACV,OAAO,OAAO,CAAC;QACjB,0BAA0B;QAC1B;YACE,MAAM,mEAAmE,SAAS,IAAI,CAAC;KAC1F;AACH,CAAC","sourcesContent":["import { SkyAffixHorizontalAlignment, SkyAffixPlacement } from '@skyux/core';\n\nimport { SkyPopoverAlignment } from './types/popover-alignment';\nimport { SkyPopoverPlacement } from './types/popover-placement';\n\nexport function parseAffixPlacement(\n placement: SkyPopoverPlacement\n): SkyAffixPlacement {\n switch (placement) {\n case 'above':\n return 'above';\n case 'below':\n return 'below';\n case 'right':\n return 'right';\n case 'left':\n return 'left';\n /* istanbul ignore next */\n default:\n throw `SkyAffixPlacement does not have a matching value for '${placement}'!`;\n }\n}\n\nexport function parseAffixHorizontalAlignment(\n alignment: SkyPopoverAlignment\n): SkyAffixHorizontalAlignment {\n switch (alignment) {\n case 'center':\n return 'center';\n case 'left':\n return 'left';\n case 'right':\n return 'right';\n /* istanbul ignore next */\n default:\n throw `SkyAffixHorizontalAlignment does not have a matching value for '${alignment}'!`;\n }\n}\n"]}