@skyux/popovers 5.0.0-beta.0 → 5.0.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 (167) hide show
  1. package/LICENSE +21 -0
  2. package/bundles/skyux-popovers-testing.umd.js +647 -518
  3. package/bundles/skyux-popovers.umd.js +476 -640
  4. package/documentation.json +4192 -0
  5. package/esm2015/modules/dropdown/dropdown-button.component.js +13 -11
  6. package/esm2015/modules/dropdown/dropdown-extensions.js +1 -1
  7. package/esm2015/modules/dropdown/dropdown-item.component.js +22 -25
  8. package/esm2015/modules/dropdown/dropdown-menu.component.js +39 -45
  9. package/esm2015/modules/dropdown/dropdown.component.js +65 -74
  10. package/esm2015/modules/dropdown/dropdown.module.js +46 -25
  11. package/esm2015/modules/dropdown/types/dropdown-horizontal-alignment.js +2 -1
  12. package/esm2015/modules/dropdown/types/dropdown-menu-change.js +2 -1
  13. package/esm2015/modules/dropdown/types/dropdown-message-type.js +1 -1
  14. package/esm2015/modules/dropdown/types/dropdown-message.js +2 -1
  15. package/esm2015/modules/dropdown/types/dropdown-trigger-type.js +2 -1
  16. package/esm2015/modules/popover/popover-adapter.service.js +11 -10
  17. package/esm2015/modules/popover/popover-animation-state.js +2 -1
  18. package/esm2015/modules/popover/popover-animation.js +8 -14
  19. package/esm2015/modules/popover/popover-content.component.js +73 -64
  20. package/esm2015/modules/popover/popover-context.js +1 -1
  21. package/esm2015/modules/popover/popover-extensions.js +1 -1
  22. package/esm2015/modules/popover/popover.component.js +60 -61
  23. package/esm2015/modules/popover/popover.directive.js +28 -31
  24. package/esm2015/modules/popover/popover.module.js +43 -28
  25. package/esm2015/modules/popover/types/popover-adapter-arrow-coordinates.js +2 -1
  26. package/esm2015/modules/popover/types/popover-adapter-elements.js +2 -1
  27. package/esm2015/modules/popover/types/popover-alignment.js +2 -1
  28. package/esm2015/modules/popover/types/popover-message-type.js +1 -1
  29. package/esm2015/modules/popover/types/popover-message.js +2 -1
  30. package/esm2015/modules/popover/types/popover-placement.js +2 -1
  31. package/esm2015/modules/popover/types/popover-position.js +2 -1
  32. package/esm2015/modules/popover/types/popover-trigger.js +2 -1
  33. package/esm2015/modules/shared/sky-popovers-resources.module.js +47 -0
  34. package/esm2015/public-api.js +23 -0
  35. package/esm2015/skyux-popovers.js +2 -15
  36. package/esm2015/testing/dropdown/dropdown-fixture.js +4 -4
  37. package/esm2015/testing/dropdown/dropdown-testing.module.js +13 -12
  38. package/esm2015/testing/dropdown/popovers-fixture-dropdown-item.js +2 -1
  39. package/esm2015/testing/dropdown/popovers-fixture-dropdown-menu.js +2 -1
  40. package/esm2015/testing/dropdown/popovers-fixture-dropdown.js +2 -1
  41. package/esm2015/testing/popover/popover-fixture.js +4 -8
  42. package/esm2015/testing/popover/popover-testing.module.js +25 -18
  43. package/esm2015/testing/public-api.js +8 -0
  44. package/esm2015/testing/skyux-popovers-testing.js +2 -2
  45. package/fesm2015/skyux-popovers-testing.js +42 -35
  46. package/fesm2015/skyux-popovers-testing.js.map +1 -1
  47. package/fesm2015/skyux-popovers.js +428 -397
  48. package/fesm2015/skyux-popovers.js.map +1 -1
  49. package/modules/dropdown/dropdown-button.component.d.ts +3 -0
  50. package/modules/dropdown/dropdown-item.component.d.ts +3 -0
  51. package/modules/dropdown/dropdown-menu.component.d.ts +3 -0
  52. package/modules/dropdown/dropdown.component.d.ts +4 -0
  53. package/modules/dropdown/dropdown.module.d.ts +13 -0
  54. package/modules/popover/popover-adapter.service.d.ts +3 -0
  55. package/modules/popover/popover-content.component.d.ts +5 -0
  56. package/modules/popover/popover.component.d.ts +8 -0
  57. package/modules/popover/popover.directive.d.ts +3 -0
  58. package/modules/popover/popover.module.d.ts +12 -0
  59. package/modules/shared/sky-popovers-resources.module.d.ts +14 -0
  60. package/package.json +12 -26
  61. package/{public_api.d.ts → public-api.d.ts} +7 -0
  62. package/skyux-popovers.d.ts +2 -14
  63. package/testing/dropdown/dropdown-testing.module.d.ts +5 -0
  64. package/testing/package.json +2 -5
  65. package/testing/popover/popover-testing.module.d.ts +7 -0
  66. package/testing/{public_api.d.ts → public-api.d.ts} +0 -0
  67. package/testing/skyux-popovers-testing.d.ts +2 -1
  68. package/CHANGELOG.md +0 -176
  69. package/bundles/skyux-popovers-testing.umd.js.map +0 -1
  70. package/bundles/skyux-popovers-testing.umd.min.js +0 -16
  71. package/bundles/skyux-popovers-testing.umd.min.js.map +0 -1
  72. package/bundles/skyux-popovers.umd.js.map +0 -1
  73. package/bundles/skyux-popovers.umd.min.js +0 -16
  74. package/bundles/skyux-popovers.umd.min.js.map +0 -1
  75. package/esm2015/modules/shared/popovers-for-root-compat.module.js +0 -18
  76. package/esm2015/modules/shared/popovers-resources.module.js +0 -20
  77. package/esm2015/plugin-resources/popovers-resources-provider.js +0 -16
  78. package/esm2015/public_api.js +0 -5
  79. package/esm2015/testing/public_api.js +0 -5
  80. package/esm5/modules/dropdown/dropdown-button.component.js +0 -15
  81. package/esm5/modules/dropdown/dropdown-extensions.js +0 -14
  82. package/esm5/modules/dropdown/dropdown-item.component.js +0 -84
  83. package/esm5/modules/dropdown/dropdown-menu.component.js +0 -332
  84. package/esm5/modules/dropdown/dropdown.component.js +0 -404
  85. package/esm5/modules/dropdown/dropdown.module.js +0 -42
  86. package/esm5/modules/dropdown/types/dropdown-horizontal-alignment.js +0 -1
  87. package/esm5/modules/dropdown/types/dropdown-menu-change.js +0 -1
  88. package/esm5/modules/dropdown/types/dropdown-message-type.js +0 -37
  89. package/esm5/modules/dropdown/types/dropdown-message.js +0 -1
  90. package/esm5/modules/dropdown/types/dropdown-trigger-type.js +0 -1
  91. package/esm5/modules/popover/popover-adapter.service.js +0 -76
  92. package/esm5/modules/popover/popover-animation-state.js +0 -1
  93. package/esm5/modules/popover/popover-animation.js +0 -25
  94. package/esm5/modules/popover/popover-content.component.js +0 -278
  95. package/esm5/modules/popover/popover-context.js +0 -12
  96. package/esm5/modules/popover/popover-extensions.js +0 -29
  97. package/esm5/modules/popover/popover.component.js +0 -215
  98. package/esm5/modules/popover/popover.directive.js +0 -184
  99. package/esm5/modules/popover/popover.module.js +0 -44
  100. package/esm5/modules/popover/types/popover-adapter-arrow-coordinates.js +0 -1
  101. package/esm5/modules/popover/types/popover-adapter-elements.js +0 -1
  102. package/esm5/modules/popover/types/popover-alignment.js +0 -1
  103. package/esm5/modules/popover/types/popover-message-type.js +0 -24
  104. package/esm5/modules/popover/types/popover-message.js +0 -1
  105. package/esm5/modules/popover/types/popover-placement.js +0 -1
  106. package/esm5/modules/popover/types/popover-position.js +0 -1
  107. package/esm5/modules/popover/types/popover-trigger.js +0 -1
  108. package/esm5/modules/shared/popovers-for-root-compat.module.js +0 -21
  109. package/esm5/modules/shared/popovers-resources.module.js +0 -23
  110. package/esm5/plugin-resources/popovers-resources-provider.js +0 -17
  111. package/esm5/public_api.js +0 -5
  112. package/esm5/skyux-popovers.js +0 -18
  113. package/esm5/testing/dropdown/dropdown-fixture.js +0 -165
  114. package/esm5/testing/dropdown/dropdown-testing.module.js +0 -17
  115. package/esm5/testing/dropdown/popovers-fixture-dropdown-item.js +0 -1
  116. package/esm5/testing/dropdown/popovers-fixture-dropdown-menu.js +0 -1
  117. package/esm5/testing/dropdown/popovers-fixture-dropdown.js +0 -1
  118. package/esm5/testing/popover/popover-fixture.js +0 -128
  119. package/esm5/testing/popover/popover-testing.module.js +0 -25
  120. package/esm5/testing/public_api.js +0 -5
  121. package/esm5/testing/skyux-popovers-testing.js +0 -5
  122. package/fesm5/skyux-popovers-testing.js +0 -333
  123. package/fesm5/skyux-popovers-testing.js.map +0 -1
  124. package/fesm5/skyux-popovers.js +0 -1803
  125. package/fesm5/skyux-popovers.js.map +0 -1
  126. package/modules/shared/popovers-for-root-compat.module.d.ts +0 -6
  127. package/modules/shared/popovers-resources.module.d.ts +0 -2
  128. package/plugin-resources/popovers-resources-provider.d.ts +0 -5
  129. package/skyux-popovers.metadata.json +0 -1
  130. package/src/assets/img/guidelines/dropdown/anatomy.png +0 -0
  131. package/src/assets/img/guidelines/dropdown/dropdown-content-1.png +0 -0
  132. package/src/assets/img/guidelines/dropdown/dropdown-content-2.png +0 -0
  133. package/src/assets/img/guidelines/dropdown/dropdown-content-3.png +0 -0
  134. package/src/assets/img/guidelines/dropdown/layout.png +0 -0
  135. package/src/assets/img/guidelines/dropdown/more-button.png +0 -0
  136. package/src/assets/img/guidelines/dropdown/option-type-context.png +0 -0
  137. package/src/assets/img/guidelines/dropdown/option-type-default.png +0 -0
  138. package/src/assets/img/guidelines/dropdown/option-type-icon.png +0 -0
  139. package/src/assets/img/guidelines/dropdown/usage-context-menu.png +0 -0
  140. package/src/assets/img/guidelines/dropdown/usage-dont-input.png +0 -0
  141. package/src/assets/img/guidelines/dropdown/usage-icon.png +0 -0
  142. package/src/assets/img/guidelines/dropdown/usage-toolbar.png +0 -0
  143. package/src/assets/img/guidelines/popover/anatomy.png +0 -0
  144. package/src/assets/img/guidelines/popover/behavior-responsive.png +0 -0
  145. package/src/assets/img/guidelines/popover/content-dont-overload.png +0 -0
  146. package/src/assets/img/guidelines/popover/content-html.png +0 -0
  147. package/src/assets/img/guidelines/popover/content-simple.png +0 -0
  148. package/src/assets/img/guidelines/popover/layout-alternate.png +0 -0
  149. package/src/assets/img/guidelines/popover/layout-default.png +0 -0
  150. package/src/assets/img/guidelines/popover/option-position.png +0 -0
  151. package/src/assets/img/guidelines/popover/popover-auto.mp4 +0 -0
  152. package/src/assets/img/guidelines/popover/popover-click.mp4 +0 -0
  153. package/src/assets/img/guidelines/popover/popover-usage-1.png +0 -0
  154. package/src/assets/img/guidelines/popover/popover-usage-2.png +0 -0
  155. package/src/assets/img/guidelines/popover/popover-usage-3.png +0 -0
  156. package/src/assets/img/guidelines/popover/popover-usage-4.png +0 -0
  157. package/src/assets/img/guidelines/popover/popover-usage-5.png +0 -0
  158. package/src/assets/img/guidelines/wording/add-alert-button.png +0 -0
  159. package/src/assets/img/guidelines/wording/add-button.png +0 -0
  160. package/src/assets/img/guidelines/wording/context-menu.png +0 -0
  161. package/src/assets/img/guidelines/wording/dropdown-single-action.png +0 -0
  162. package/src/assets/img/guidelines/wording/form-field-label.png +0 -0
  163. package/src/assets/img/guidelines/wording/modal-with-object.png +0 -0
  164. package/src/assets/img/guidelines/wording/modal-without-object.png +0 -0
  165. package/src/assets/img/guidelines/wording/more-button.png +0 -0
  166. package/src/assets/locales/resources_en_US.json +0 -6
  167. package/testing/skyux-popovers-testing.metadata.json +0 -1
@@ -1,553 +1,682 @@
1
1
  (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@skyux/popovers'), require('@angular/platform-browser'), require('@skyux-sdk/testing'), require('@angular/platform-browser/animations'), require('@skyux/theme')) :
3
- typeof define === 'function' && define.amd ? define('@skyux/popovers/testing', ['exports', '@angular/core', '@skyux/popovers', '@angular/platform-browser', '@skyux-sdk/testing', '@angular/platform-browser/animations', '@skyux/theme'], factory) :
4
- (global = global || self, factory((global.skyux = global.skyux || {}, global.skyux.popovers = global.skyux.popovers || {}, global.skyux.popovers.testing = {}), global.ng.core, global.skyux.popovers, global.ng.platformBrowser, global.testing, global.ng.platformBrowser.animations, global.theme));
5
- }(this, (function (exports, core, popovers, platformBrowser, testing, animations, theme) { 'use strict';
2
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@skyux/popovers'), require('@angular/platform-browser'), require('@skyux-sdk/testing'), require('@angular/platform-browser/animations'), require('@skyux/theme')) :
3
+ typeof define === 'function' && define.amd ? define('@skyux/popovers/testing', ['exports', '@angular/core', '@skyux/popovers', '@angular/platform-browser', '@skyux-sdk/testing', '@angular/platform-browser/animations', '@skyux/theme'], factory) :
4
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.skyux = global.skyux || {}, global.skyux.popovers = global.skyux.popovers || {}, global.skyux.popovers.testing = {}), global.ng.core, global.skyux.popovers, global.ng.platformBrowser, global.testing, global.ng.platformBrowser.animations, global.theme));
5
+ })(this, (function (exports, i0, popovers, platformBrowser, testing, animations, theme) { 'use strict';
6
6
 
7
- /*! *****************************************************************************
8
- Copyright (c) Microsoft Corporation.
9
-
10
- Permission to use, copy, modify, and/or distribute this software for any
11
- purpose with or without fee is hereby granted.
12
-
13
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
14
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
15
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
16
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
17
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
18
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
19
- PERFORMANCE OF THIS SOFTWARE.
20
- ***************************************************************************** */
21
- /* global Reflect, Promise */
22
-
23
- var extendStatics = function(d, b) {
24
- extendStatics = Object.setPrototypeOf ||
25
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
26
- function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
27
- return extendStatics(d, b);
28
- };
29
-
30
- function __extends(d, b) {
31
- extendStatics(d, b);
32
- function __() { this.constructor = d; }
33
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
34
- }
35
-
36
- var __assign = function() {
37
- __assign = Object.assign || function __assign(t) {
38
- for (var s, i = 1, n = arguments.length; i < n; i++) {
39
- s = arguments[i];
40
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
41
- }
42
- return t;
43
- };
44
- return __assign.apply(this, arguments);
45
- };
46
-
47
- function __rest(s, e) {
48
- var t = {};
49
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
50
- t[p] = s[p];
51
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
52
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
53
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
54
- t[p[i]] = s[p[i]];
55
- }
56
- return t;
57
- }
58
-
59
- function __decorate(decorators, target, key, desc) {
60
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
61
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
62
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
63
- return c > 3 && r && Object.defineProperty(target, key, r), r;
64
- }
65
-
66
- function __param(paramIndex, decorator) {
67
- return function (target, key) { decorator(target, key, paramIndex); }
68
- }
69
-
70
- function __metadata(metadataKey, metadataValue) {
71
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue);
72
- }
73
-
74
- function __awaiter(thisArg, _arguments, P, generator) {
75
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
76
- return new (P || (P = Promise))(function (resolve, reject) {
77
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
78
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
79
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
80
- step((generator = generator.apply(thisArg, _arguments || [])).next());
81
- });
82
- }
83
-
84
- function __generator(thisArg, body) {
85
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
86
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
87
- function verb(n) { return function (v) { return step([n, v]); }; }
88
- function step(op) {
89
- if (f) throw new TypeError("Generator is already executing.");
90
- while (_) try {
91
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
92
- if (y = 0, t) op = [op[0] & 2, t.value];
93
- switch (op[0]) {
94
- case 0: case 1: t = op; break;
95
- case 4: _.label++; return { value: op[1], done: false };
96
- case 5: _.label++; y = op[1]; op = [0]; continue;
97
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
98
- default:
99
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
100
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
101
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
102
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
103
- if (t[2]) _.ops.pop();
104
- _.trys.pop(); continue;
105
- }
106
- op = body.call(thisArg, _);
107
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
108
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
109
- }
110
- }
111
-
112
- function __createBinding(o, m, k, k2) {
113
- if (k2 === undefined) k2 = k;
114
- o[k2] = m[k];
115
- }
116
-
117
- function __exportStar(m, exports) {
118
- for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) exports[p] = m[p];
119
- }
120
-
121
- function __values(o) {
122
- var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
123
- if (m) return m.call(o);
124
- if (o && typeof o.length === "number") return {
125
- next: function () {
126
- if (o && i >= o.length) o = void 0;
127
- return { value: o && o[i++], done: !o };
128
- }
129
- };
130
- throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
131
- }
132
-
133
- function __read(o, n) {
134
- var m = typeof Symbol === "function" && o[Symbol.iterator];
135
- if (!m) return o;
136
- var i = m.call(o), r, ar = [], e;
137
- try {
138
- while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
139
- }
140
- catch (error) { e = { error: error }; }
141
- finally {
142
- try {
143
- if (r && !r.done && (m = i["return"])) m.call(i);
144
- }
145
- finally { if (e) throw e.error; }
146
- }
147
- return ar;
148
- }
149
-
150
- function __spread() {
151
- for (var ar = [], i = 0; i < arguments.length; i++)
152
- ar = ar.concat(__read(arguments[i]));
153
- return ar;
154
- }
155
-
156
- function __spreadArrays() {
157
- for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
158
- for (var r = Array(s), k = 0, i = 0; i < il; i++)
159
- for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
160
- r[k] = a[j];
161
- return r;
162
- };
163
-
164
- function __await(v) {
165
- return this instanceof __await ? (this.v = v, this) : new __await(v);
166
- }
167
-
168
- function __asyncGenerator(thisArg, _arguments, generator) {
169
- if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
170
- var g = generator.apply(thisArg, _arguments || []), i, q = [];
171
- return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
172
- function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
173
- function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
174
- function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
175
- function fulfill(value) { resume("next", value); }
176
- function reject(value) { resume("throw", value); }
177
- function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
178
- }
179
-
180
- function __asyncDelegator(o) {
181
- var i, p;
182
- return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
183
- function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; }
184
- }
185
-
186
- function __asyncValues(o) {
187
- if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
188
- var m = o[Symbol.asyncIterator], i;
189
- return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
190
- function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
191
- function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
192
- }
193
-
194
- function __makeTemplateObject(cooked, raw) {
195
- if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
196
- return cooked;
197
- };
198
-
199
- function __importStar(mod) {
200
- if (mod && mod.__esModule) return mod;
201
- var result = {};
202
- if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
203
- result.default = mod;
204
- return result;
205
- }
206
-
207
- function __importDefault(mod) {
208
- return (mod && mod.__esModule) ? mod : { default: mod };
209
- }
210
-
211
- function __classPrivateFieldGet(receiver, privateMap) {
212
- if (!privateMap.has(receiver)) {
213
- throw new TypeError("attempted to get private field on non-instance");
214
- }
215
- return privateMap.get(receiver);
216
- }
217
-
218
- function __classPrivateFieldSet(receiver, privateMap, value) {
219
- if (!privateMap.has(receiver)) {
220
- throw new TypeError("attempted to set private field on non-instance");
221
- }
222
- privateMap.set(receiver, value);
223
- return value;
224
- }
225
-
226
- var SkyDropdownTestingModule = /** @class */ (function () {
227
- function SkyDropdownTestingModule() {
7
+ function _interopNamespace(e) {
8
+ if (e && e.__esModule) return e;
9
+ var n = Object.create(null);
10
+ if (e) {
11
+ Object.keys(e).forEach(function (k) {
12
+ if (k !== 'default') {
13
+ var d = Object.getOwnPropertyDescriptor(e, k);
14
+ Object.defineProperty(n, k, d.get ? d : {
15
+ enumerable: true,
16
+ get: function () { return e[k]; }
17
+ });
18
+ }
19
+ });
20
+ }
21
+ n["default"] = e;
22
+ return Object.freeze(n);
228
23
  }
229
- SkyDropdownTestingModule = __decorate([
230
- core.NgModule({
231
- exports: [
232
- popovers.SkyDropdownModule
233
- ]
234
- })
235
- ], SkyDropdownTestingModule);
236
- return SkyDropdownTestingModule;
237
- }());
238
24
 
239
- /**
240
- * Provides information for and interaction with a SKY UX dropdown component.
241
- * By using the fixture API, a test insulates itself against updates to the internals
242
- * of a component, such as changing its DOM structure.
243
- */
244
- var SkyDropdownFixture = /** @class */ (function () {
245
- function SkyDropdownFixture(fixture, skyTestId) {
246
- this.fixture = fixture;
247
- this.debugEl = testing.SkyAppTestUtility.getDebugElementByTestId(fixture, skyTestId, 'sky-dropdown');
25
+ var i0__namespace = /*#__PURE__*/_interopNamespace(i0);
26
+
27
+ var SkyDropdownTestingModule = /** @class */ (function () {
28
+ function SkyDropdownTestingModule() {
29
+ }
30
+ return SkyDropdownTestingModule;
31
+ }());
32
+ SkyDropdownTestingModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: SkyDropdownTestingModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule });
33
+ SkyDropdownTestingModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: SkyDropdownTestingModule, exports: [popovers.SkyDropdownModule] });
34
+ SkyDropdownTestingModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: SkyDropdownTestingModule, imports: [popovers.SkyDropdownModule] });
35
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: SkyDropdownTestingModule, decorators: [{
36
+ type: i0.NgModule,
37
+ args: [{
38
+ exports: [popovers.SkyDropdownModule],
39
+ }]
40
+ }] });
41
+
42
+ /*! *****************************************************************************
43
+ Copyright (c) Microsoft Corporation.
44
+
45
+ Permission to use, copy, modify, and/or distribute this software for any
46
+ purpose with or without fee is hereby granted.
47
+
48
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
49
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
50
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
51
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
52
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
53
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
54
+ PERFORMANCE OF THIS SOFTWARE.
55
+ ***************************************************************************** */
56
+ /* global Reflect, Promise */
57
+ var extendStatics = function (d, b) {
58
+ extendStatics = Object.setPrototypeOf ||
59
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
60
+ function (d, b) { for (var p in b)
61
+ if (Object.prototype.hasOwnProperty.call(b, p))
62
+ d[p] = b[p]; };
63
+ return extendStatics(d, b);
64
+ };
65
+ function __extends(d, b) {
66
+ if (typeof b !== "function" && b !== null)
67
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
68
+ extendStatics(d, b);
69
+ function __() { this.constructor = d; }
70
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
248
71
  }
249
- Object.defineProperty(SkyDropdownFixture.prototype, "dropdown", {
250
- /**
251
- * Returns information about the dropdown component.
252
- */
253
- get: function () {
254
- var button = this.buttonDebugElement;
255
- if (!button) {
256
- return;
72
+ var __assign = function () {
73
+ __assign = Object.assign || function __assign(t) {
74
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
75
+ s = arguments[i];
76
+ for (var p in s)
77
+ if (Object.prototype.hasOwnProperty.call(s, p))
78
+ t[p] = s[p];
257
79
  }
258
- return {
259
- buttonStyle: this.getButtonStyle(button.classes),
260
- buttonType: this.getButtonType(button.classes),
261
- disabled: button.nativeElement.disabled,
262
- label: button.nativeElement.getAttribute('aria-label'),
263
- title: button.nativeElement.getAttribute('title')
264
- };
265
- },
266
- enumerable: true,
267
- configurable: true
268
- });
269
- Object.defineProperty(SkyDropdownFixture.prototype, "dropdownButtonText", {
270
- /**
271
- * Returns the dropdown button's text.
272
- */
273
- get: function () {
274
- return testing.SkyAppTestUtility.getText(this.buttonDebugElement.nativeElement);
275
- },
276
- enumerable: true,
277
- configurable: true
278
- });
279
- Object.defineProperty(SkyDropdownFixture.prototype, "dropdownMenu", {
280
- /**
281
- * Returns information about the dropdown menu component.
282
- */
283
- get: function () {
284
- var menu = this.getDropdownMenuContent();
285
- if (!menu) {
286
- return;
80
+ return t;
81
+ };
82
+ return __assign.apply(this, arguments);
83
+ };
84
+ function __rest(s, e) {
85
+ var t = {};
86
+ for (var p in s)
87
+ if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
88
+ t[p] = s[p];
89
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
90
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
91
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
92
+ t[p[i]] = s[p[i]];
287
93
  }
288
- return {
289
- ariaLabelledBy: menu.getAttribute('aria-labelledby'),
290
- ariaRole: menu.getAttribute('role')
291
- };
292
- },
293
- enumerable: true,
294
- configurable: true
295
- });
296
- Object.defineProperty(SkyDropdownFixture.prototype, "dropdownMenuIsVisible", {
297
- /**
298
- * Indicates if the dropdown menu is open and visible.
299
- */
300
- get: function () {
301
- return this.getDropdownMenuContent() !== undefined;
302
- },
303
- enumerable: true,
304
- configurable: true
305
- });
306
- Object.defineProperty(SkyDropdownFixture.prototype, "buttonDebugElement", {
307
- get: function () {
308
- return this.debugEl.query(platformBrowser.By.css('.sky-dropdown-button'));
309
- },
310
- enumerable: true,
311
- configurable: true
312
- });
313
- /**
314
- * Click the dropdown button to open or close the dropdown menu.
315
- */
316
- SkyDropdownFixture.prototype.clickDropdownButton = function () {
317
- return __awaiter(this, void 0, void 0, function () {
318
- return __generator(this, function (_a) {
319
- this.buttonDebugElement.nativeElement.click();
320
- this.fixture.detectChanges();
321
- return [2 /*return*/, this.fixture.whenStable()];
322
- });
94
+ return t;
95
+ }
96
+ function __decorate(decorators, target, key, desc) {
97
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
98
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
99
+ r = Reflect.decorate(decorators, target, key, desc);
100
+ else
101
+ for (var i = decorators.length - 1; i >= 0; i--)
102
+ if (d = decorators[i])
103
+ r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
104
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
105
+ }
106
+ function __param(paramIndex, decorator) {
107
+ return function (target, key) { decorator(target, key, paramIndex); };
108
+ }
109
+ function __metadata(metadataKey, metadataValue) {
110
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
111
+ return Reflect.metadata(metadataKey, metadataValue);
112
+ }
113
+ function __awaiter(thisArg, _arguments, P, generator) {
114
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
115
+ return new (P || (P = Promise))(function (resolve, reject) {
116
+ function fulfilled(value) { try {
117
+ step(generator.next(value));
118
+ }
119
+ catch (e) {
120
+ reject(e);
121
+ } }
122
+ function rejected(value) { try {
123
+ step(generator["throw"](value));
124
+ }
125
+ catch (e) {
126
+ reject(e);
127
+ } }
128
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
129
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
323
130
  });
324
- };
325
- /**
326
- * Click the dropdown item at the provided index.
327
- */
328
- SkyDropdownFixture.prototype.clickDropdownItem = function (index) {
329
- return __awaiter(this, void 0, void 0, function () {
330
- var itemEls;
331
- return __generator(this, function (_a) {
332
- itemEls = this.getDropdownItemEls();
333
- if (index >= itemEls.length) {
334
- throw new Error("There is no dropdown item at index " + index + ".");
131
+ }
132
+ function __generator(thisArg, body) {
133
+ var _ = { label: 0, sent: function () { if (t[0] & 1)
134
+ throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
135
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function () { return this; }), g;
136
+ function verb(n) { return function (v) { return step([n, v]); }; }
137
+ function step(op) {
138
+ if (f)
139
+ throw new TypeError("Generator is already executing.");
140
+ while (_)
141
+ try {
142
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done)
143
+ return t;
144
+ if (y = 0, t)
145
+ op = [op[0] & 2, t.value];
146
+ switch (op[0]) {
147
+ case 0:
148
+ case 1:
149
+ t = op;
150
+ break;
151
+ case 4:
152
+ _.label++;
153
+ return { value: op[1], done: false };
154
+ case 5:
155
+ _.label++;
156
+ y = op[1];
157
+ op = [0];
158
+ continue;
159
+ case 7:
160
+ op = _.ops.pop();
161
+ _.trys.pop();
162
+ continue;
163
+ default:
164
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
165
+ _ = 0;
166
+ continue;
167
+ }
168
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) {
169
+ _.label = op[1];
170
+ break;
171
+ }
172
+ if (op[0] === 6 && _.label < t[1]) {
173
+ _.label = t[1];
174
+ t = op;
175
+ break;
176
+ }
177
+ if (t && _.label < t[2]) {
178
+ _.label = t[2];
179
+ _.ops.push(op);
180
+ break;
181
+ }
182
+ if (t[2])
183
+ _.ops.pop();
184
+ _.trys.pop();
185
+ continue;
186
+ }
187
+ op = body.call(thisArg, _);
335
188
  }
336
- itemEls[index].querySelector('button,a').click();
337
- this.fixture.detectChanges();
338
- return [2 /*return*/, this.fixture.whenStable()];
339
- });
340
- });
341
- };
342
- /**
343
- * Returns information about the dropdown item at the provided index.
344
- */
345
- SkyDropdownFixture.prototype.getDropdownItem = function (index) {
346
- var itemEls = this.getDropdownItemEls();
347
- if (index >= itemEls.length) {
348
- throw new Error("There is no dropdown item at index " + index + ".");
349
- }
350
- var item = itemEls[index];
351
- if (!item) {
352
- return;
353
- }
354
- return {
355
- ariaRole: item.getAttribute('role')
356
- };
357
- };
358
- /**
359
- * Returns the contents of the dropdown menu.
360
- */
361
- SkyDropdownFixture.prototype.getDropdownMenuContent = function () {
362
- var overlay = this.getOverlay();
363
- if (!overlay) {
364
- return;
189
+ catch (e) {
190
+ op = [6, e];
191
+ y = 0;
192
+ }
193
+ finally {
194
+ f = t = 0;
195
+ }
196
+ if (op[0] & 5)
197
+ throw op[1];
198
+ return { value: op[0] ? op[1] : void 0, done: true };
365
199
  }
366
- return overlay.querySelector('.sky-dropdown-menu');
367
- };
368
- SkyDropdownFixture.prototype.getDropdownItemEls = function () {
369
- var overlay = this.getOverlay();
370
- if (!overlay) {
371
- return;
200
+ }
201
+ var __createBinding = Object.create ? (function (o, m, k, k2) {
202
+ if (k2 === undefined)
203
+ k2 = k;
204
+ Object.defineProperty(o, k2, { enumerable: true, get: function () { return m[k]; } });
205
+ }) : (function (o, m, k, k2) {
206
+ if (k2 === undefined)
207
+ k2 = k;
208
+ o[k2] = m[k];
209
+ });
210
+ function __exportStar(m, o) {
211
+ for (var p in m)
212
+ if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p))
213
+ __createBinding(o, m, p);
214
+ }
215
+ function __values(o) {
216
+ var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
217
+ if (m)
218
+ return m.call(o);
219
+ if (o && typeof o.length === "number")
220
+ return {
221
+ next: function () {
222
+ if (o && i >= o.length)
223
+ o = void 0;
224
+ return { value: o && o[i++], done: !o };
225
+ }
226
+ };
227
+ throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
228
+ }
229
+ function __read(o, n) {
230
+ var m = typeof Symbol === "function" && o[Symbol.iterator];
231
+ if (!m)
232
+ return o;
233
+ var i = m.call(o), r, ar = [], e;
234
+ try {
235
+ while ((n === void 0 || n-- > 0) && !(r = i.next()).done)
236
+ ar.push(r.value);
372
237
  }
373
- return overlay.querySelectorAll('.sky-dropdown-item');
374
- };
375
- SkyDropdownFixture.prototype.getOverlay = function () {
376
- return document.querySelector('sky-overlay');
377
- };
378
- SkyDropdownFixture.prototype.getButtonStyle = function (classNames) {
379
- if (classNames['sky-btn-primary']) {
380
- return 'primary';
238
+ catch (error) {
239
+ e = { error: error };
381
240
  }
382
- if (classNames['sky-btn-default']) {
383
- return 'default';
241
+ finally {
242
+ try {
243
+ if (r && !r.done && (m = i["return"]))
244
+ m.call(i);
245
+ }
246
+ finally {
247
+ if (e)
248
+ throw e.error;
249
+ }
384
250
  }
385
- };
386
- SkyDropdownFixture.prototype.getButtonType = function (classNames) {
387
- var prefix = 'sky-dropdown-button-type-';
388
- for (var i in classNames) {
389
- if (classNames[i]) {
390
- if (i.indexOf(prefix) > -1) {
391
- return i.replace(prefix, '');
251
+ return ar;
252
+ }
253
+ /** @deprecated */
254
+ function __spread() {
255
+ for (var ar = [], i = 0; i < arguments.length; i++)
256
+ ar = ar.concat(__read(arguments[i]));
257
+ return ar;
258
+ }
259
+ /** @deprecated */
260
+ function __spreadArrays() {
261
+ for (var s = 0, i = 0, il = arguments.length; i < il; i++)
262
+ s += arguments[i].length;
263
+ for (var r = Array(s), k = 0, i = 0; i < il; i++)
264
+ for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
265
+ r[k] = a[j];
266
+ return r;
267
+ }
268
+ function __spreadArray(to, from, pack) {
269
+ if (pack || arguments.length === 2)
270
+ for (var i = 0, l = from.length, ar; i < l; i++) {
271
+ if (ar || !(i in from)) {
272
+ if (!ar)
273
+ ar = Array.prototype.slice.call(from, 0, i);
274
+ ar[i] = from[i];
392
275
  }
393
276
  }
277
+ return to.concat(ar || Array.prototype.slice.call(from));
278
+ }
279
+ function __await(v) {
280
+ return this instanceof __await ? (this.v = v, this) : new __await(v);
281
+ }
282
+ function __asyncGenerator(thisArg, _arguments, generator) {
283
+ if (!Symbol.asyncIterator)
284
+ throw new TypeError("Symbol.asyncIterator is not defined.");
285
+ var g = generator.apply(thisArg, _arguments || []), i, q = [];
286
+ return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
287
+ function verb(n) { if (g[n])
288
+ i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
289
+ function resume(n, v) { try {
290
+ step(g[n](v));
291
+ }
292
+ catch (e) {
293
+ settle(q[0][3], e);
294
+ } }
295
+ function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
296
+ function fulfill(value) { resume("next", value); }
297
+ function reject(value) { resume("throw", value); }
298
+ function settle(f, v) { if (f(v), q.shift(), q.length)
299
+ resume(q[0][0], q[0][1]); }
300
+ }
301
+ function __asyncDelegator(o) {
302
+ var i, p;
303
+ return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
304
+ function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; }
305
+ }
306
+ function __asyncValues(o) {
307
+ if (!Symbol.asyncIterator)
308
+ throw new TypeError("Symbol.asyncIterator is not defined.");
309
+ var m = o[Symbol.asyncIterator], i;
310
+ return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
311
+ function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
312
+ function settle(resolve, reject, d, v) { Promise.resolve(v).then(function (v) { resolve({ value: v, done: d }); }, reject); }
313
+ }
314
+ function __makeTemplateObject(cooked, raw) {
315
+ if (Object.defineProperty) {
316
+ Object.defineProperty(cooked, "raw", { value: raw });
394
317
  }
395
- return undefined;
318
+ else {
319
+ cooked.raw = raw;
320
+ }
321
+ return cooked;
322
+ }
323
+ ;
324
+ var __setModuleDefault = Object.create ? (function (o, v) {
325
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
326
+ }) : function (o, v) {
327
+ o["default"] = v;
396
328
  };
397
- return SkyDropdownFixture;
398
- }());
399
-
400
- var SkyPopoverTestingModule = /** @class */ (function () {
401
- function SkyPopoverTestingModule() {
329
+ function __importStar(mod) {
330
+ if (mod && mod.__esModule)
331
+ return mod;
332
+ var result = {};
333
+ if (mod != null)
334
+ for (var k in mod)
335
+ if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k))
336
+ __createBinding(result, mod, k);
337
+ __setModuleDefault(result, mod);
338
+ return result;
402
339
  }
403
- SkyPopoverTestingModule = __decorate([
404
- core.NgModule({
405
- exports: [
406
- popovers.SkyPopoverModule,
407
- // The noop animations module needs to be loaded last to avoid
408
- // subsequent modules adding animations and overriding this.
409
- animations.NoopAnimationsModule
410
- ],
411
- imports: [
412
- theme.SkyThemeModule
413
- ]
414
- })
415
- ], SkyPopoverTestingModule);
416
- return SkyPopoverTestingModule;
417
- }());
418
-
419
- /**
420
- * Provides information for and interaction with a SKY UX popover component.
421
- * By using the fixture API, a test insulates itself against updates to the internals
422
- * of a component, such as changing its DOM structure.
423
- */
424
- var SkyPopoverFixture = /** @class */ (function () {
425
- function SkyPopoverFixture(fixture) {
426
- this.fixture = fixture;
340
+ function __importDefault(mod) {
341
+ return (mod && mod.__esModule) ? mod : { default: mod };
427
342
  }
428
- Object.defineProperty(SkyPopoverFixture.prototype, "alignment", {
429
- /**
430
- * Returns the popover alignment if the popover is open, otherwise undefined.
431
- */
432
- get: function () {
433
- return this.getClassSuffixByClassPrefix(this.containerElement, 'sky-popover-alignment-');
434
- },
435
- enumerable: true,
436
- configurable: true
437
- });
438
- Object.defineProperty(SkyPopoverFixture.prototype, "body", {
343
+ function __classPrivateFieldGet(receiver, state, kind, f) {
344
+ if (kind === "a" && !f)
345
+ throw new TypeError("Private accessor was defined without a getter");
346
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
347
+ throw new TypeError("Cannot read private member from an object whose class did not declare it");
348
+ return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
349
+ }
350
+ function __classPrivateFieldSet(receiver, state, value, kind, f) {
351
+ if (kind === "m")
352
+ throw new TypeError("Private method is not writable");
353
+ if (kind === "a" && !f)
354
+ throw new TypeError("Private accessor was defined without a setter");
355
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
356
+ throw new TypeError("Cannot write private member to an object whose class did not declare it");
357
+ return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
358
+ }
359
+
360
+ /**
361
+ * Provides information for and interaction with a SKY UX dropdown component.
362
+ * By using the fixture API, a test insulates itself against updates to the internals
363
+ * of a component, such as changing its DOM structure.
364
+ */
365
+ var SkyDropdownFixture = /** @class */ (function () {
366
+ function SkyDropdownFixture(fixture, skyTestId) {
367
+ this.fixture = fixture;
368
+ this.debugEl = testing.SkyAppTestUtility.getDebugElementByTestId(fixture, skyTestId, 'sky-dropdown');
369
+ }
370
+ Object.defineProperty(SkyDropdownFixture.prototype, "dropdown", {
371
+ /**
372
+ * Returns information about the dropdown component.
373
+ */
374
+ get: function () {
375
+ var button = this.buttonDebugElement;
376
+ if (!button) {
377
+ return;
378
+ }
379
+ return {
380
+ buttonStyle: this.getButtonStyle(button.classes),
381
+ buttonType: this.getButtonType(button.classes),
382
+ disabled: button.nativeElement.disabled,
383
+ label: button.nativeElement.getAttribute('aria-label'),
384
+ title: button.nativeElement.getAttribute('title'),
385
+ };
386
+ },
387
+ enumerable: false,
388
+ configurable: true
389
+ });
390
+ Object.defineProperty(SkyDropdownFixture.prototype, "dropdownButtonText", {
391
+ /**
392
+ * Returns the dropdown button's text.
393
+ */
394
+ get: function () {
395
+ return testing.SkyAppTestUtility.getText(this.buttonDebugElement.nativeElement);
396
+ },
397
+ enumerable: false,
398
+ configurable: true
399
+ });
400
+ Object.defineProperty(SkyDropdownFixture.prototype, "dropdownMenu", {
401
+ /**
402
+ * Returns information about the dropdown menu component.
403
+ */
404
+ get: function () {
405
+ var menu = this.getDropdownMenuContent();
406
+ if (!menu) {
407
+ return;
408
+ }
409
+ return {
410
+ ariaLabelledBy: menu.getAttribute('aria-labelledby'),
411
+ ariaRole: menu.getAttribute('role'),
412
+ };
413
+ },
414
+ enumerable: false,
415
+ configurable: true
416
+ });
417
+ Object.defineProperty(SkyDropdownFixture.prototype, "dropdownMenuIsVisible", {
418
+ /**
419
+ * Indicates if the dropdown menu is open and visible.
420
+ */
421
+ get: function () {
422
+ return this.getDropdownMenuContent() !== undefined;
423
+ },
424
+ enumerable: false,
425
+ configurable: true
426
+ });
427
+ Object.defineProperty(SkyDropdownFixture.prototype, "buttonDebugElement", {
428
+ get: function () {
429
+ return this.debugEl.query(platformBrowser.By.css('.sky-dropdown-button'));
430
+ },
431
+ enumerable: false,
432
+ configurable: true
433
+ });
439
434
  /**
440
- * Returns the popover body element if the popover is open, otherwise undefined.
435
+ * Click the dropdown button to open or close the dropdown menu.
441
436
  */
442
- get: function () {
443
- return this.bodyElement;
444
- },
445
- enumerable: true,
446
- configurable: true
447
- });
448
- Object.defineProperty(SkyPopoverFixture.prototype, "placement", {
437
+ SkyDropdownFixture.prototype.clickDropdownButton = function () {
438
+ return __awaiter(this, void 0, void 0, function () {
439
+ return __generator(this, function (_a) {
440
+ this.buttonDebugElement.nativeElement.click();
441
+ this.fixture.detectChanges();
442
+ return [2 /*return*/, this.fixture.whenStable()];
443
+ });
444
+ });
445
+ };
449
446
  /**
450
- * Returns the popover position if the popover is open, otherwise undefined.
447
+ * Click the dropdown item at the provided index.
451
448
  */
452
- get: function () {
453
- return this.getClassSuffixByClassPrefix(this.containerElement, 'sky-popover-placement-');
454
- },
455
- enumerable: true,
456
- configurable: true
457
- });
458
- Object.defineProperty(SkyPopoverFixture.prototype, "popoverTitle", {
449
+ SkyDropdownFixture.prototype.clickDropdownItem = function (index) {
450
+ return __awaiter(this, void 0, void 0, function () {
451
+ var itemEls;
452
+ return __generator(this, function (_a) {
453
+ itemEls = this.getDropdownItemEls();
454
+ if (index >= itemEls.length) {
455
+ throw new Error("There is no dropdown item at index " + index + ".");
456
+ }
457
+ itemEls[index].querySelector('button,a').click();
458
+ this.fixture.detectChanges();
459
+ return [2 /*return*/, this.fixture.whenStable()];
460
+ });
461
+ });
462
+ };
459
463
  /**
460
- * Returns the popover title text if the popover is open, otherwise undefined.
464
+ * Returns information about the dropdown item at the provided index.
461
465
  */
462
- get: function () {
463
- return testing.SkyAppTestUtility.getText(this.titleElement);
464
- },
465
- enumerable: true,
466
- configurable: true
467
- });
468
- Object.defineProperty(SkyPopoverFixture.prototype, "popoverIsVisible", {
466
+ SkyDropdownFixture.prototype.getDropdownItem = function (index) {
467
+ var itemEls = this.getDropdownItemEls();
468
+ if (index >= itemEls.length) {
469
+ throw new Error("There is no dropdown item at index " + index + ".");
470
+ }
471
+ var item = itemEls[index];
472
+ if (!item) {
473
+ return;
474
+ }
475
+ return {
476
+ ariaRole: item.getAttribute('role'),
477
+ };
478
+ };
469
479
  /**
470
- * Indicates if the popover is open and visible.
480
+ * Returns the contents of the dropdown menu.
471
481
  */
472
- get: function () {
473
- return this.contentElement !== undefined;
474
- },
475
- enumerable: true,
476
- configurable: true
477
- });
482
+ SkyDropdownFixture.prototype.getDropdownMenuContent = function () {
483
+ var overlay = this.getOverlay();
484
+ if (!overlay) {
485
+ return;
486
+ }
487
+ return overlay.querySelector('.sky-dropdown-menu');
488
+ };
489
+ SkyDropdownFixture.prototype.getDropdownItemEls = function () {
490
+ var overlay = this.getOverlay();
491
+ if (!overlay) {
492
+ return;
493
+ }
494
+ return overlay.querySelectorAll('.sky-dropdown-item');
495
+ };
496
+ SkyDropdownFixture.prototype.getOverlay = function () {
497
+ return document.querySelector('sky-overlay');
498
+ };
499
+ SkyDropdownFixture.prototype.getButtonStyle = function (classNames) {
500
+ if (classNames['sky-btn-primary']) {
501
+ return 'primary';
502
+ }
503
+ if (classNames['sky-btn-default']) {
504
+ return 'default';
505
+ }
506
+ };
507
+ SkyDropdownFixture.prototype.getButtonType = function (classNames) {
508
+ var prefix = 'sky-dropdown-button-type-';
509
+ for (var i in classNames) {
510
+ if (classNames[i]) {
511
+ if (i.indexOf(prefix) > -1) {
512
+ return i.replace(prefix, '');
513
+ }
514
+ }
515
+ }
516
+ return undefined;
517
+ };
518
+ return SkyDropdownFixture;
519
+ }());
520
+
521
+ var SkyPopoverTestingModule = /** @class */ (function () {
522
+ function SkyPopoverTestingModule() {
523
+ }
524
+ return SkyPopoverTestingModule;
525
+ }());
526
+ SkyPopoverTestingModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: SkyPopoverTestingModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule });
527
+ SkyPopoverTestingModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: SkyPopoverTestingModule, imports: [theme.SkyThemeModule], exports: [popovers.SkyPopoverModule,
528
+ // The noop animations module needs to be loaded last to avoid
529
+ // subsequent modules adding animations and overriding this.
530
+ animations.NoopAnimationsModule] });
531
+ SkyPopoverTestingModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: SkyPopoverTestingModule, imports: [[theme.SkyThemeModule], popovers.SkyPopoverModule,
532
+ // The noop animations module needs to be loaded last to avoid
533
+ // subsequent modules adding animations and overriding this.
534
+ animations.NoopAnimationsModule] });
535
+ i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: SkyPopoverTestingModule, decorators: [{
536
+ type: i0.NgModule,
537
+ args: [{
538
+ exports: [
539
+ popovers.SkyPopoverModule,
540
+ // The noop animations module needs to be loaded last to avoid
541
+ // subsequent modules adding animations and overriding this.
542
+ animations.NoopAnimationsModule,
543
+ ],
544
+ imports: [theme.SkyThemeModule],
545
+ }]
546
+ }] });
547
+
478
548
  /**
479
- * Triggers the blur event for the popover.
549
+ * Provides information for and interaction with a SKY UX popover component.
550
+ * By using the fixture API, a test insulates itself against updates to the internals
551
+ * of a component, such as changing its DOM structure.
480
552
  */
481
- SkyPopoverFixture.prototype.blur = function () {
482
- // close the popover by changing focus to the body element
483
- testing.SkyAppTestUtility.fireDomEvent(window.document.body, 'click');
484
- this.fixture.detectChanges();
485
- return this.fixture.whenStable();
486
- };
487
- Object.defineProperty(SkyPopoverFixture.prototype, "contentElement", {
488
- //#region helpers
489
- get: function () {
490
- return this.queryOverlay('sky-popover-content');
491
- },
492
- enumerable: true,
493
- configurable: true
494
- });
495
- Object.defineProperty(SkyPopoverFixture.prototype, "containerElement", {
496
- get: function () {
497
- return this.queryOverlay('.sky-popover-container');
498
- },
499
- enumerable: true,
500
- configurable: true
501
- });
502
- Object.defineProperty(SkyPopoverFixture.prototype, "titleElement", {
503
- get: function () {
504
- return this.queryOverlay('.sky-popover-title');
505
- },
506
- enumerable: true,
507
- configurable: true
508
- });
509
- Object.defineProperty(SkyPopoverFixture.prototype, "bodyElement", {
510
- get: function () {
511
- return this.queryOverlay('.sky-popover-body');
512
- },
513
- enumerable: true,
514
- configurable: true
515
- });
516
- SkyPopoverFixture.prototype.getOverlay = function () {
517
- return document.querySelector('sky-overlay');
518
- };
519
- SkyPopoverFixture.prototype.queryOverlay = function (query) {
520
- var overlay = this.getOverlay();
521
- return !overlay
522
- ? undefined
523
- : overlay.querySelector(query);
524
- };
553
+ var SkyPopoverFixture = /** @class */ (function () {
554
+ function SkyPopoverFixture(fixture) {
555
+ this.fixture = fixture;
556
+ }
557
+ Object.defineProperty(SkyPopoverFixture.prototype, "alignment", {
558
+ /**
559
+ * Returns the popover alignment if the popover is open, otherwise undefined.
560
+ */
561
+ get: function () {
562
+ return this.getClassSuffixByClassPrefix(this.containerElement, 'sky-popover-alignment-');
563
+ },
564
+ enumerable: false,
565
+ configurable: true
566
+ });
567
+ Object.defineProperty(SkyPopoverFixture.prototype, "body", {
568
+ /**
569
+ * Returns the popover body element if the popover is open, otherwise undefined.
570
+ */
571
+ get: function () {
572
+ return this.bodyElement;
573
+ },
574
+ enumerable: false,
575
+ configurable: true
576
+ });
577
+ Object.defineProperty(SkyPopoverFixture.prototype, "placement", {
578
+ /**
579
+ * Returns the popover position if the popover is open, otherwise undefined.
580
+ */
581
+ get: function () {
582
+ return this.getClassSuffixByClassPrefix(this.containerElement, 'sky-popover-placement-');
583
+ },
584
+ enumerable: false,
585
+ configurable: true
586
+ });
587
+ Object.defineProperty(SkyPopoverFixture.prototype, "popoverTitle", {
588
+ /**
589
+ * Returns the popover title text if the popover is open, otherwise undefined.
590
+ */
591
+ get: function () {
592
+ return testing.SkyAppTestUtility.getText(this.titleElement);
593
+ },
594
+ enumerable: false,
595
+ configurable: true
596
+ });
597
+ Object.defineProperty(SkyPopoverFixture.prototype, "popoverIsVisible", {
598
+ /**
599
+ * Indicates if the popover is open and visible.
600
+ */
601
+ get: function () {
602
+ return this.contentElement !== undefined;
603
+ },
604
+ enumerable: false,
605
+ configurable: true
606
+ });
607
+ /**
608
+ * Triggers the blur event for the popover.
609
+ */
610
+ SkyPopoverFixture.prototype.blur = function () {
611
+ // close the popover by changing focus to the body element
612
+ testing.SkyAppTestUtility.fireDomEvent(window.document.body, 'click');
613
+ this.fixture.detectChanges();
614
+ return this.fixture.whenStable();
615
+ };
616
+ Object.defineProperty(SkyPopoverFixture.prototype, "contentElement", {
617
+ //#region helpers
618
+ get: function () {
619
+ return this.queryOverlay('sky-popover-content');
620
+ },
621
+ enumerable: false,
622
+ configurable: true
623
+ });
624
+ Object.defineProperty(SkyPopoverFixture.prototype, "containerElement", {
625
+ get: function () {
626
+ return this.queryOverlay('.sky-popover-container');
627
+ },
628
+ enumerable: false,
629
+ configurable: true
630
+ });
631
+ Object.defineProperty(SkyPopoverFixture.prototype, "titleElement", {
632
+ get: function () {
633
+ return this.queryOverlay('.sky-popover-title');
634
+ },
635
+ enumerable: false,
636
+ configurable: true
637
+ });
638
+ Object.defineProperty(SkyPopoverFixture.prototype, "bodyElement", {
639
+ get: function () {
640
+ return this.queryOverlay('.sky-popover-body');
641
+ },
642
+ enumerable: false,
643
+ configurable: true
644
+ });
645
+ SkyPopoverFixture.prototype.getOverlay = function () {
646
+ return document.querySelector('sky-overlay');
647
+ };
648
+ SkyPopoverFixture.prototype.queryOverlay = function (query) {
649
+ var overlay = this.getOverlay();
650
+ return !overlay ? undefined : overlay.querySelector(query);
651
+ };
652
+ /**
653
+ * Searches the element's class names for a class which matches a given prefix.
654
+ * If a match is found, the prefix is trimmed from the class name and the suffix is returned.
655
+ * If no class matching the prefix is found, undefined is returned.
656
+ *
657
+ * Example:
658
+ * For a class 'sky-popover-placement-right', passing the prefix 'sky-popover-placement-'
659
+ * should return the value 'right'.
660
+ * @param prefix
661
+ */
662
+ SkyPopoverFixture.prototype.getClassSuffixByClassPrefix = function (element, prefix) {
663
+ var containerClasses = element === null || element === void 0 ? void 0 : element.className.split(' ');
664
+ var prefixedClass = containerClasses === null || containerClasses === void 0 ? void 0 : containerClasses.find(function (x) { return x.startsWith(prefix); });
665
+ return !prefixedClass ? undefined : prefixedClass.slice(prefix.length);
666
+ };
667
+ return SkyPopoverFixture;
668
+ }());
669
+
525
670
  /**
526
- * Searches the element's class names for a class which matches a given prefix.
527
- * If a match is found, the prefix is trimmed from the class name and the suffix is returned.
528
- * If no class matching the prefix is found, undefined is returned.
529
- *
530
- * Example:
531
- * For a class 'sky-popover-placement-right', passing the prefix 'sky-popover-placement-'
532
- * should return the value 'right'.
533
- * @param prefix
671
+ * Generated bundle index. Do not edit.
534
672
  */
535
- SkyPopoverFixture.prototype.getClassSuffixByClassPrefix = function (element, prefix) {
536
- var containerClasses = element === null || element === void 0 ? void 0 : element.className.split(' ');
537
- var prefixedClass = containerClasses === null || containerClasses === void 0 ? void 0 : containerClasses.find(function (x) { return x.startsWith(prefix); });
538
- return !prefixedClass
539
- ? undefined
540
- : prefixedClass.slice(prefix.length);
541
- };
542
- return SkyPopoverFixture;
543
- }());
544
673
 
545
- exports.SkyDropdownFixture = SkyDropdownFixture;
546
- exports.SkyDropdownTestingModule = SkyDropdownTestingModule;
547
- exports.SkyPopoverFixture = SkyPopoverFixture;
548
- exports.SkyPopoverTestingModule = SkyPopoverTestingModule;
674
+ exports.SkyDropdownFixture = SkyDropdownFixture;
675
+ exports.SkyDropdownTestingModule = SkyDropdownTestingModule;
676
+ exports.SkyPopoverFixture = SkyPopoverFixture;
677
+ exports.SkyPopoverTestingModule = SkyPopoverTestingModule;
549
678
 
550
- Object.defineProperty(exports, '__esModule', { value: true });
679
+ Object.defineProperty(exports, '__esModule', { value: true });
551
680
 
552
- })));
681
+ }));
553
682
  //# sourceMappingURL=skyux-popovers-testing.umd.js.map