@skyux/modals 8.7.2 → 9.0.0-alpha.1

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 (75) hide show
  1. package/documentation.json +56 -56
  2. package/esm2022/lib/modules/confirm/confirm.component.mjs +112 -0
  3. package/{esm2020 → esm2022}/lib/modules/confirm/confirm.module.mjs +13 -13
  4. package/esm2022/lib/modules/confirm/confirm.service.mjs +54 -0
  5. package/esm2022/lib/modules/modal/modal-adapter.service.mjs +99 -0
  6. package/esm2022/lib/modules/modal/modal-component-adapter.service.mjs +101 -0
  7. package/{esm2020 → esm2022}/lib/modules/modal/modal-configuration.mjs +4 -4
  8. package/{esm2020 → esm2022}/lib/modules/modal/modal-content.component.mjs +4 -4
  9. package/esm2022/lib/modules/modal/modal-errors.service.mjs +21 -0
  10. package/{esm2020 → esm2022}/lib/modules/modal/modal-footer.component.mjs +4 -4
  11. package/{esm2020 → esm2022}/lib/modules/modal/modal-header.component.mjs +4 -4
  12. package/{esm2020 → esm2022}/lib/modules/modal/modal-host-context.mjs +4 -4
  13. package/esm2022/lib/modules/modal/modal-host.component.mjs +163 -0
  14. package/esm2022/lib/modules/modal/modal-host.service.mjs +62 -0
  15. package/esm2022/lib/modules/modal/modal-instance.mjs +123 -0
  16. package/esm2022/lib/modules/modal/modal-is-dirty.directive.mjs +94 -0
  17. package/esm2022/lib/modules/modal/modal-scroll-shadow.directive.mjs +129 -0
  18. package/esm2022/lib/modules/modal/modal.component.mjs +229 -0
  19. package/{esm2020 → esm2022}/lib/modules/modal/modal.module.mjs +29 -29
  20. package/esm2022/lib/modules/modal/modal.service.mjs +97 -0
  21. package/esm2022/lib/modules/shared/sky-modals-resources.module.mjs +61 -0
  22. package/esm2022/testing/confirm/confirm-button-harness.mjs +46 -0
  23. package/esm2022/testing/confirm/confirm-harness.mjs +90 -0
  24. package/esm2022/testing/modal/modal-harness.mjs +75 -0
  25. package/esm2022/testing/modal-fixture.mjs +143 -0
  26. package/{fesm2020 → fesm2022}/skyux-modals-testing.mjs +60 -73
  27. package/{fesm2020 → fesm2022}/skyux-modals-testing.mjs.map +1 -1
  28. package/fesm2022/skyux-modals.mjs +1502 -0
  29. package/{fesm2015 → fesm2022}/skyux-modals.mjs.map +1 -1
  30. package/lib/modules/modal/modal-is-dirty.directive.d.ts +1 -1
  31. package/lib/modules/modal/modal.component.d.ts +1 -1
  32. package/package.json +16 -24
  33. package/esm2020/lib/modules/confirm/confirm.component.mjs +0 -114
  34. package/esm2020/lib/modules/confirm/confirm.service.mjs +0 -57
  35. package/esm2020/lib/modules/modal/modal-adapter.service.mjs +0 -101
  36. package/esm2020/lib/modules/modal/modal-component-adapter.service.mjs +0 -104
  37. package/esm2020/lib/modules/modal/modal-errors.service.mjs +0 -24
  38. package/esm2020/lib/modules/modal/modal-host.component.mjs +0 -164
  39. package/esm2020/lib/modules/modal/modal-host.service.mjs +0 -65
  40. package/esm2020/lib/modules/modal/modal-instance.mjs +0 -127
  41. package/esm2020/lib/modules/modal/modal-is-dirty.directive.mjs +0 -93
  42. package/esm2020/lib/modules/modal/modal-scroll-shadow.directive.mjs +0 -127
  43. package/esm2020/lib/modules/modal/modal.component.mjs +0 -228
  44. package/esm2020/lib/modules/modal/modal.service.mjs +0 -99
  45. package/esm2020/lib/modules/shared/sky-modals-resources.module.mjs +0 -61
  46. package/esm2020/testing/confirm/confirm-button-harness.mjs +0 -46
  47. package/esm2020/testing/confirm/confirm-harness.mjs +0 -97
  48. package/esm2020/testing/modal/modal-harness.mjs +0 -81
  49. package/esm2020/testing/modal-fixture.mjs +0 -145
  50. package/fesm2015/skyux-modals-testing.mjs +0 -409
  51. package/fesm2015/skyux-modals-testing.mjs.map +0 -1
  52. package/fesm2015/skyux-modals.mjs +0 -1522
  53. package/fesm2020/skyux-modals.mjs +0 -1510
  54. package/fesm2020/skyux-modals.mjs.map +0 -1
  55. /package/{esm2020 → esm2022}/index.mjs +0 -0
  56. /package/{esm2020 → esm2022}/lib/modules/confirm/confirm-button-action.mjs +0 -0
  57. /package/{esm2020 → esm2022}/lib/modules/confirm/confirm-button-config.mjs +0 -0
  58. /package/{esm2020 → esm2022}/lib/modules/confirm/confirm-button-style-type.mjs +0 -0
  59. /package/{esm2020 → esm2022}/lib/modules/confirm/confirm-button.mjs +0 -0
  60. /package/{esm2020 → esm2022}/lib/modules/confirm/confirm-closed-event-args.mjs +0 -0
  61. /package/{esm2020 → esm2022}/lib/modules/confirm/confirm-config-token.mjs +0 -0
  62. /package/{esm2020 → esm2022}/lib/modules/confirm/confirm-config.mjs +0 -0
  63. /package/{esm2020 → esm2022}/lib/modules/confirm/confirm-instance.mjs +0 -0
  64. /package/{esm2020 → esm2022}/lib/modules/confirm/confirm-type.mjs +0 -0
  65. /package/{esm2020 → esm2022}/lib/modules/modal/modal-before-close-handler.mjs +0 -0
  66. /package/{esm2020 → esm2022}/lib/modules/modal/modal-close-args.mjs +0 -0
  67. /package/{esm2020 → esm2022}/lib/modules/modal/modal-error.mjs +0 -0
  68. /package/{esm2020 → esm2022}/lib/modules/modal/modal-host-context-args.mjs +0 -0
  69. /package/{esm2020 → esm2022}/lib/modules/modal/modal-scroll-shadow-event-args.mjs +0 -0
  70. /package/{esm2020 → esm2022}/lib/modules/modal/modal.interface.mjs +0 -0
  71. /package/{esm2020 → esm2022}/skyux-modals.mjs +0 -0
  72. /package/{esm2020 → esm2022}/testing/confirm/confirm-button-harness-filters.mjs +0 -0
  73. /package/{esm2020 → esm2022}/testing/modal/modal-harness-filters.mjs +0 -0
  74. /package/{esm2020 → esm2022}/testing/public-api.mjs +0 -0
  75. /package/{esm2020 → esm2022}/testing/skyux-modals-testing.mjs +0 -0
@@ -1,30 +1,27 @@
1
- import { __classPrivateFieldSet, __classPrivateFieldGet } from 'tslib';
2
1
  import { SkyComponentHarness } from '@skyux/core/testing';
3
2
  import { SkyConfirmType } from '@skyux/modals';
4
3
  import { ComponentHarness, HarnessPredicate } from '@angular/cdk/testing';
5
4
 
6
- var _SkyModalFixture_instances, _SkyModalFixture_modalElement, _SkyModalFixture_fixture, _SkyModalFixture_checkModalElement, _SkyModalFixture_getModalDialogElement;
7
5
  /**
8
6
  * Allows interaction with a SKY UX modal component.
9
7
  * @internal
10
8
  */
11
9
  class SkyModalFixture {
10
+ #modalElement;
11
+ #fixture;
12
12
  constructor(fixture, skyTestId) {
13
- _SkyModalFixture_instances.add(this);
14
- _SkyModalFixture_modalElement.set(this, void 0);
15
- _SkyModalFixture_fixture.set(this, void 0);
16
- __classPrivateFieldSet(this, _SkyModalFixture_fixture, fixture, "f");
13
+ this.#fixture = fixture;
17
14
  const modalElement = document.querySelector('sky-modal[data-sky-id="' + skyTestId + '"]');
18
15
  if (!modalElement) {
19
16
  throw new Error(`No element was found with a \`data-sky-id\` value of "${skyTestId}".`);
20
17
  }
21
- __classPrivateFieldSet(this, _SkyModalFixture_modalElement, modalElement, "f");
18
+ this.#modalElement = modalElement;
22
19
  }
23
20
  /**
24
21
  * The modal component's ARIA describedby attribute.
25
22
  */
26
23
  get ariaDescribedBy() {
27
- const modalDialogElement = __classPrivateFieldGet(this, _SkyModalFixture_instances, "m", _SkyModalFixture_getModalDialogElement).call(this);
24
+ const modalDialogElement = this.#getModalDialogElement();
28
25
  /* Non-null assertion as our component has a default for if the user does not provide this attribute or if they provide "undefined" */
29
26
  const describedByAttribute =
30
27
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
@@ -35,7 +32,7 @@ class SkyModalFixture {
35
32
  * The modal component's ARIA labelledby attribute.
36
33
  */
37
34
  get ariaLabelledBy() {
38
- const modalDialogElement = __classPrivateFieldGet(this, _SkyModalFixture_instances, "m", _SkyModalFixture_getModalDialogElement).call(this);
35
+ const modalDialogElement = this.#getModalDialogElement();
39
36
  /* Non-null assertion as our component has a default for if the user does not provide this attribute or if they provide "undefined" */
40
37
  const labelledByAttribute =
41
38
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
@@ -46,7 +43,7 @@ class SkyModalFixture {
46
43
  * The modal component's role attribute.
47
44
  */
48
45
  get ariaRole() {
49
- const modalDialogElement = __classPrivateFieldGet(this, _SkyModalFixture_instances, "m", _SkyModalFixture_getModalDialogElement).call(this);
46
+ const modalDialogElement = this.#getModalDialogElement();
50
47
  /* Non-null assertion as our component has a default for if the user does not provide this attribute or if they provide "undefined" */
51
48
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
52
49
  const roleAttribute = modalDialogElement.getAttribute('role');
@@ -83,12 +80,12 @@ class SkyModalFixture {
83
80
  * Clicks the modal header's "close" button.
84
81
  */
85
82
  clickHeaderCloseButton() {
86
- __classPrivateFieldGet(this, _SkyModalFixture_instances, "m", _SkyModalFixture_checkModalElement).call(this);
87
- const closeButton = __classPrivateFieldGet(this, _SkyModalFixture_modalElement, "f").querySelector('.sky-modal .sky-modal-btn-close');
83
+ this.#checkModalElement();
84
+ const closeButton = this.#modalElement.querySelector('.sky-modal .sky-modal-btn-close');
88
85
  if (closeButton &&
89
86
  window.getComputedStyle(closeButton).display !== 'none') {
90
87
  closeButton.click();
91
- __classPrivateFieldGet(this, _SkyModalFixture_fixture, "f").detectChanges();
88
+ this.#fixture.detectChanges();
92
89
  }
93
90
  else {
94
91
  throw new Error(`No header close button exists.`);
@@ -98,11 +95,11 @@ class SkyModalFixture {
98
95
  * Clicks the modal header's "help" button.
99
96
  */
100
97
  clickHelpButton() {
101
- __classPrivateFieldGet(this, _SkyModalFixture_instances, "m", _SkyModalFixture_checkModalElement).call(this);
102
- const helpButton = __classPrivateFieldGet(this, _SkyModalFixture_modalElement, "f").querySelector('.sky-modal .sky-modal-header-buttons button[name="help-button"]');
98
+ this.#checkModalElement();
99
+ const helpButton = this.#modalElement.querySelector('.sky-modal .sky-modal-header-buttons button[name="help-button"]');
103
100
  if (helpButton && window.getComputedStyle(helpButton).display !== 'none') {
104
101
  helpButton.click();
105
- __classPrivateFieldGet(this, _SkyModalFixture_fixture, "f").detectChanges();
102
+ this.#fixture.detectChanges();
106
103
  }
107
104
  else {
108
105
  throw new Error(`No help button exists.`);
@@ -112,46 +109,48 @@ class SkyModalFixture {
112
109
  * Returns the main modal element.
113
110
  */
114
111
  getModalDiv() {
115
- __classPrivateFieldGet(this, _SkyModalFixture_instances, "m", _SkyModalFixture_checkModalElement).call(this);
116
- return __classPrivateFieldGet(this, _SkyModalFixture_modalElement, "f").querySelector('.sky-modal');
112
+ this.#checkModalElement();
113
+ return this.#modalElement.querySelector('.sky-modal');
117
114
  }
118
115
  /**
119
116
  * Returns the modal's content element.
120
117
  */
121
118
  getModalContentEl() {
122
- __classPrivateFieldGet(this, _SkyModalFixture_instances, "m", _SkyModalFixture_checkModalElement).call(this);
123
- return __classPrivateFieldGet(this, _SkyModalFixture_modalElement, "f").querySelector('.sky-modal-content');
119
+ this.#checkModalElement();
120
+ return this.#modalElement.querySelector('.sky-modal-content');
124
121
  }
125
122
  /**
126
123
  * Returns the modal's footer element.
127
124
  */
128
125
  getModalFooterEl() {
129
- __classPrivateFieldGet(this, _SkyModalFixture_instances, "m", _SkyModalFixture_checkModalElement).call(this);
130
- return __classPrivateFieldGet(this, _SkyModalFixture_modalElement, "f").querySelector('.sky-modal-footer');
126
+ this.#checkModalElement();
127
+ return this.#modalElement.querySelector('.sky-modal-footer');
131
128
  }
132
129
  /**
133
130
  * Returns the modal's header element.
134
131
  */
135
132
  getModalHeaderEl() {
136
- __classPrivateFieldGet(this, _SkyModalFixture_instances, "m", _SkyModalFixture_checkModalElement).call(this);
137
- return __classPrivateFieldGet(this, _SkyModalFixture_modalElement, "f").querySelector('.sky-modal-header');
133
+ this.#checkModalElement();
134
+ return this.#modalElement.querySelector('.sky-modal-header');
135
+ }
136
+ #checkModalElement() {
137
+ if (!document.contains(this.#modalElement)) {
138
+ throw new Error('Modal element no longer exists. Was the modal closed?');
139
+ }
140
+ }
141
+ #getModalDialogElement() {
142
+ this.#checkModalElement();
143
+ // We can always know that the dialog element will exist if the modal is open and exists.
144
+ return this.#modalElement.querySelector('.sky-modal-dialog');
138
145
  }
139
146
  }
140
- _SkyModalFixture_modalElement = new WeakMap(), _SkyModalFixture_fixture = new WeakMap(), _SkyModalFixture_instances = new WeakSet(), _SkyModalFixture_checkModalElement = function _SkyModalFixture_checkModalElement() {
141
- if (!document.contains(__classPrivateFieldGet(this, _SkyModalFixture_modalElement, "f"))) {
142
- throw new Error('Modal element no longer exists. Was the modal closed?');
143
- }
144
- }, _SkyModalFixture_getModalDialogElement = function _SkyModalFixture_getModalDialogElement() {
145
- __classPrivateFieldGet(this, _SkyModalFixture_instances, "m", _SkyModalFixture_checkModalElement).call(this);
146
- // We can always know that the dialog element will exist if the modal is open and exists.
147
- return __classPrivateFieldGet(this, _SkyModalFixture_modalElement, "f").querySelector('.sky-modal-dialog');
148
- };
149
147
 
150
148
  /**
151
149
  * Harness for interacting with a confirm component in tests.
152
150
  * @internal
153
151
  */
154
152
  class SkyConfirmButtonHarness extends ComponentHarness {
153
+ static { this.hostSelector = '.sky-confirm-buttons .sky-btn'; }
155
154
  /**
156
155
  * Gets a `HarnessPredicate` that can be used to search for a
157
156
  * `SkyConfirmButtonHarness` that meets certain criteria.
@@ -190,21 +189,16 @@ class SkyConfirmButtonHarness extends ComponentHarness {
190
189
  return (await this.host()).text();
191
190
  }
192
191
  }
193
- SkyConfirmButtonHarness.hostSelector = '.sky-confirm-buttons .sky-btn';
194
192
 
195
- var _SkyConfirmHarness_instances, _SkyConfirmHarness_getBodyEl, _SkyConfirmHarness_getButtons, _SkyConfirmHarness_getConfirmEl, _SkyConfirmHarness_getMessageEl, _SkyConfirmHarness_queryHarnesses;
196
193
  /**
197
194
  * Harness for interacting with a confirm component in tests.
198
195
  */
199
196
  class SkyConfirmHarness extends SkyComponentHarness {
200
- constructor() {
201
- super(...arguments);
202
- _SkyConfirmHarness_instances.add(this);
203
- _SkyConfirmHarness_getBodyEl.set(this, this.locatorForOptional('.sky-confirm-body'));
204
- _SkyConfirmHarness_getButtons.set(this, this.locatorForAll(SkyConfirmButtonHarness));
205
- _SkyConfirmHarness_getConfirmEl.set(this, this.locatorFor('.sky-confirm'));
206
- _SkyConfirmHarness_getMessageEl.set(this, this.locatorFor('.sky-confirm-message'));
207
- }
197
+ static { this.hostSelector = 'sky-confirm'; }
198
+ #getBodyEl = this.locatorForOptional('.sky-confirm-body');
199
+ #getButtons = this.locatorForAll(SkyConfirmButtonHarness);
200
+ #getConfirmEl = this.locatorFor('.sky-confirm');
201
+ #getMessageEl = this.locatorFor('.sky-confirm-message');
208
202
  /**
209
203
  * Clicks a confirm button.
210
204
  */
@@ -226,14 +220,14 @@ class SkyConfirmHarness extends SkyComponentHarness {
226
220
  if (type === SkyConfirmType.Custom) {
227
221
  throw new Error('Cannot click OK button on a confirm of type custom.');
228
222
  }
229
- const buttons = await __classPrivateFieldGet(this, _SkyConfirmHarness_getButtons, "f").call(this);
223
+ const buttons = await this.#getButtons();
230
224
  await buttons[0].click();
231
225
  }
232
226
  /**
233
227
  * Gets the body of the confirm component.
234
228
  */
235
229
  async getBodyText() {
236
- return (await __classPrivateFieldGet(this, _SkyConfirmHarness_getBodyEl, "f").call(this))?.text();
230
+ return (await this.#getBodyEl())?.text();
237
231
  }
238
232
  /**
239
233
  * Gets the confirm component's custom buttons.
@@ -243,7 +237,7 @@ class SkyConfirmHarness extends SkyComponentHarness {
243
237
  if (confirmType === SkyConfirmType.OK) {
244
238
  throw new Error('Cannot get custom buttons for confirm of type OK.');
245
239
  }
246
- const harnesses = await __classPrivateFieldGet(this, _SkyConfirmHarness_instances, "m", _SkyConfirmHarness_queryHarnesses).call(this, SkyConfirmButtonHarness.with(filters || {}));
240
+ const harnesses = await this.#queryHarnesses(SkyConfirmButtonHarness.with(filters || {}));
247
241
  if (filters && harnesses.length === 0) {
248
242
  // Stringify the regular expression so that it's readable in the console log.
249
243
  if (filters.text instanceof RegExp) {
@@ -257,13 +251,13 @@ class SkyConfirmHarness extends SkyComponentHarness {
257
251
  * Gets the message of the confirm component.
258
252
  */
259
253
  async getMessageText() {
260
- return (await __classPrivateFieldGet(this, _SkyConfirmHarness_getMessageEl, "f").call(this)).text();
254
+ return (await this.#getMessageEl()).text();
261
255
  }
262
256
  /**
263
257
  * Gets the type of the confirm component.
264
258
  */
265
259
  async getType() {
266
- const confirmEl = await __classPrivateFieldGet(this, _SkyConfirmHarness_getConfirmEl, "f").call(this);
260
+ const confirmEl = await this.#getConfirmEl();
267
261
  if (await confirmEl.hasClass('sky-confirm-type-ok')) {
268
262
  return SkyConfirmType.OK;
269
263
  }
@@ -273,28 +267,26 @@ class SkyConfirmHarness extends SkyComponentHarness {
273
267
  * Whether the whitespace is preserved on the confirm component.
274
268
  */
275
269
  async isWhiteSpacePreserved() {
276
- return (await __classPrivateFieldGet(this, _SkyConfirmHarness_getMessageEl, "f").call(this)).hasClass('sky-confirm-preserve-white-space');
270
+ return (await this.#getMessageEl()).hasClass('sky-confirm-preserve-white-space');
271
+ }
272
+ /**
273
+ * Returns child harnesses.
274
+ */
275
+ async #queryHarnesses(harness) {
276
+ return this.locatorForAll(harness)();
277
277
  }
278
278
  }
279
- _SkyConfirmHarness_getBodyEl = new WeakMap(), _SkyConfirmHarness_getButtons = new WeakMap(), _SkyConfirmHarness_getConfirmEl = new WeakMap(), _SkyConfirmHarness_getMessageEl = new WeakMap(), _SkyConfirmHarness_instances = new WeakSet(), _SkyConfirmHarness_queryHarnesses =
280
- /**
281
- * Returns child harnesses.
282
- */
283
- async function _SkyConfirmHarness_queryHarnesses(harness) {
284
- return this.locatorForAll(harness)();
285
- };
286
- SkyConfirmHarness.hostSelector = 'sky-confirm';
287
279
 
288
- var _SkyModalHarness_getModal, _SkyModalHarness_getModalDialog;
289
280
  /**
290
281
  * Harness for interacting with a modal component in tests.
291
282
  */
292
283
  class SkyModalHarness extends SkyComponentHarness {
293
- constructor() {
294
- super(...arguments);
295
- _SkyModalHarness_getModal.set(this, this.locatorFor('.sky-modal'));
296
- _SkyModalHarness_getModalDialog.set(this, this.locatorFor('.sky-modal-dialog'));
297
- }
284
+ /**
285
+ * @internal
286
+ */
287
+ static { this.hostSelector = 'sky-modal'; }
288
+ #getModal = this.locatorFor('.sky-modal');
289
+ #getModalDialog = this.locatorFor('.sky-modal-dialog');
298
290
  /**
299
291
  * Gets a `HarnessPredicate` that can be used to search for a
300
292
  * `SkyModalHarness` that meets certain criteria
@@ -306,19 +298,19 @@ class SkyModalHarness extends SkyComponentHarness {
306
298
  * Gets the aria-describedBy property of the modal
307
299
  */
308
300
  async getAriaDescribedBy() {
309
- return (await __classPrivateFieldGet(this, _SkyModalHarness_getModalDialog, "f").call(this)).getAttribute('aria-describedby');
301
+ return (await this.#getModalDialog()).getAttribute('aria-describedby');
310
302
  }
311
303
  /**
312
304
  * Gets the aria-labelledBy property of the modal
313
305
  */
314
306
  async getAriaLabelledBy() {
315
- return (await __classPrivateFieldGet(this, _SkyModalHarness_getModalDialog, "f").call(this)).getAttribute('aria-labelledby');
307
+ return (await this.#getModalDialog()).getAttribute('aria-labelledby');
316
308
  }
317
309
  /**
318
310
  * Gets the role of the modal.
319
311
  */
320
312
  async getAriaRole() {
321
- return (await __classPrivateFieldGet(this, _SkyModalHarness_getModalDialog, "f").call(this)).getAttribute('role');
313
+ return (await this.#getModalDialog()).getAttribute('role');
322
314
  }
323
315
  /**
324
316
  * Gets the modal size.
@@ -327,7 +319,7 @@ class SkyModalHarness extends SkyComponentHarness {
327
319
  if (await this.isFullPage()) {
328
320
  throw new Error('Size cannot be determined because size property is overridden when modal is full page');
329
321
  }
330
- const modal = await __classPrivateFieldGet(this, _SkyModalHarness_getModal, "f").call(this);
322
+ const modal = await this.#getModal();
331
323
  if (await modal.hasClass('sky-modal-small')) {
332
324
  return 'small';
333
325
  }
@@ -346,7 +338,7 @@ class SkyModalHarness extends SkyComponentHarness {
346
338
  * Whether the modal is full page.
347
339
  */
348
340
  async isFullPage() {
349
- const modal = __classPrivateFieldGet(this, _SkyModalHarness_getModal, "f").call(this);
341
+ const modal = this.#getModal();
350
342
  return (await modal).hasClass('sky-modal-full-page');
351
343
  }
352
344
  /**
@@ -358,11 +350,6 @@ class SkyModalHarness extends SkyComponentHarness {
358
350
  return isDirtyAttribute === 'true';
359
351
  }
360
352
  }
361
- _SkyModalHarness_getModal = new WeakMap(), _SkyModalHarness_getModalDialog = new WeakMap();
362
- /**
363
- * @internal
364
- */
365
- SkyModalHarness.hostSelector = 'sky-modal';
366
353
 
367
354
  /**
368
355
  * Generated bundle index. Do not edit.
@@ -1 +1 @@
1
- {"version":3,"file":"skyux-modals-testing.mjs","sources":["../../../../../libs/components/modals/testing/src/modal-fixture.ts","../../../../../libs/components/modals/testing/src/confirm/confirm-button-harness.ts","../../../../../libs/components/modals/testing/src/confirm/confirm-harness.ts","../../../../../libs/components/modals/testing/src/modal/modal-harness.ts","../../../../../libs/components/modals/testing/src/skyux-modals-testing.ts"],"sourcesContent":["import { ComponentFixture } from '@angular/core/testing';\n\n/**\n * Allows interaction with a SKY UX modal component.\n * @internal\n */\nexport class SkyModalFixture {\n #modalElement: HTMLElement;\n\n #fixture: ComponentFixture<unknown>;\n\n constructor(fixture: ComponentFixture<unknown>, skyTestId: string) {\n this.#fixture = fixture;\n const modalElement = document.querySelector(\n 'sky-modal[data-sky-id=\"' + skyTestId + '\"]'\n ) as HTMLElement;\n\n if (!modalElement) {\n throw new Error(\n `No element was found with a \\`data-sky-id\\` value of \"${skyTestId}\".`\n );\n }\n\n this.#modalElement = modalElement;\n }\n\n /**\n * The modal component's ARIA describedby attribute.\n */\n public get ariaDescribedBy(): string | undefined {\n const modalDialogElement = this.#getModalDialogElement();\n /* Non-null assertion as our component has a default for if the user does not provide this attribute or if they provide \"undefined\" */\n const describedByAttribute =\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n modalDialogElement.getAttribute('aria-describedby')!;\n return describedByAttribute;\n }\n\n /**\n * The modal component's ARIA labelledby attribute.\n */\n public get ariaLabelledBy(): string | undefined {\n const modalDialogElement = this.#getModalDialogElement();\n /* Non-null assertion as our component has a default for if the user does not provide this attribute or if they provide \"undefined\" */\n const labelledByAttribute =\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n modalDialogElement.getAttribute('aria-labelledby')!;\n\n return labelledByAttribute;\n }\n\n /**\n * The modal component's role attribute.\n */\n public get ariaRole(): string | undefined {\n const modalDialogElement = this.#getModalDialogElement();\n /* Non-null assertion as our component has a default for if the user does not provide this attribute or if they provide \"undefined\" */\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n const roleAttribute = modalDialogElement.getAttribute('role')!;\n return roleAttribute;\n }\n\n /**\n * Whether or not the modal is a full page modal.\n */\n public get fullPage(): boolean {\n const modalDivElement = this.getModalDiv();\n return modalDivElement.classList.contains('sky-modal-full-page');\n }\n\n /**\n * The size of the modal.\n */\n public get size(): string | undefined {\n const modalDivElement = this.getModalDiv();\n const possibleSizes = ['small', 'medium', 'large'];\n\n for (const size of possibleSizes) {\n if (modalDivElement.classList.contains('sky-modal-' + size)) {\n return size;\n }\n }\n\n return;\n }\n\n /**\n * Whether or not the modal is set up for tiled content.\n */\n public get tiledBody(): boolean {\n const modalDivElement = this.getModalDiv();\n return modalDivElement.classList.contains('sky-modal-tiled');\n }\n\n /**\n * Clicks the modal header's \"close\" button.\n */\n public clickHeaderCloseButton(): void {\n this.#checkModalElement();\n const closeButton: HTMLElement | null = this.#modalElement.querySelector(\n '.sky-modal .sky-modal-btn-close'\n );\n\n if (\n closeButton &&\n window.getComputedStyle(closeButton).display !== 'none'\n ) {\n closeButton.click();\n this.#fixture.detectChanges();\n } else {\n throw new Error(`No header close button exists.`);\n }\n }\n\n /**\n * Clicks the modal header's \"help\" button.\n */\n public clickHelpButton(): void {\n this.#checkModalElement();\n const helpButton: HTMLElement | null = this.#modalElement.querySelector(\n '.sky-modal .sky-modal-header-buttons button[name=\"help-button\"]'\n );\n\n if (helpButton && window.getComputedStyle(helpButton).display !== 'none') {\n helpButton.click();\n this.#fixture.detectChanges();\n } else {\n throw new Error(`No help button exists.`);\n }\n }\n\n /**\n * Returns the main modal element.\n */\n public getModalDiv(): any {\n this.#checkModalElement();\n return this.#modalElement.querySelector('.sky-modal');\n }\n\n /**\n * Returns the modal's content element.\n */\n public getModalContentEl(): any {\n this.#checkModalElement();\n return this.#modalElement.querySelector('.sky-modal-content');\n }\n\n /**\n * Returns the modal's footer element.\n */\n public getModalFooterEl(): any {\n this.#checkModalElement();\n return this.#modalElement.querySelector('.sky-modal-footer');\n }\n\n /**\n * Returns the modal's header element.\n */\n public getModalHeaderEl(): any {\n this.#checkModalElement();\n return this.#modalElement.querySelector('.sky-modal-header');\n }\n\n #checkModalElement(): void {\n if (!document.contains(this.#modalElement)) {\n throw new Error('Modal element no longer exists. Was the modal closed?');\n }\n }\n\n #getModalDialogElement(): HTMLElement {\n this.#checkModalElement();\n // We can always know that the dialog element will exist if the modal is open and exists.\n return this.#modalElement.querySelector('.sky-modal-dialog')!;\n }\n}\n","import { ComponentHarness, HarnessPredicate } from '@angular/cdk/testing';\nimport { SkyConfirmButtonStyleType } from '@skyux/modals';\n\nimport { SkyConfirmButtonHarnessFilters } from './confirm-button-harness-filters';\n\n/**\n * Harness for interacting with a confirm component in tests.\n * @internal\n */\nexport class SkyConfirmButtonHarness extends ComponentHarness {\n public static hostSelector = '.sky-confirm-buttons .sky-btn';\n\n /**\n * Gets a `HarnessPredicate` that can be used to search for a\n * `SkyConfirmButtonHarness` that meets certain criteria.\n */\n public static with(\n filters: SkyConfirmButtonHarnessFilters\n ): HarnessPredicate<SkyConfirmButtonHarness> {\n return new HarnessPredicate(SkyConfirmButtonHarness, filters)\n .addOption('text', filters.text, async (harness, text) =>\n HarnessPredicate.stringMatches(await harness.getText(), text)\n )\n .addOption('styleType', filters.styleType, async (harness, styleType) =>\n HarnessPredicate.stringMatches(await harness.getStyleType(), styleType)\n );\n }\n\n /**\n * Clicks the confirm button.\n */\n public async click(): Promise<void> {\n return (await this.host()).click();\n }\n\n /**\n * Gets the button style of the confirm button.\n */\n public async getStyleType(): Promise<SkyConfirmButtonStyleType> {\n const hostEl = await this.host();\n\n if (await hostEl.hasClass('sky-btn-primary')) {\n return 'primary';\n } else if (await hostEl.hasClass('sky-btn-link')) {\n return 'link';\n } else if (await hostEl.hasClass('sky-btn-danger')) {\n return 'danger';\n }\n return 'default';\n }\n\n /**\n * Gets the text content of the confirm button.\n */\n public async getText(): Promise<string> {\n return (await this.host()).text();\n }\n}\n","import { ComponentHarness, HarnessQuery } from '@angular/cdk/testing';\nimport { SkyComponentHarness } from '@skyux/core/testing';\nimport { SkyConfirmType } from '@skyux/modals';\n\nimport { SkyConfirmButtonHarness } from './confirm-button-harness';\nimport { SkyConfirmButtonHarnessFilters } from './confirm-button-harness-filters';\n\n/**\n * Harness for interacting with a confirm component in tests.\n */\nexport class SkyConfirmHarness extends SkyComponentHarness {\n public static hostSelector = 'sky-confirm';\n\n #getBodyEl = this.locatorForOptional('.sky-confirm-body');\n #getButtons = this.locatorForAll(SkyConfirmButtonHarness);\n #getConfirmEl = this.locatorFor('.sky-confirm');\n #getMessageEl = this.locatorFor('.sky-confirm-message');\n\n /**\n * Clicks a confirm button.\n */\n public async clickCustomButton(\n filters: SkyConfirmButtonHarnessFilters\n ): Promise<void> {\n const buttons = await this.getCustomButtons(filters);\n\n if (buttons.length > 1) {\n if (filters.text instanceof RegExp) {\n filters.text = filters.text.toString();\n }\n throw new Error(\n `More than one button matches the filter(s): ${JSON.stringify(\n filters\n )}.`\n );\n }\n await buttons[0].click();\n }\n\n /**\n * Clicks a confirm button.\n */\n public async clickOkButton(): Promise<void> {\n const type = await this.getType();\n\n if (type === SkyConfirmType.Custom) {\n throw new Error('Cannot click OK button on a confirm of type custom.');\n }\n const buttons = await this.#getButtons();\n await buttons[0].click();\n }\n\n /**\n * Gets the body of the confirm component.\n */\n public async getBodyText(): Promise<string | undefined> {\n return (await this.#getBodyEl())?.text();\n }\n\n /**\n * Gets the confirm component's custom buttons.\n */\n public async getCustomButtons(\n filters?: SkyConfirmButtonHarnessFilters\n ): Promise<SkyConfirmButtonHarness[]> {\n const confirmType = await this.getType();\n\n if (confirmType === SkyConfirmType.OK) {\n throw new Error('Cannot get custom buttons for confirm of type OK.');\n }\n\n const harnesses = await this.#queryHarnesses(\n SkyConfirmButtonHarness.with(filters || {})\n );\n\n if (filters && harnesses.length === 0) {\n // Stringify the regular expression so that it's readable in the console log.\n if (filters.text instanceof RegExp) {\n filters.text = filters.text.toString();\n }\n\n throw new Error(\n `Could not find buttons matching filter(s): ${JSON.stringify(filters)}.`\n );\n }\n\n return harnesses;\n }\n\n /**\n * Gets the message of the confirm component.\n */\n public async getMessageText(): Promise<string> {\n return (await this.#getMessageEl()).text();\n }\n\n /**\n * Gets the type of the confirm component.\n */\n public async getType(): Promise<SkyConfirmType> {\n const confirmEl = await this.#getConfirmEl();\n if (await confirmEl.hasClass('sky-confirm-type-ok')) {\n return SkyConfirmType.OK;\n }\n\n return SkyConfirmType.Custom;\n }\n\n /**\n * Whether the whitespace is preserved on the confirm component.\n */\n public async isWhiteSpacePreserved(): Promise<boolean> {\n return (await this.#getMessageEl()).hasClass(\n 'sky-confirm-preserve-white-space'\n );\n }\n\n /**\n * Returns child harnesses.\n */\n async #queryHarnesses<T extends ComponentHarness>(\n harness: HarnessQuery<T>\n ): Promise<T[]> {\n return this.locatorForAll(harness)();\n }\n}\n","import { HarnessPredicate } from '@angular/cdk/testing';\nimport { SkyComponentHarness } from '@skyux/core/testing';\n\nimport { SkyModalHarnessFilters } from './modal-harness-filters';\n\n/**\n * Harness for interacting with a modal component in tests.\n */\nexport class SkyModalHarness extends SkyComponentHarness {\n /**\n * @internal\n */\n public static hostSelector = 'sky-modal';\n\n #getModal = this.locatorFor('.sky-modal');\n #getModalDialog = this.locatorFor('.sky-modal-dialog');\n\n /**\n * Gets a `HarnessPredicate` that can be used to search for a\n * `SkyModalHarness` that meets certain criteria\n */\n public static with(\n filters: SkyModalHarnessFilters\n ): HarnessPredicate<SkyModalHarness> {\n return SkyModalHarness.getDataSkyIdPredicate(filters);\n }\n\n /**\n * Gets the aria-describedBy property of the modal\n */\n public async getAriaDescribedBy(): Promise<string | null> {\n return (await this.#getModalDialog()).getAttribute('aria-describedby');\n }\n\n /**\n * Gets the aria-labelledBy property of the modal\n */\n public async getAriaLabelledBy(): Promise<string | null> {\n return (await this.#getModalDialog()).getAttribute('aria-labelledby');\n }\n\n /**\n * Gets the role of the modal.\n */\n public async getAriaRole(): Promise<string | null> {\n return (await this.#getModalDialog()).getAttribute('role');\n }\n\n /**\n * Gets the modal size.\n */\n public async getSize(): Promise<string> {\n if (await this.isFullPage()) {\n throw new Error(\n 'Size cannot be determined because size property is overridden when modal is full page'\n );\n }\n\n const modal = await this.#getModal();\n\n if (await modal.hasClass('sky-modal-small')) {\n return 'small';\n }\n\n if (await modal.hasClass('sky-modal-large')) {\n return 'large';\n }\n\n return 'medium';\n }\n\n /**\n * Gets the wrapper class of the modal.\n */\n public async getWrapperClass(): Promise<string | undefined> {\n return await (await this.host()).getProperty('className');\n }\n\n /**\n * Whether the modal is full page.\n */\n public async isFullPage(): Promise<boolean> {\n const modal = this.#getModal();\n return (await modal).hasClass('sky-modal-full-page');\n }\n\n /**\n * Whether the modal has {@link SkyModalIsDirtyDirective.isDirty} set to dirty.\n */\n public async isDirty(): Promise<boolean> {\n const modalHost = await this.host();\n const isDirtyAttribute = await modalHost.getAttribute(\n 'data-sky-modal-is-dirty'\n );\n return isDirtyAttribute === 'true';\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;AAEA;;;AAGG;MACU,eAAe,CAAA;IAK1B,WAAY,CAAA,OAAkC,EAAE,SAAiB,EAAA;;QAJjE,6BAA2B,CAAA,GAAA,CAAA,IAAA,EAAA,KAAA,CAAA,CAAA,CAAA;QAE3B,wBAAoC,CAAA,GAAA,CAAA,IAAA,EAAA,KAAA,CAAA,CAAA,CAAA;AAGlC,QAAA,sBAAA,CAAA,IAAI,EAAA,wBAAA,EAAY,OAAO,EAAA,GAAA,CAA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M,CAAC;KACpC;;;AAtFD;;AAEG;AACW,eAAY,CAAA,YAAA,GAAG,WAAW;;ACZ1C;;AAEG;;;;"}
1
+ {"version":3,"file":"skyux-modals-testing.mjs","sources":["../../../../../libs/components/modals/testing/src/modal-fixture.ts","../../../../../libs/components/modals/testing/src/confirm/confirm-button-harness.ts","../../../../../libs/components/modals/testing/src/confirm/confirm-harness.ts","../../../../../libs/components/modals/testing/src/modal/modal-harness.ts","../../../../../libs/components/modals/testing/src/skyux-modals-testing.ts"],"sourcesContent":["import { ComponentFixture } from '@angular/core/testing';\n\n/**\n * Allows interaction with a SKY UX modal component.\n * @internal\n */\nexport class SkyModalFixture {\n #modalElement: HTMLElement;\n\n #fixture: ComponentFixture<unknown>;\n\n constructor(fixture: ComponentFixture<unknown>, skyTestId: string) {\n this.#fixture = fixture;\n const modalElement = document.querySelector(\n 'sky-modal[data-sky-id=\"' + skyTestId + '\"]'\n ) as HTMLElement;\n\n if (!modalElement) {\n throw new Error(\n `No element was found with a \\`data-sky-id\\` value of \"${skyTestId}\".`\n );\n }\n\n this.#modalElement = modalElement;\n }\n\n /**\n * The modal component's ARIA describedby attribute.\n */\n public get ariaDescribedBy(): string | undefined {\n const modalDialogElement = this.#getModalDialogElement();\n /* Non-null assertion as our component has a default for if the user does not provide this attribute or if they provide \"undefined\" */\n const describedByAttribute =\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n modalDialogElement.getAttribute('aria-describedby')!;\n return describedByAttribute;\n }\n\n /**\n * The modal component's ARIA labelledby attribute.\n */\n public get ariaLabelledBy(): string | undefined {\n const modalDialogElement = this.#getModalDialogElement();\n /* Non-null assertion as our component has a default for if the user does not provide this attribute or if they provide \"undefined\" */\n const labelledByAttribute =\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n modalDialogElement.getAttribute('aria-labelledby')!;\n\n return labelledByAttribute;\n }\n\n /**\n * The modal component's role attribute.\n */\n public get ariaRole(): string | undefined {\n const modalDialogElement = this.#getModalDialogElement();\n /* Non-null assertion as our component has a default for if the user does not provide this attribute or if they provide \"undefined\" */\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n const roleAttribute = modalDialogElement.getAttribute('role')!;\n return roleAttribute;\n }\n\n /**\n * Whether or not the modal is a full page modal.\n */\n public get fullPage(): boolean {\n const modalDivElement = this.getModalDiv();\n return modalDivElement.classList.contains('sky-modal-full-page');\n }\n\n /**\n * The size of the modal.\n */\n public get size(): string | undefined {\n const modalDivElement = this.getModalDiv();\n const possibleSizes = ['small', 'medium', 'large'];\n\n for (const size of possibleSizes) {\n if (modalDivElement.classList.contains('sky-modal-' + size)) {\n return size;\n }\n }\n\n return;\n }\n\n /**\n * Whether or not the modal is set up for tiled content.\n */\n public get tiledBody(): boolean {\n const modalDivElement = this.getModalDiv();\n return modalDivElement.classList.contains('sky-modal-tiled');\n }\n\n /**\n * Clicks the modal header's \"close\" button.\n */\n public clickHeaderCloseButton(): void {\n this.#checkModalElement();\n const closeButton: HTMLElement | null = this.#modalElement.querySelector(\n '.sky-modal .sky-modal-btn-close'\n );\n\n if (\n closeButton &&\n window.getComputedStyle(closeButton).display !== 'none'\n ) {\n closeButton.click();\n this.#fixture.detectChanges();\n } else {\n throw new Error(`No header close button exists.`);\n }\n }\n\n /**\n * Clicks the modal header's \"help\" button.\n */\n public clickHelpButton(): void {\n this.#checkModalElement();\n const helpButton: HTMLElement | null = this.#modalElement.querySelector(\n '.sky-modal .sky-modal-header-buttons button[name=\"help-button\"]'\n );\n\n if (helpButton && window.getComputedStyle(helpButton).display !== 'none') {\n helpButton.click();\n this.#fixture.detectChanges();\n } else {\n throw new Error(`No help button exists.`);\n }\n }\n\n /**\n * Returns the main modal element.\n */\n public getModalDiv(): any {\n this.#checkModalElement();\n return this.#modalElement.querySelector('.sky-modal');\n }\n\n /**\n * Returns the modal's content element.\n */\n public getModalContentEl(): any {\n this.#checkModalElement();\n return this.#modalElement.querySelector('.sky-modal-content');\n }\n\n /**\n * Returns the modal's footer element.\n */\n public getModalFooterEl(): any {\n this.#checkModalElement();\n return this.#modalElement.querySelector('.sky-modal-footer');\n }\n\n /**\n * Returns the modal's header element.\n */\n public getModalHeaderEl(): any {\n this.#checkModalElement();\n return this.#modalElement.querySelector('.sky-modal-header');\n }\n\n #checkModalElement(): void {\n if (!document.contains(this.#modalElement)) {\n throw new Error('Modal element no longer exists. Was the modal closed?');\n }\n }\n\n #getModalDialogElement(): HTMLElement {\n this.#checkModalElement();\n // We can always know that the dialog element will exist if the modal is open and exists.\n return this.#modalElement.querySelector('.sky-modal-dialog')!;\n }\n}\n","import { ComponentHarness, HarnessPredicate } from '@angular/cdk/testing';\nimport { SkyConfirmButtonStyleType } from '@skyux/modals';\n\nimport { SkyConfirmButtonHarnessFilters } from './confirm-button-harness-filters';\n\n/**\n * Harness for interacting with a confirm component in tests.\n * @internal\n */\nexport class SkyConfirmButtonHarness extends ComponentHarness {\n public static hostSelector = '.sky-confirm-buttons .sky-btn';\n\n /**\n * Gets a `HarnessPredicate` that can be used to search for a\n * `SkyConfirmButtonHarness` that meets certain criteria.\n */\n public static with(\n filters: SkyConfirmButtonHarnessFilters\n ): HarnessPredicate<SkyConfirmButtonHarness> {\n return new HarnessPredicate(SkyConfirmButtonHarness, filters)\n .addOption('text', filters.text, async (harness, text) =>\n HarnessPredicate.stringMatches(await harness.getText(), text)\n )\n .addOption('styleType', filters.styleType, async (harness, styleType) =>\n HarnessPredicate.stringMatches(await harness.getStyleType(), styleType)\n );\n }\n\n /**\n * Clicks the confirm button.\n */\n public async click(): Promise<void> {\n return (await this.host()).click();\n }\n\n /**\n * Gets the button style of the confirm button.\n */\n public async getStyleType(): Promise<SkyConfirmButtonStyleType> {\n const hostEl = await this.host();\n\n if (await hostEl.hasClass('sky-btn-primary')) {\n return 'primary';\n } else if (await hostEl.hasClass('sky-btn-link')) {\n return 'link';\n } else if (await hostEl.hasClass('sky-btn-danger')) {\n return 'danger';\n }\n return 'default';\n }\n\n /**\n * Gets the text content of the confirm button.\n */\n public async getText(): Promise<string> {\n return (await this.host()).text();\n }\n}\n","import { ComponentHarness, HarnessQuery } from '@angular/cdk/testing';\nimport { SkyComponentHarness } from '@skyux/core/testing';\nimport { SkyConfirmType } from '@skyux/modals';\n\nimport { SkyConfirmButtonHarness } from './confirm-button-harness';\nimport { SkyConfirmButtonHarnessFilters } from './confirm-button-harness-filters';\n\n/**\n * Harness for interacting with a confirm component in tests.\n */\nexport class SkyConfirmHarness extends SkyComponentHarness {\n public static hostSelector = 'sky-confirm';\n\n #getBodyEl = this.locatorForOptional('.sky-confirm-body');\n #getButtons = this.locatorForAll(SkyConfirmButtonHarness);\n #getConfirmEl = this.locatorFor('.sky-confirm');\n #getMessageEl = this.locatorFor('.sky-confirm-message');\n\n /**\n * Clicks a confirm button.\n */\n public async clickCustomButton(\n filters: SkyConfirmButtonHarnessFilters\n ): Promise<void> {\n const buttons = await this.getCustomButtons(filters);\n\n if (buttons.length > 1) {\n if (filters.text instanceof RegExp) {\n filters.text = filters.text.toString();\n }\n throw new Error(\n `More than one button matches the filter(s): ${JSON.stringify(\n filters\n )}.`\n );\n }\n await buttons[0].click();\n }\n\n /**\n * Clicks a confirm button.\n */\n public async clickOkButton(): Promise<void> {\n const type = await this.getType();\n\n if (type === SkyConfirmType.Custom) {\n throw new Error('Cannot click OK button on a confirm of type custom.');\n }\n const buttons = await this.#getButtons();\n await buttons[0].click();\n }\n\n /**\n * Gets the body of the confirm component.\n */\n public async getBodyText(): Promise<string | undefined> {\n return (await this.#getBodyEl())?.text();\n }\n\n /**\n * Gets the confirm component's custom buttons.\n */\n public async getCustomButtons(\n filters?: SkyConfirmButtonHarnessFilters\n ): Promise<SkyConfirmButtonHarness[]> {\n const confirmType = await this.getType();\n\n if (confirmType === SkyConfirmType.OK) {\n throw new Error('Cannot get custom buttons for confirm of type OK.');\n }\n\n const harnesses = await this.#queryHarnesses(\n SkyConfirmButtonHarness.with(filters || {})\n );\n\n if (filters && harnesses.length === 0) {\n // Stringify the regular expression so that it's readable in the console log.\n if (filters.text instanceof RegExp) {\n filters.text = filters.text.toString();\n }\n\n throw new Error(\n `Could not find buttons matching filter(s): ${JSON.stringify(filters)}.`\n );\n }\n\n return harnesses;\n }\n\n /**\n * Gets the message of the confirm component.\n */\n public async getMessageText(): Promise<string> {\n return (await this.#getMessageEl()).text();\n }\n\n /**\n * Gets the type of the confirm component.\n */\n public async getType(): Promise<SkyConfirmType> {\n const confirmEl = await this.#getConfirmEl();\n if (await confirmEl.hasClass('sky-confirm-type-ok')) {\n return SkyConfirmType.OK;\n }\n\n return SkyConfirmType.Custom;\n }\n\n /**\n * Whether the whitespace is preserved on the confirm component.\n */\n public async isWhiteSpacePreserved(): Promise<boolean> {\n return (await this.#getMessageEl()).hasClass(\n 'sky-confirm-preserve-white-space'\n );\n }\n\n /**\n * Returns child harnesses.\n */\n async #queryHarnesses<T extends ComponentHarness>(\n harness: HarnessQuery<T>\n ): Promise<T[]> {\n return this.locatorForAll(harness)();\n }\n}\n","import { HarnessPredicate } from '@angular/cdk/testing';\nimport { SkyComponentHarness } from '@skyux/core/testing';\n\nimport { SkyModalHarnessFilters } from './modal-harness-filters';\n\n/**\n * Harness for interacting with a modal component in tests.\n */\nexport class SkyModalHarness extends SkyComponentHarness {\n /**\n * @internal\n */\n public static hostSelector = 'sky-modal';\n\n #getModal = this.locatorFor('.sky-modal');\n #getModalDialog = this.locatorFor('.sky-modal-dialog');\n\n /**\n * Gets a `HarnessPredicate` that can be used to search for a\n * `SkyModalHarness` that meets certain criteria\n */\n public static with(\n filters: SkyModalHarnessFilters\n ): HarnessPredicate<SkyModalHarness> {\n return SkyModalHarness.getDataSkyIdPredicate(filters);\n }\n\n /**\n * Gets the aria-describedBy property of the modal\n */\n public async getAriaDescribedBy(): Promise<string | null> {\n return (await this.#getModalDialog()).getAttribute('aria-describedby');\n }\n\n /**\n * Gets the aria-labelledBy property of the modal\n */\n public async getAriaLabelledBy(): Promise<string | null> {\n return (await this.#getModalDialog()).getAttribute('aria-labelledby');\n }\n\n /**\n * Gets the role of the modal.\n */\n public async getAriaRole(): Promise<string | null> {\n return (await this.#getModalDialog()).getAttribute('role');\n }\n\n /**\n * Gets the modal size.\n */\n public async getSize(): Promise<string> {\n if (await this.isFullPage()) {\n throw new Error(\n 'Size cannot be determined because size property is overridden when modal is full page'\n );\n }\n\n const modal = await this.#getModal();\n\n if (await modal.hasClass('sky-modal-small')) {\n return 'small';\n }\n\n if (await modal.hasClass('sky-modal-large')) {\n return 'large';\n }\n\n return 'medium';\n }\n\n /**\n * Gets the wrapper class of the modal.\n */\n public async getWrapperClass(): Promise<string | undefined> {\n return await (await this.host()).getProperty('className');\n }\n\n /**\n * Whether the modal is full page.\n */\n public async isFullPage(): Promise<boolean> {\n const modal = this.#getModal();\n return (await modal).hasClass('sky-modal-full-page');\n }\n\n /**\n * Whether the modal has {@link SkyModalIsDirtyDirective.isDirty} set to dirty.\n */\n public async isDirty(): Promise<boolean> {\n const modalHost = await this.host();\n const isDirtyAttribute = await modalHost.getAttribute(\n 'data-sky-modal-is-dirty'\n );\n return isDirtyAttribute === 'true';\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;AAEA;;;AAGG;MACU,eAAe,CAAA;AAC1B,IAAA,aAAa,CAAc;AAE3B,IAAA,QAAQ,CAA4B;IAEpC,WAAY,CAAA,OAAkC,EAAE,SAAiB,EAAA;AAC/D,QAAA,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC;AACxB,QAAA,MAAM,YAAY,GAAG,QAAQ,CAAC,aAAa,CACzC,yBAAyB,GAAG,SAAS,GAAG,IAAI,CAC9B,CAAC;QAEjB,IAAI,CAAC,YAAY,EAAE;AACjB,YAAA,MAAM,IAAI,KAAK,CACb,yDAAyD,SAAS,CAAA,EAAA,CAAI,CACvE,CAAC;AACH,SAAA;AAED,QAAA,IAAI,CAAC,aAAa,GAAG,YAAY,CAAC;KACnC;AAED;;AAEG;AACH,IAAA,IAAW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