@skyux/indicators 8.7.0 → 9.0.0-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/{esm2020 → esm2022}/lib/modules/alert/alert.component.mjs +56 -55
- package/{esm2020 → esm2022}/lib/modules/alert/alert.module.mjs +13 -13
- package/{esm2020 → esm2022}/lib/modules/chevron/chevron.component.mjs +4 -4
- package/{esm2020 → esm2022}/lib/modules/chevron/chevron.module.mjs +13 -13
- package/{esm2020 → esm2022}/lib/modules/expansion-indicator/expansion-indicator.component.mjs +4 -4
- package/{esm2020 → esm2022}/lib/modules/expansion-indicator/expansion-indicator.module.mjs +5 -5
- package/{esm2020 → esm2022}/lib/modules/help-inline/help-inline-aria-expanded.pipe.mjs +4 -4
- package/{esm2020 → esm2022}/lib/modules/help-inline/help-inline.component.mjs +4 -4
- package/{esm2020 → esm2022}/lib/modules/help-inline/help-inline.module.mjs +13 -13
- package/esm2022/lib/modules/icon/icon-class-list.pipe.mjs +35 -0
- package/esm2022/lib/modules/icon/icon-resolver.service.mjs +57 -0
- package/{esm2020 → esm2022}/lib/modules/icon/icon-stack.component.mjs +4 -4
- package/{esm2020 → esm2022}/lib/modules/icon/icon.component.mjs +4 -4
- package/{esm2020 → esm2022}/lib/modules/icon/icon.module.mjs +5 -5
- package/{esm2020 → esm2022}/lib/modules/key-info/key-info-label.component.mjs +4 -4
- package/{esm2020 → esm2022}/lib/modules/key-info/key-info-value.component.mjs +4 -4
- package/{esm2020 → esm2022}/lib/modules/key-info/key-info.component.mjs +4 -4
- package/{esm2020 → esm2022}/lib/modules/key-info/key-info.module.mjs +9 -9
- package/esm2022/lib/modules/label/label.component.mjs +118 -0
- package/{esm2020 → esm2022}/lib/modules/label/label.module.mjs +11 -11
- package/{esm2020 → esm2022}/lib/modules/shared/sky-indicators-resources.module.mjs +11 -11
- package/esm2022/lib/modules/status-indicator/status-indicator.component.mjs +104 -0
- package/{esm2020 → esm2022}/lib/modules/status-indicator/status-indicator.module.mjs +13 -13
- package/esm2022/lib/modules/text-highlight/text-highlight.directive.mjs +151 -0
- package/{esm2020 → esm2022}/lib/modules/text-highlight/text-highlight.module.mjs +5 -5
- package/{esm2020 → esm2022}/lib/modules/tokens/token.component.mjs +15 -15
- package/esm2022/lib/modules/tokens/tokens.component.mjs +332 -0
- package/{esm2020 → esm2022}/lib/modules/tokens/tokens.module.mjs +11 -11
- package/esm2022/lib/modules/wait/wait-adapter.service.mjs +224 -0
- package/{esm2020 → esm2022}/lib/modules/wait/wait-page.component.mjs +4 -4
- package/esm2022/lib/modules/wait/wait.component.mjs +171 -0
- package/{esm2020 → esm2022}/lib/modules/wait/wait.module.mjs +5 -5
- package/esm2022/lib/modules/wait/wait.service.mjs +159 -0
- package/esm2022/testing/alert/alert-harness.mjs +112 -0
- package/esm2022/testing/alert-fixture.mjs +70 -0
- package/esm2022/testing/chevron/chevron-harness.mjs +38 -0
- package/esm2022/testing/help-inline/help-inline-harness.mjs +25 -0
- package/esm2022/testing/icon/icon-harness.mjs +86 -0
- package/esm2022/testing/key-info/key-info-harness.mjs +43 -0
- package/{esm2020 → esm2022}/testing/key-info/key-info-label-harness.mjs +5 -5
- package/{esm2020 → esm2022}/testing/key-info/key-info-value-harness.mjs +5 -5
- package/esm2022/testing/label/label-harness.mjs +88 -0
- package/esm2022/testing/label-fixture.mjs +42 -0
- package/esm2022/testing/tokens/token-harness.mjs +63 -0
- package/esm2022/testing/tokens/tokens-harness.mjs +45 -0
- package/esm2022/testing/wait/wait-harness.mjs +60 -0
- package/esm2022/testing/wait-fixture.mjs +28 -0
- package/{fesm2020 → fesm2022}/skyux-indicators-testing.mjs +146 -190
- package/{fesm2020 → fesm2022}/skyux-indicators-testing.mjs.map +1 -1
- package/{fesm2020 → fesm2022}/skyux-indicators.mjs +756 -737
- package/fesm2022/skyux-indicators.mjs.map +1 -0
- package/lib/modules/alert/alert.component.d.ts +1 -1
- package/lib/modules/chevron/chevron.component.d.ts +1 -1
- package/lib/modules/expansion-indicator/expansion-indicator.component.d.ts +1 -1
- package/lib/modules/help-inline/help-inline.component.d.ts +1 -1
- package/lib/modules/icon/icon-stack.component.d.ts +1 -1
- package/lib/modules/icon/icon.component.d.ts +1 -1
- package/lib/modules/key-info/key-info.component.d.ts +1 -1
- package/lib/modules/label/label.component.d.ts +1 -1
- package/lib/modules/status-indicator/status-indicator.component.d.ts +1 -1
- package/lib/modules/text-highlight/text-highlight.directive.d.ts +1 -1
- package/lib/modules/tokens/token.component.d.ts +1 -1
- package/lib/modules/tokens/tokens.component.d.ts +1 -1
- package/lib/modules/wait/wait-page.component.d.ts +1 -1
- package/lib/modules/wait/wait.component.d.ts +1 -1
- package/package.json +17 -25
- package/esm2020/lib/modules/icon/icon-class-list.pipe.mjs +0 -40
- package/esm2020/lib/modules/icon/icon-resolver.service.mjs +0 -60
- package/esm2020/lib/modules/label/label.component.mjs +0 -116
- package/esm2020/lib/modules/status-indicator/status-indicator.component.mjs +0 -104
- package/esm2020/lib/modules/text-highlight/text-highlight.directive.mjs +0 -154
- package/esm2020/lib/modules/tokens/tokens.component.mjs +0 -320
- package/esm2020/lib/modules/wait/wait-adapter.service.mjs +0 -221
- package/esm2020/lib/modules/wait/wait.component.mjs +0 -167
- package/esm2020/lib/modules/wait/wait.service.mjs +0 -161
- package/esm2020/testing/alert/alert-harness.mjs +0 -118
- package/esm2020/testing/alert-fixture.mjs +0 -72
- package/esm2020/testing/chevron/chevron-harness.mjs +0 -44
- package/esm2020/testing/help-inline/help-inline-harness.mjs +0 -31
- package/esm2020/testing/icon/icon-harness.mjs +0 -90
- package/esm2020/testing/key-info/key-info-harness.mjs +0 -49
- package/esm2020/testing/label/label-harness.mjs +0 -94
- package/esm2020/testing/label-fixture.mjs +0 -45
- package/esm2020/testing/tokens/token-harness.mjs +0 -69
- package/esm2020/testing/tokens/tokens-harness.mjs +0 -45
- package/esm2020/testing/wait/wait-harness.mjs +0 -66
- package/esm2020/testing/wait-fixture.mjs +0 -31
- package/fesm2015/skyux-indicators-testing.mjs +0 -854
- package/fesm2015/skyux-indicators-testing.mjs.map +0 -1
- package/fesm2015/skyux-indicators.mjs +0 -2172
- package/fesm2015/skyux-indicators.mjs.map +0 -1
- package/fesm2020/skyux-indicators.mjs.map +0 -1
- /package/{esm2020 → esm2022}/index.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/modules/icon/icon-stack-item.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/modules/icon/types/icon-resolved.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/modules/icon/types/icon-type.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/modules/icon/types/icon-variant-type.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/modules/key-info/key-info-layout-type.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/modules/label/label-type.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/modules/shared/indicator-description-type.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/modules/shared/indicator-icon-type.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/modules/shared/indicator-icon-utility.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/modules/shared/indicator-icon.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/modules/tokens/types/token-selected-event-args.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/modules/tokens/types/token.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/modules/tokens/types/tokens-message-type.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/modules/tokens/types/tokens-message.mjs +0 -0
- /package/{esm2020 → esm2022}/skyux-indicators.mjs +0 -0
- /package/{esm2020 → esm2022}/testing/alert/alert-harness-filters.mjs +0 -0
- /package/{esm2020 → esm2022}/testing/help-inline/help-inline-harness-filters.mjs +0 -0
- /package/{esm2020 → esm2022}/testing/icon/icon-harness-filters.mjs +0 -0
- /package/{esm2020 → esm2022}/testing/key-info/key-info-harness-filters.mjs +0 -0
- /package/{esm2020 → esm2022}/testing/label/label-harness-filters.mjs +0 -0
- /package/{esm2020 → esm2022}/testing/public-api.mjs +0 -0
- /package/{esm2020 → esm2022}/testing/skyux-indicators-testing.mjs +0 -0
- /package/{esm2020 → esm2022}/testing/tokens/token-harness-filters.mjs +0 -0
- /package/{esm2020 → esm2022}/testing/tokens/tokens-harness-filters.mjs +0 -0
- /package/{esm2020 → esm2022}/testing/wait/wait-harness-filters.mjs +0 -0
|
@@ -1,854 +0,0 @@
|
|
|
1
|
-
import { __awaiter, __classPrivateFieldGet, __classPrivateFieldSet } from 'tslib';
|
|
2
|
-
import { SkyComponentHarness } from '@skyux/core/testing';
|
|
3
|
-
import { ComponentHarness, HarnessPredicate } from '@angular/cdk/testing';
|
|
4
|
-
import { By } from '@angular/platform-browser';
|
|
5
|
-
import { SkyAppTestUtility } from '@skyux-sdk/testing';
|
|
6
|
-
|
|
7
|
-
var _SkyAlertHarness_getAlert, _SkyAlertHarness_getContent, _SkyAlertHarness_getCloseButton, _SkyAlertHarness_getScreenReaderTextEl;
|
|
8
|
-
/**
|
|
9
|
-
* Harness for interacting with an alert component in tests.
|
|
10
|
-
*/
|
|
11
|
-
class SkyAlertHarness extends SkyComponentHarness {
|
|
12
|
-
constructor() {
|
|
13
|
-
super(...arguments);
|
|
14
|
-
_SkyAlertHarness_getAlert.set(this, this.locatorFor('.sky-alert'));
|
|
15
|
-
_SkyAlertHarness_getContent.set(this, this.locatorFor('.sky-alert-content'));
|
|
16
|
-
_SkyAlertHarness_getCloseButton.set(this, this.locatorFor('.sky-alert-close'));
|
|
17
|
-
_SkyAlertHarness_getScreenReaderTextEl.set(this, this.locatorForOptional('.sky-screen-reader-only'));
|
|
18
|
-
}
|
|
19
|
-
/**
|
|
20
|
-
* Gets a `HarnessPredicate` that can be used to search for a
|
|
21
|
-
* `SkyAlertHarness` that meets certain criteria.
|
|
22
|
-
*/
|
|
23
|
-
static with(filters) {
|
|
24
|
-
return SkyAlertHarness.getDataSkyIdPredicate(filters);
|
|
25
|
-
}
|
|
26
|
-
/**
|
|
27
|
-
* Gets the current alert type.
|
|
28
|
-
*/
|
|
29
|
-
getAlertType() {
|
|
30
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
31
|
-
const alert = yield __classPrivateFieldGet(this, _SkyAlertHarness_getAlert, "f").call(this);
|
|
32
|
-
if (yield alert.hasClass('sky-alert-danger')) {
|
|
33
|
-
return 'danger';
|
|
34
|
-
}
|
|
35
|
-
if (yield alert.hasClass('sky-alert-info')) {
|
|
36
|
-
return 'info';
|
|
37
|
-
}
|
|
38
|
-
if (yield alert.hasClass('sky-alert-success')) {
|
|
39
|
-
return 'success';
|
|
40
|
-
}
|
|
41
|
-
return 'warning';
|
|
42
|
-
});
|
|
43
|
-
}
|
|
44
|
-
/**
|
|
45
|
-
* Gets the current alert text.
|
|
46
|
-
*/
|
|
47
|
-
getText() {
|
|
48
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
49
|
-
return yield (yield __classPrivateFieldGet(this, _SkyAlertHarness_getContent, "f").call(this)).text();
|
|
50
|
-
});
|
|
51
|
-
}
|
|
52
|
-
/**
|
|
53
|
-
* Closes the alert.
|
|
54
|
-
*/
|
|
55
|
-
close() {
|
|
56
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
57
|
-
if (!(yield this.isCloseable())) {
|
|
58
|
-
throw new Error('The alert is not closeable.');
|
|
59
|
-
}
|
|
60
|
-
(yield __classPrivateFieldGet(this, _SkyAlertHarness_getCloseButton, "f").call(this)).click();
|
|
61
|
-
});
|
|
62
|
-
}
|
|
63
|
-
/**
|
|
64
|
-
* Whether the user closed the alert.
|
|
65
|
-
*/
|
|
66
|
-
isClosed() {
|
|
67
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
68
|
-
const alert = yield __classPrivateFieldGet(this, _SkyAlertHarness_getAlert, "f").call(this);
|
|
69
|
-
return yield alert.getProperty('hidden');
|
|
70
|
-
});
|
|
71
|
-
}
|
|
72
|
-
/**
|
|
73
|
-
* Whether the user can close the alert.
|
|
74
|
-
*/
|
|
75
|
-
isCloseable() {
|
|
76
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
77
|
-
const closeBtn = yield __classPrivateFieldGet(this, _SkyAlertHarness_getCloseButton, "f").call(this);
|
|
78
|
-
return !(yield closeBtn.getProperty('hidden'));
|
|
79
|
-
});
|
|
80
|
-
}
|
|
81
|
-
/**
|
|
82
|
-
* Gets the `descriptionType` of the label component.
|
|
83
|
-
*/
|
|
84
|
-
getDescriptionType() {
|
|
85
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
86
|
-
const srEl = yield __classPrivateFieldGet(this, _SkyAlertHarness_getScreenReaderTextEl, "f").call(this);
|
|
87
|
-
if (!srEl) {
|
|
88
|
-
return 'none';
|
|
89
|
-
}
|
|
90
|
-
const srText = yield srEl.text();
|
|
91
|
-
switch (srText) {
|
|
92
|
-
case 'Attention:':
|
|
93
|
-
return 'attention';
|
|
94
|
-
case 'Caution:':
|
|
95
|
-
return 'caution';
|
|
96
|
-
case 'Completed:':
|
|
97
|
-
return 'completed';
|
|
98
|
-
case 'Danger:':
|
|
99
|
-
return 'danger';
|
|
100
|
-
case 'Error:':
|
|
101
|
-
return 'error';
|
|
102
|
-
case 'Important information:':
|
|
103
|
-
return 'important-info';
|
|
104
|
-
case 'Important warning:':
|
|
105
|
-
return 'important-warning';
|
|
106
|
-
case 'Success:':
|
|
107
|
-
return 'success';
|
|
108
|
-
case 'Warning:':
|
|
109
|
-
return 'warning';
|
|
110
|
-
default:
|
|
111
|
-
return 'custom';
|
|
112
|
-
}
|
|
113
|
-
});
|
|
114
|
-
}
|
|
115
|
-
/**
|
|
116
|
-
* Gets the custom text used for the screen reader description of the label component icon.
|
|
117
|
-
*/
|
|
118
|
-
getCustomDescription() {
|
|
119
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
120
|
-
const descriptionType = yield this.getDescriptionType();
|
|
121
|
-
if (descriptionType === 'custom') {
|
|
122
|
-
const srEl = yield __classPrivateFieldGet(this, _SkyAlertHarness_getScreenReaderTextEl, "f").call(this);
|
|
123
|
-
if (srEl) {
|
|
124
|
-
return yield srEl.text();
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
return '';
|
|
128
|
-
});
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
_SkyAlertHarness_getAlert = new WeakMap(), _SkyAlertHarness_getContent = new WeakMap(), _SkyAlertHarness_getCloseButton = new WeakMap(), _SkyAlertHarness_getScreenReaderTextEl = new WeakMap();
|
|
132
|
-
/**
|
|
133
|
-
* @internal
|
|
134
|
-
*/
|
|
135
|
-
SkyAlertHarness.hostSelector = 'sky-alert';
|
|
136
|
-
|
|
137
|
-
var _SkyChevronHarness_getButton;
|
|
138
|
-
/**
|
|
139
|
-
* Harness for interacting with a chevron component in tests.
|
|
140
|
-
*/
|
|
141
|
-
class SkyChevronHarness extends SkyComponentHarness {
|
|
142
|
-
constructor() {
|
|
143
|
-
super(...arguments);
|
|
144
|
-
_SkyChevronHarness_getButton.set(this, this.locatorFor('button.sky-chevron'));
|
|
145
|
-
}
|
|
146
|
-
/**
|
|
147
|
-
* Gets the chevron direction.
|
|
148
|
-
*/
|
|
149
|
-
getDirection() {
|
|
150
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
151
|
-
return (yield (yield __classPrivateFieldGet(this, _SkyChevronHarness_getButton, "f").call(this)).hasClass('sky-chevron-up'))
|
|
152
|
-
? 'up'
|
|
153
|
-
: 'down';
|
|
154
|
-
});
|
|
155
|
-
}
|
|
156
|
-
/**
|
|
157
|
-
* Whether the chevron is disabled.
|
|
158
|
-
*/
|
|
159
|
-
isDisabled() {
|
|
160
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
161
|
-
const disabled = yield (yield __classPrivateFieldGet(this, _SkyChevronHarness_getButton, "f").call(this)).getAttribute('disabled');
|
|
162
|
-
return disabled !== null;
|
|
163
|
-
});
|
|
164
|
-
}
|
|
165
|
-
/**
|
|
166
|
-
* Toggles the chevron.
|
|
167
|
-
*/
|
|
168
|
-
toggle() {
|
|
169
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
170
|
-
if (yield this.isDisabled()) {
|
|
171
|
-
throw new Error('Could not toggle the checkbox because it is disabled.');
|
|
172
|
-
}
|
|
173
|
-
else {
|
|
174
|
-
yield (yield __classPrivateFieldGet(this, _SkyChevronHarness_getButton, "f").call(this)).click();
|
|
175
|
-
}
|
|
176
|
-
});
|
|
177
|
-
}
|
|
178
|
-
}
|
|
179
|
-
_SkyChevronHarness_getButton = new WeakMap();
|
|
180
|
-
/**
|
|
181
|
-
* @internal
|
|
182
|
-
*/
|
|
183
|
-
SkyChevronHarness.hostSelector = 'sky-chevron';
|
|
184
|
-
|
|
185
|
-
var _SkyHelpInlineHarness_getInlineHelpButton;
|
|
186
|
-
/**
|
|
187
|
-
* Harness for interacting with a help inline component in tests.
|
|
188
|
-
*/
|
|
189
|
-
class SkyHelpInlineHarness extends SkyComponentHarness {
|
|
190
|
-
constructor() {
|
|
191
|
-
super(...arguments);
|
|
192
|
-
_SkyHelpInlineHarness_getInlineHelpButton.set(this, this.locatorFor('.sky-help-inline'));
|
|
193
|
-
}
|
|
194
|
-
/**
|
|
195
|
-
* Gets a `HarnessPredicate` that can be used to search for a
|
|
196
|
-
* `SkyInlineHelpHarness` that meets certain criteria
|
|
197
|
-
*/
|
|
198
|
-
static with(filters) {
|
|
199
|
-
return SkyHelpInlineHarness.getDataSkyIdPredicate(filters);
|
|
200
|
-
}
|
|
201
|
-
/**
|
|
202
|
-
* Clicks the help inline icon button
|
|
203
|
-
*/
|
|
204
|
-
click() {
|
|
205
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
206
|
-
yield (yield __classPrivateFieldGet(this, _SkyHelpInlineHarness_getInlineHelpButton, "f").call(this)).click();
|
|
207
|
-
});
|
|
208
|
-
}
|
|
209
|
-
}
|
|
210
|
-
_SkyHelpInlineHarness_getInlineHelpButton = new WeakMap();
|
|
211
|
-
/**
|
|
212
|
-
* @internal
|
|
213
|
-
*/
|
|
214
|
-
SkyHelpInlineHarness.hostSelector = 'sky-help-inline';
|
|
215
|
-
|
|
216
|
-
var _SkyIconHarness_instances, _SkyIconHarness_getIcon, _SkyIconHarness_getIconClasses, _SkyIconHarness_getSpecifiedIconInfo;
|
|
217
|
-
/**
|
|
218
|
-
* Harness for interacting with an icon component in tests.
|
|
219
|
-
*/
|
|
220
|
-
class SkyIconHarness extends SkyComponentHarness {
|
|
221
|
-
constructor() {
|
|
222
|
-
super(...arguments);
|
|
223
|
-
_SkyIconHarness_instances.add(this);
|
|
224
|
-
}
|
|
225
|
-
/**
|
|
226
|
-
* Gets a `HarnessPredicate` that can be used to search for a
|
|
227
|
-
* `SkyIconHarness` that meets certain criteria.
|
|
228
|
-
*/
|
|
229
|
-
static with(filters) {
|
|
230
|
-
return SkyIconHarness.getDataSkyIdPredicate(filters);
|
|
231
|
-
}
|
|
232
|
-
/**
|
|
233
|
-
* Gets the icon name.
|
|
234
|
-
*/
|
|
235
|
-
getIconName() {
|
|
236
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
237
|
-
// No need to check for null here since #getIcon() will throw an error when
|
|
238
|
-
// icon name is null.
|
|
239
|
-
return (yield __classPrivateFieldGet(this, _SkyIconHarness_instances, "m", _SkyIconHarness_getSpecifiedIconInfo).call(this)).icon;
|
|
240
|
-
});
|
|
241
|
-
}
|
|
242
|
-
/**
|
|
243
|
-
* Gets the icon size.
|
|
244
|
-
*/
|
|
245
|
-
getIconSize() {
|
|
246
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
247
|
-
const iconClasses = yield __classPrivateFieldGet(this, _SkyIconHarness_instances, "m", _SkyIconHarness_getIconClasses).call(this);
|
|
248
|
-
for (const iconClass of iconClasses) {
|
|
249
|
-
// match a class name that starts with `fa-` and follows with `lg`, `2x`, `3x`, `4x`, `5x`
|
|
250
|
-
if (/^fa-(?=2xs|lg|[2-5]+x)/.test(iconClass)) {
|
|
251
|
-
return iconClass.replace('fa-', '');
|
|
252
|
-
}
|
|
253
|
-
}
|
|
254
|
-
return undefined;
|
|
255
|
-
});
|
|
256
|
-
}
|
|
257
|
-
/**
|
|
258
|
-
* Gets the icon type.
|
|
259
|
-
*/
|
|
260
|
-
getIconType() {
|
|
261
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
262
|
-
return (yield __classPrivateFieldGet(this, _SkyIconHarness_instances, "m", _SkyIconHarness_getSpecifiedIconInfo).call(this)).iconType || 'fa';
|
|
263
|
-
});
|
|
264
|
-
}
|
|
265
|
-
/**
|
|
266
|
-
* Gets if the icon is a variant.
|
|
267
|
-
*/
|
|
268
|
-
getVariant() {
|
|
269
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
270
|
-
const iconInfo = yield __classPrivateFieldGet(this, _SkyIconHarness_instances, "m", _SkyIconHarness_getSpecifiedIconInfo).call(this);
|
|
271
|
-
if (iconInfo.iconType === 'skyux') {
|
|
272
|
-
return iconInfo.variant || 'line';
|
|
273
|
-
}
|
|
274
|
-
throw new Error('Variant cannot be determined because variants are only assigned to icons with type `skyux`.');
|
|
275
|
-
});
|
|
276
|
-
}
|
|
277
|
-
/**
|
|
278
|
-
* Whether the icon has fixed width.
|
|
279
|
-
*/
|
|
280
|
-
isFixedWidth() {
|
|
281
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
282
|
-
const icon = yield __classPrivateFieldGet(this, _SkyIconHarness_instances, "m", _SkyIconHarness_getIcon).call(this);
|
|
283
|
-
return icon.hasClass(`fa-fw`);
|
|
284
|
-
});
|
|
285
|
-
}
|
|
286
|
-
}
|
|
287
|
-
_SkyIconHarness_instances = new WeakSet(), _SkyIconHarness_getIcon = function _SkyIconHarness_getIcon() {
|
|
288
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
289
|
-
const icon = yield this.locatorForOptional('.sky-icon')();
|
|
290
|
-
if (icon) {
|
|
291
|
-
return icon;
|
|
292
|
-
}
|
|
293
|
-
throw new Error('Icon could not be rendered.');
|
|
294
|
-
});
|
|
295
|
-
}, _SkyIconHarness_getIconClasses = function _SkyIconHarness_getIconClasses() {
|
|
296
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
297
|
-
const iconClasses = yield (yield __classPrivateFieldGet(this, _SkyIconHarness_instances, "m", _SkyIconHarness_getIcon).call(this)).getProperty('classList');
|
|
298
|
-
return Array.from(iconClasses);
|
|
299
|
-
});
|
|
300
|
-
}, _SkyIconHarness_getSpecifiedIconInfo = function _SkyIconHarness_getSpecifiedIconInfo() {
|
|
301
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
302
|
-
// Since SKY UX icons have Font Awesome alternatives that may be used
|
|
303
|
-
// in default theme instead of the icon specified by the consumer, we
|
|
304
|
-
// need to get the specified values using data- attributes added by
|
|
305
|
-
// the icon component. This conflicts with the usual pattern of giving
|
|
306
|
-
// the effective state of the component but is necessary in this case.
|
|
307
|
-
const icon = yield __classPrivateFieldGet(this, _SkyIconHarness_instances, "m", _SkyIconHarness_getIcon).call(this);
|
|
308
|
-
return {
|
|
309
|
-
icon: yield icon.getAttribute('data-sky-icon'),
|
|
310
|
-
iconType: yield icon.getAttribute('data-sky-icon-type'),
|
|
311
|
-
variant: yield icon.getAttribute('data-sky-icon-variant'),
|
|
312
|
-
};
|
|
313
|
-
});
|
|
314
|
-
};
|
|
315
|
-
/**
|
|
316
|
-
* @internal
|
|
317
|
-
*/
|
|
318
|
-
SkyIconHarness.hostSelector = 'sky-icon';
|
|
319
|
-
|
|
320
|
-
/**
|
|
321
|
-
* Harness for interacting with a key info label component in tests.
|
|
322
|
-
* @internal
|
|
323
|
-
*/
|
|
324
|
-
class SkyKeyInfoLabelHarness extends SkyComponentHarness {
|
|
325
|
-
/**
|
|
326
|
-
* Gets the text value of the component content.
|
|
327
|
-
*/
|
|
328
|
-
getText() {
|
|
329
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
330
|
-
return (yield this.host()).text();
|
|
331
|
-
});
|
|
332
|
-
}
|
|
333
|
-
}
|
|
334
|
-
/**
|
|
335
|
-
* @internal
|
|
336
|
-
*/
|
|
337
|
-
SkyKeyInfoLabelHarness.hostSelector = 'sky-key-info-label';
|
|
338
|
-
|
|
339
|
-
/**
|
|
340
|
-
* Harness for interacting with a key info value component in tests.
|
|
341
|
-
* @internal
|
|
342
|
-
*/
|
|
343
|
-
class SkyKeyInfoValueHarness extends SkyComponentHarness {
|
|
344
|
-
/**
|
|
345
|
-
* Gets the text value of the component content.
|
|
346
|
-
*/
|
|
347
|
-
getText() {
|
|
348
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
349
|
-
return (yield this.host()).text();
|
|
350
|
-
});
|
|
351
|
-
}
|
|
352
|
-
}
|
|
353
|
-
/**
|
|
354
|
-
* @internal
|
|
355
|
-
*/
|
|
356
|
-
SkyKeyInfoValueHarness.hostSelector = 'sky-key-info-value';
|
|
357
|
-
|
|
358
|
-
var _SkyKeyInfoHarness_getLabel, _SkyKeyInfoHarness_getValue, _SkyKeyInfoHarness_getWrapper;
|
|
359
|
-
/**
|
|
360
|
-
* Harness for interacting with a key info component in tests.
|
|
361
|
-
*/
|
|
362
|
-
class SkyKeyInfoHarness extends SkyComponentHarness {
|
|
363
|
-
constructor() {
|
|
364
|
-
super(...arguments);
|
|
365
|
-
_SkyKeyInfoHarness_getLabel.set(this, this.locatorFor(SkyKeyInfoLabelHarness));
|
|
366
|
-
_SkyKeyInfoHarness_getValue.set(this, this.locatorFor(SkyKeyInfoValueHarness));
|
|
367
|
-
_SkyKeyInfoHarness_getWrapper.set(this, this.locatorFor('.sky-key-info'));
|
|
368
|
-
}
|
|
369
|
-
/**
|
|
370
|
-
* Gets a `HarnessPredicate` that can be used to search for a
|
|
371
|
-
* `SkyKeyInfoHarness` that meets certain criteria.
|
|
372
|
-
*/
|
|
373
|
-
static with(filters) {
|
|
374
|
-
return SkyKeyInfoHarness.getDataSkyIdPredicate(filters);
|
|
375
|
-
}
|
|
376
|
-
/**
|
|
377
|
-
* Gets the current value text.
|
|
378
|
-
*/
|
|
379
|
-
getValueText() {
|
|
380
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
381
|
-
return yield (yield __classPrivateFieldGet(this, _SkyKeyInfoHarness_getValue, "f").call(this)).getText();
|
|
382
|
-
});
|
|
383
|
-
}
|
|
384
|
-
/**
|
|
385
|
-
* Gets the current label text.
|
|
386
|
-
*/
|
|
387
|
-
getLabelText() {
|
|
388
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
389
|
-
return yield (yield __classPrivateFieldGet(this, _SkyKeyInfoHarness_getLabel, "f").call(this)).getText();
|
|
390
|
-
});
|
|
391
|
-
}
|
|
392
|
-
/**
|
|
393
|
-
* Gets the current layout type.
|
|
394
|
-
*/
|
|
395
|
-
getLayout() {
|
|
396
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
397
|
-
return (yield (yield __classPrivateFieldGet(this, _SkyKeyInfoHarness_getWrapper, "f").call(this)).hasClass('sky-key-info-horizontal'))
|
|
398
|
-
? 'horizontal'
|
|
399
|
-
: 'vertical';
|
|
400
|
-
});
|
|
401
|
-
}
|
|
402
|
-
}
|
|
403
|
-
_SkyKeyInfoHarness_getLabel = new WeakMap(), _SkyKeyInfoHarness_getValue = new WeakMap(), _SkyKeyInfoHarness_getWrapper = new WeakMap();
|
|
404
|
-
/**
|
|
405
|
-
* @internal
|
|
406
|
-
*/
|
|
407
|
-
SkyKeyInfoHarness.hostSelector = 'sky-key-info';
|
|
408
|
-
|
|
409
|
-
var _SkyLabelHarness_getWrapper, _SkyLabelHarness_getTextEl, _SkyLabelHarness_getScreenReaderTextEl;
|
|
410
|
-
/**
|
|
411
|
-
* Harness for interacting with a label component in tests.
|
|
412
|
-
*/
|
|
413
|
-
class SkyLabelHarness extends SkyComponentHarness {
|
|
414
|
-
constructor() {
|
|
415
|
-
super(...arguments);
|
|
416
|
-
_SkyLabelHarness_getWrapper.set(this, this.locatorFor('.sky-label'));
|
|
417
|
-
_SkyLabelHarness_getTextEl.set(this, this.locatorFor('.sky-label-text'));
|
|
418
|
-
_SkyLabelHarness_getScreenReaderTextEl.set(this, this.locatorForOptional('.sky-screen-reader-only'));
|
|
419
|
-
}
|
|
420
|
-
/**
|
|
421
|
-
* Gets a `HarnessPredicate` that can be used to search for a
|
|
422
|
-
* `SkyLookupHarness` that meets certain criteria.
|
|
423
|
-
*/
|
|
424
|
-
static with(filters) {
|
|
425
|
-
return SkyLabelHarness.getDataSkyIdPredicate(filters);
|
|
426
|
-
}
|
|
427
|
-
/**
|
|
428
|
-
* Gets the text of the label component.
|
|
429
|
-
*/
|
|
430
|
-
getLabelText() {
|
|
431
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
432
|
-
return yield (yield __classPrivateFieldGet(this, _SkyLabelHarness_getTextEl, "f").call(this)).text();
|
|
433
|
-
});
|
|
434
|
-
}
|
|
435
|
-
/**
|
|
436
|
-
* Gets the `labelType` of the label component.
|
|
437
|
-
*/
|
|
438
|
-
getLabelType() {
|
|
439
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
440
|
-
const labelClasses = yield (yield __classPrivateFieldGet(this, _SkyLabelHarness_getWrapper, "f").call(this)).getProperty('classList');
|
|
441
|
-
if (labelClasses.contains('sky-label-success')) {
|
|
442
|
-
return 'success';
|
|
443
|
-
}
|
|
444
|
-
if (labelClasses.contains('sky-label-danger')) {
|
|
445
|
-
return 'danger';
|
|
446
|
-
}
|
|
447
|
-
if (labelClasses.contains('sky-label-warning')) {
|
|
448
|
-
return 'warning';
|
|
449
|
-
}
|
|
450
|
-
return 'info';
|
|
451
|
-
});
|
|
452
|
-
}
|
|
453
|
-
/**
|
|
454
|
-
* Gets the `descriptionType` of the label component.
|
|
455
|
-
*/
|
|
456
|
-
getDescriptionType() {
|
|
457
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
458
|
-
const srEl = yield __classPrivateFieldGet(this, _SkyLabelHarness_getScreenReaderTextEl, "f").call(this);
|
|
459
|
-
if (!srEl) {
|
|
460
|
-
return 'none';
|
|
461
|
-
}
|
|
462
|
-
const srText = yield srEl.text();
|
|
463
|
-
switch (srText) {
|
|
464
|
-
case 'Attention:':
|
|
465
|
-
return 'attention';
|
|
466
|
-
case 'Caution:':
|
|
467
|
-
return 'caution';
|
|
468
|
-
case 'Completed:':
|
|
469
|
-
return 'completed';
|
|
470
|
-
case 'Danger:':
|
|
471
|
-
return 'danger';
|
|
472
|
-
case 'Error:':
|
|
473
|
-
return 'error';
|
|
474
|
-
case 'Important information:':
|
|
475
|
-
return 'important-info';
|
|
476
|
-
case 'Important warning:':
|
|
477
|
-
return 'important-warning';
|
|
478
|
-
case 'Success:':
|
|
479
|
-
return 'success';
|
|
480
|
-
case 'Warning:':
|
|
481
|
-
return 'warning';
|
|
482
|
-
default:
|
|
483
|
-
return 'custom';
|
|
484
|
-
}
|
|
485
|
-
});
|
|
486
|
-
}
|
|
487
|
-
/**
|
|
488
|
-
* Gets the custom text used for the screen reader description of the label component icon.
|
|
489
|
-
*/
|
|
490
|
-
getCustomDescription() {
|
|
491
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
492
|
-
const descriptionType = yield this.getDescriptionType();
|
|
493
|
-
if (descriptionType === 'custom') {
|
|
494
|
-
const srEl = yield __classPrivateFieldGet(this, _SkyLabelHarness_getScreenReaderTextEl, "f").call(this);
|
|
495
|
-
if (srEl) {
|
|
496
|
-
return yield srEl.text();
|
|
497
|
-
}
|
|
498
|
-
}
|
|
499
|
-
return '';
|
|
500
|
-
});
|
|
501
|
-
}
|
|
502
|
-
}
|
|
503
|
-
_SkyLabelHarness_getWrapper = new WeakMap(), _SkyLabelHarness_getTextEl = new WeakMap(), _SkyLabelHarness_getScreenReaderTextEl = new WeakMap();
|
|
504
|
-
/**
|
|
505
|
-
* @internal
|
|
506
|
-
*/
|
|
507
|
-
SkyLabelHarness.hostSelector = 'sky-label';
|
|
508
|
-
|
|
509
|
-
var _SkyTokenHarness_getActionButton, _SkyTokenHarness_getDismissButton, _SkyTokenHarness_getWrapper;
|
|
510
|
-
/**
|
|
511
|
-
* Harness for interacting with a token component in tests.
|
|
512
|
-
*/
|
|
513
|
-
class SkyTokenHarness extends ComponentHarness {
|
|
514
|
-
constructor() {
|
|
515
|
-
super(...arguments);
|
|
516
|
-
_SkyTokenHarness_getActionButton.set(this, this.locatorFor('button.sky-token-btn-action'));
|
|
517
|
-
_SkyTokenHarness_getDismissButton.set(this, this.locatorFor('button.sky-token-btn-close'));
|
|
518
|
-
_SkyTokenHarness_getWrapper.set(this, this.locatorFor('.sky-token'));
|
|
519
|
-
}
|
|
520
|
-
/**
|
|
521
|
-
* Gets a `HarnessPredicate` that can be used to search for a
|
|
522
|
-
* `SkyTokenHarness` that meets certain criteria.
|
|
523
|
-
*/
|
|
524
|
-
static with(filters) {
|
|
525
|
-
return new HarnessPredicate(this, filters).addOption('text', filters.text, (harness, test) => __awaiter(this, void 0, void 0, function* () { return HarnessPredicate.stringMatches(yield (yield harness.host()).text(), test); }));
|
|
526
|
-
}
|
|
527
|
-
/**
|
|
528
|
-
* Selects the token.
|
|
529
|
-
*/
|
|
530
|
-
select() {
|
|
531
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
532
|
-
if (yield this.isDisabled()) {
|
|
533
|
-
throw new Error('Could not select the token because it is disabled.');
|
|
534
|
-
}
|
|
535
|
-
yield (yield this.host()).click();
|
|
536
|
-
});
|
|
537
|
-
}
|
|
538
|
-
/**
|
|
539
|
-
* Dismisses the token.
|
|
540
|
-
*/
|
|
541
|
-
dismiss() {
|
|
542
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
543
|
-
if (!(yield this.isDismissible())) {
|
|
544
|
-
throw new Error('Could not dismiss the token because it is not dismissible.');
|
|
545
|
-
}
|
|
546
|
-
yield (yield __classPrivateFieldGet(this, _SkyTokenHarness_getDismissButton, "f").call(this)).click();
|
|
547
|
-
});
|
|
548
|
-
}
|
|
549
|
-
/**
|
|
550
|
-
* Returns the text content of the token.
|
|
551
|
-
*/
|
|
552
|
-
getText() {
|
|
553
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
554
|
-
return (yield this.host()).text();
|
|
555
|
-
});
|
|
556
|
-
}
|
|
557
|
-
/**
|
|
558
|
-
* Whether the token is disabled.
|
|
559
|
-
*/
|
|
560
|
-
isDisabled() {
|
|
561
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
562
|
-
return (yield __classPrivateFieldGet(this, _SkyTokenHarness_getWrapper, "f").call(this)).hasClass('sky-token-disabled');
|
|
563
|
-
});
|
|
564
|
-
}
|
|
565
|
-
/**
|
|
566
|
-
* Whether the token is dismissible.
|
|
567
|
-
*/
|
|
568
|
-
isDismissible() {
|
|
569
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
570
|
-
return (yield __classPrivateFieldGet(this, _SkyTokenHarness_getWrapper, "f").call(this)).hasClass('sky-token-dismissible');
|
|
571
|
-
});
|
|
572
|
-
}
|
|
573
|
-
/**
|
|
574
|
-
* Whether the token is focused.
|
|
575
|
-
*/
|
|
576
|
-
isFocused() {
|
|
577
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
578
|
-
return (yield __classPrivateFieldGet(this, _SkyTokenHarness_getActionButton, "f").call(this)).isFocused();
|
|
579
|
-
});
|
|
580
|
-
}
|
|
581
|
-
}
|
|
582
|
-
_SkyTokenHarness_getActionButton = new WeakMap(), _SkyTokenHarness_getDismissButton = new WeakMap(), _SkyTokenHarness_getWrapper = new WeakMap();
|
|
583
|
-
/**
|
|
584
|
-
* @internal
|
|
585
|
-
*/
|
|
586
|
-
SkyTokenHarness.hostSelector = 'sky-token';
|
|
587
|
-
|
|
588
|
-
/**
|
|
589
|
-
* Harness for interacting with a tokens component in tests.
|
|
590
|
-
*/
|
|
591
|
-
class SkyTokensHarness extends SkyComponentHarness {
|
|
592
|
-
/**
|
|
593
|
-
* Gets a `HarnessPredicate` that can be used to search for a
|
|
594
|
-
* `SkyTokensHarness` that meets certain criteria.
|
|
595
|
-
*/
|
|
596
|
-
static with(filters) {
|
|
597
|
-
return SkyTokensHarness.getDataSkyIdPredicate(filters);
|
|
598
|
-
}
|
|
599
|
-
/**
|
|
600
|
-
* Dismisses all tokens, or tokens that meet certain criteria.
|
|
601
|
-
*/
|
|
602
|
-
dismissTokens(filters) {
|
|
603
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
604
|
-
const tokens = yield this.getTokens(filters);
|
|
605
|
-
for (const token of tokens) {
|
|
606
|
-
yield token.dismiss();
|
|
607
|
-
}
|
|
608
|
-
});
|
|
609
|
-
}
|
|
610
|
-
/**
|
|
611
|
-
* Returns a list of tokens.
|
|
612
|
-
*/
|
|
613
|
-
getTokens(filters) {
|
|
614
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
615
|
-
return this.locatorForAll(SkyTokenHarness.with(filters || {}))();
|
|
616
|
-
});
|
|
617
|
-
}
|
|
618
|
-
/**
|
|
619
|
-
* Returns the text content of all tokens.
|
|
620
|
-
*/
|
|
621
|
-
getTokensText() {
|
|
622
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
623
|
-
const tokens = yield this.getTokens();
|
|
624
|
-
const values = [];
|
|
625
|
-
for (const token of tokens) {
|
|
626
|
-
values.push(yield token.getText());
|
|
627
|
-
}
|
|
628
|
-
return values;
|
|
629
|
-
});
|
|
630
|
-
}
|
|
631
|
-
}
|
|
632
|
-
/**
|
|
633
|
-
* @internal
|
|
634
|
-
*/
|
|
635
|
-
SkyTokensHarness.hostSelector = 'sky-tokens';
|
|
636
|
-
|
|
637
|
-
var _SkyWaitHarness_getWaitMask, _SkyWaitHarness_getWaitContainer;
|
|
638
|
-
/**
|
|
639
|
-
* Harness for interacting with a wait component in tests.
|
|
640
|
-
*/
|
|
641
|
-
class SkyWaitHarness extends SkyComponentHarness {
|
|
642
|
-
constructor() {
|
|
643
|
-
super(...arguments);
|
|
644
|
-
_SkyWaitHarness_getWaitMask.set(this, this.locatorForOptional('.sky-wait-mask'));
|
|
645
|
-
_SkyWaitHarness_getWaitContainer.set(this, this.locatorFor('.sky-wait-container'));
|
|
646
|
-
}
|
|
647
|
-
/**
|
|
648
|
-
* Gets a `HarnessPredicate` that can be used to search for a
|
|
649
|
-
* `SkyWaitHarness` that meets certain criteria.
|
|
650
|
-
*/
|
|
651
|
-
static with(filters) {
|
|
652
|
-
if (filters.servicePageWaitType === 'blocking') {
|
|
653
|
-
return SkyWaitHarness.getDataSkyIdPredicate({
|
|
654
|
-
dataSkyId: 'page-wait-blocking',
|
|
655
|
-
});
|
|
656
|
-
}
|
|
657
|
-
else if (filters.servicePageWaitType === 'non-blocking') {
|
|
658
|
-
return SkyWaitHarness.getDataSkyIdPredicate({
|
|
659
|
-
dataSkyId: 'page-wait-non-blocking',
|
|
660
|
-
});
|
|
661
|
-
}
|
|
662
|
-
return SkyWaitHarness.getDataSkyIdPredicate(filters);
|
|
663
|
-
}
|
|
664
|
-
/**
|
|
665
|
-
* Gets the ARIA label for the wait component or throws an error if not waiting.
|
|
666
|
-
*/
|
|
667
|
-
getAriaLabel() {
|
|
668
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
669
|
-
const waitMask = yield __classPrivateFieldGet(this, _SkyWaitHarness_getWaitMask, "f").call(this);
|
|
670
|
-
if (waitMask) {
|
|
671
|
-
return ((yield waitMask.getAttribute('aria-label')) ||
|
|
672
|
-
/* istanbul ignore next */
|
|
673
|
-
'');
|
|
674
|
-
}
|
|
675
|
-
throw new Error('An ARIA label cannot be determined because the wait component is not visible.');
|
|
676
|
-
});
|
|
677
|
-
}
|
|
678
|
-
/**
|
|
679
|
-
* Gets the waiting state of the wait component.
|
|
680
|
-
*/
|
|
681
|
-
isWaiting() {
|
|
682
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
683
|
-
return !!(yield __classPrivateFieldGet(this, _SkyWaitHarness_getWaitMask, "f").call(this));
|
|
684
|
-
});
|
|
685
|
-
}
|
|
686
|
-
/**
|
|
687
|
-
* Gets the full page state of the wait component.
|
|
688
|
-
*/
|
|
689
|
-
isFullPage() {
|
|
690
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
691
|
-
return (yield __classPrivateFieldGet(this, _SkyWaitHarness_getWaitContainer, "f").call(this)).hasClass('sky-wait-full-page');
|
|
692
|
-
});
|
|
693
|
-
}
|
|
694
|
-
/**
|
|
695
|
-
* Gets the blocking state of the wait component.
|
|
696
|
-
*/
|
|
697
|
-
isNonBlocking() {
|
|
698
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
699
|
-
return (yield __classPrivateFieldGet(this, _SkyWaitHarness_getWaitContainer, "f").call(this)).hasClass('sky-wait-non-blocking');
|
|
700
|
-
});
|
|
701
|
-
}
|
|
702
|
-
}
|
|
703
|
-
_SkyWaitHarness_getWaitMask = new WeakMap(), _SkyWaitHarness_getWaitContainer = new WeakMap();
|
|
704
|
-
/**
|
|
705
|
-
* @internal
|
|
706
|
-
*/
|
|
707
|
-
SkyWaitHarness.hostSelector = 'sky-wait';
|
|
708
|
-
|
|
709
|
-
var _SkyAlertFixture_instances, _SkyAlertFixture_debugEl, _SkyAlertFixture_getAlertEl, _SkyAlertFixture_getCloseBtnEl;
|
|
710
|
-
/**
|
|
711
|
-
* Allows interaction with a SKY UX alert component.
|
|
712
|
-
* @deprecated Use `SkyAlertHarness` instead.
|
|
713
|
-
* @internal
|
|
714
|
-
*/
|
|
715
|
-
class SkyAlertFixture {
|
|
716
|
-
/**
|
|
717
|
-
* The alert's current text.
|
|
718
|
-
*/
|
|
719
|
-
get text() {
|
|
720
|
-
return SkyAppTestUtility.getText(__classPrivateFieldGet(this, _SkyAlertFixture_debugEl, "f"));
|
|
721
|
-
}
|
|
722
|
-
/**
|
|
723
|
-
* A flag indicating whether the alert can be closed.
|
|
724
|
-
*/
|
|
725
|
-
get closeable() {
|
|
726
|
-
const closeBtnEl = __classPrivateFieldGet(this, _SkyAlertFixture_instances, "m", _SkyAlertFixture_getCloseBtnEl).call(this);
|
|
727
|
-
return SkyAppTestUtility.isVisible(closeBtnEl);
|
|
728
|
-
}
|
|
729
|
-
/**
|
|
730
|
-
* Returns a flag indicating whether the alert is closed.
|
|
731
|
-
*/
|
|
732
|
-
get closed() {
|
|
733
|
-
return !SkyAppTestUtility.isVisible(__classPrivateFieldGet(this, _SkyAlertFixture_instances, "m", _SkyAlertFixture_getAlertEl).call(this));
|
|
734
|
-
}
|
|
735
|
-
/**
|
|
736
|
-
* The alert's current type.
|
|
737
|
-
*/
|
|
738
|
-
get alertType() {
|
|
739
|
-
const clsList = __classPrivateFieldGet(this, _SkyAlertFixture_instances, "m", _SkyAlertFixture_getAlertEl).call(this).nativeElement.classList;
|
|
740
|
-
if (clsList.contains('sky-alert-danger')) {
|
|
741
|
-
return 'danger';
|
|
742
|
-
}
|
|
743
|
-
if (clsList.contains('sky-alert-info')) {
|
|
744
|
-
return 'info';
|
|
745
|
-
}
|
|
746
|
-
if (clsList.contains('sky-alert-success')) {
|
|
747
|
-
return 'success';
|
|
748
|
-
}
|
|
749
|
-
if (clsList.contains('sky-alert-warning')) {
|
|
750
|
-
return 'warning';
|
|
751
|
-
}
|
|
752
|
-
return undefined;
|
|
753
|
-
}
|
|
754
|
-
constructor(fixture, skyTestId) {
|
|
755
|
-
_SkyAlertFixture_instances.add(this);
|
|
756
|
-
_SkyAlertFixture_debugEl.set(this, void 0);
|
|
757
|
-
__classPrivateFieldSet(this, _SkyAlertFixture_debugEl, SkyAppTestUtility.getDebugElementByTestId(fixture, skyTestId, 'sky-alert'), "f");
|
|
758
|
-
}
|
|
759
|
-
/**
|
|
760
|
-
* Closes the alert. If the alert is not closeable, an error is thrown.
|
|
761
|
-
*/
|
|
762
|
-
close() {
|
|
763
|
-
if (this.closeable) {
|
|
764
|
-
const closeBtnEl = __classPrivateFieldGet(this, _SkyAlertFixture_instances, "m", _SkyAlertFixture_getCloseBtnEl).call(this);
|
|
765
|
-
closeBtnEl.triggerEventHandler('click', {});
|
|
766
|
-
}
|
|
767
|
-
else {
|
|
768
|
-
throw new Error('The alert is not closeable.');
|
|
769
|
-
}
|
|
770
|
-
}
|
|
771
|
-
}
|
|
772
|
-
_SkyAlertFixture_debugEl = new WeakMap(), _SkyAlertFixture_instances = new WeakSet(), _SkyAlertFixture_getAlertEl = function _SkyAlertFixture_getAlertEl() {
|
|
773
|
-
return __classPrivateFieldGet(this, _SkyAlertFixture_debugEl, "f").query(By.css('.sky-alert'));
|
|
774
|
-
}, _SkyAlertFixture_getCloseBtnEl = function _SkyAlertFixture_getCloseBtnEl() {
|
|
775
|
-
return __classPrivateFieldGet(this, _SkyAlertFixture_debugEl, "f").query(By.css('.sky-alert-close'));
|
|
776
|
-
};
|
|
777
|
-
|
|
778
|
-
var _SkyLabelFixture_instances, _SkyLabelFixture_debugEl, _SkyLabelFixture_getLabelEl;
|
|
779
|
-
/**
|
|
780
|
-
* Allows interaction with a SKY UX label component.
|
|
781
|
-
* @internal
|
|
782
|
-
*/
|
|
783
|
-
class SkyLabelFixture {
|
|
784
|
-
/**
|
|
785
|
-
* The label's current type.
|
|
786
|
-
*/
|
|
787
|
-
get labelType() {
|
|
788
|
-
const clsList = __classPrivateFieldGet(this, _SkyLabelFixture_instances, "m", _SkyLabelFixture_getLabelEl).call(this).nativeElement.classList;
|
|
789
|
-
if (clsList.contains('sky-label-danger')) {
|
|
790
|
-
return 'danger';
|
|
791
|
-
}
|
|
792
|
-
if (clsList.contains('sky-label-info')) {
|
|
793
|
-
return 'info';
|
|
794
|
-
}
|
|
795
|
-
if (clsList.contains('sky-label-success')) {
|
|
796
|
-
return 'success';
|
|
797
|
-
}
|
|
798
|
-
if (clsList.contains('sky-label-warning')) {
|
|
799
|
-
return 'warning';
|
|
800
|
-
}
|
|
801
|
-
return undefined;
|
|
802
|
-
}
|
|
803
|
-
/**
|
|
804
|
-
* The label's current text.
|
|
805
|
-
*/
|
|
806
|
-
get text() {
|
|
807
|
-
const labelEl = __classPrivateFieldGet(this, _SkyLabelFixture_instances, "m", _SkyLabelFixture_getLabelEl).call(this);
|
|
808
|
-
return SkyAppTestUtility.getText(labelEl);
|
|
809
|
-
}
|
|
810
|
-
constructor(fixture, skyTestId) {
|
|
811
|
-
_SkyLabelFixture_instances.add(this);
|
|
812
|
-
_SkyLabelFixture_debugEl.set(this, void 0);
|
|
813
|
-
__classPrivateFieldSet(this, _SkyLabelFixture_debugEl, SkyAppTestUtility.getDebugElementByTestId(fixture, skyTestId, 'sky-label'), "f");
|
|
814
|
-
}
|
|
815
|
-
}
|
|
816
|
-
_SkyLabelFixture_debugEl = new WeakMap(), _SkyLabelFixture_instances = new WeakSet(), _SkyLabelFixture_getLabelEl = function _SkyLabelFixture_getLabelEl() {
|
|
817
|
-
return __classPrivateFieldGet(this, _SkyLabelFixture_debugEl, "f").query(By.css('.sky-label'));
|
|
818
|
-
};
|
|
819
|
-
|
|
820
|
-
var _SkyWaitFixture_instances, _SkyWaitFixture_debugEl, _SkyWaitFixture_innerWaitComponentContainsClass;
|
|
821
|
-
/**
|
|
822
|
-
* @internal
|
|
823
|
-
*/
|
|
824
|
-
class SkyWaitFixture {
|
|
825
|
-
get isWaiting() {
|
|
826
|
-
return __classPrivateFieldGet(this, _SkyWaitFixture_instances, "m", _SkyWaitFixture_innerWaitComponentContainsClass).call(this, '.sky-wait-mask');
|
|
827
|
-
}
|
|
828
|
-
get isFullPage() {
|
|
829
|
-
return __classPrivateFieldGet(this, _SkyWaitFixture_instances, "m", _SkyWaitFixture_innerWaitComponentContainsClass).call(this, '.sky-wait-mask-loading-fixed');
|
|
830
|
-
}
|
|
831
|
-
get ariaLabel() {
|
|
832
|
-
const div = __classPrivateFieldGet(this, _SkyWaitFixture_debugEl, "f").nativeElement.querySelector('.sky-wait-mask');
|
|
833
|
-
return div.getAttribute('aria-label');
|
|
834
|
-
}
|
|
835
|
-
get isNonBlocking() {
|
|
836
|
-
return __classPrivateFieldGet(this, _SkyWaitFixture_instances, "m", _SkyWaitFixture_innerWaitComponentContainsClass).call(this, '.sky-wait-mask-loading-non-blocking');
|
|
837
|
-
}
|
|
838
|
-
constructor(fixture, skyTestId) {
|
|
839
|
-
_SkyWaitFixture_instances.add(this);
|
|
840
|
-
_SkyWaitFixture_debugEl.set(this, void 0);
|
|
841
|
-
__classPrivateFieldSet(this, _SkyWaitFixture_debugEl, SkyAppTestUtility.getDebugElementByTestId(fixture, skyTestId, 'sky-wait'), "f");
|
|
842
|
-
}
|
|
843
|
-
}
|
|
844
|
-
_SkyWaitFixture_debugEl = new WeakMap(), _SkyWaitFixture_instances = new WeakSet(), _SkyWaitFixture_innerWaitComponentContainsClass = function _SkyWaitFixture_innerWaitComponentContainsClass(className) {
|
|
845
|
-
const element = __classPrivateFieldGet(this, _SkyWaitFixture_debugEl, "f").nativeElement.querySelector(className);
|
|
846
|
-
return element !== null;
|
|
847
|
-
};
|
|
848
|
-
|
|
849
|
-
/**
|
|
850
|
-
* Generated bundle index. Do not edit.
|
|
851
|
-
*/
|
|
852
|
-
|
|
853
|
-
export { SkyAlertFixture, SkyAlertHarness, SkyChevronHarness, SkyHelpInlineHarness, SkyIconHarness, SkyKeyInfoHarness, SkyLabelFixture, SkyLabelHarness, SkyTokenHarness, SkyTokensHarness, SkyWaitFixture, SkyWaitHarness };
|
|
854
|
-
//# sourceMappingURL=skyux-indicators-testing.mjs.map
|