@skyux/lookup 6.13.0 → 6.14.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/documentation.json +642 -599
- package/esm2020/lib/modules/autocomplete/autocomplete-input.directive.mjs +9 -1
- package/esm2020/lib/modules/autocomplete/autocomplete.component.mjs +10 -4
- package/esm2020/testing/autocomplete/autocomplete-harness-filters.mjs +2 -0
- package/esm2020/testing/autocomplete/autocomplete-harness.mjs +157 -0
- package/esm2020/testing/autocomplete/autocomplete-input-harness.mjs +60 -0
- package/esm2020/testing/autocomplete/autocomplete-search-result-harness-filters.mjs +2 -0
- package/esm2020/testing/autocomplete/autocomplete-search-result-harness.mjs +40 -0
- package/esm2020/testing/public-api.mjs +5 -1
- package/fesm2015/skyux-lookup-testing.mjs +307 -2
- package/fesm2015/skyux-lookup-testing.mjs.map +1 -1
- package/fesm2015/skyux-lookup.mjs +18 -3
- package/fesm2015/skyux-lookup.mjs.map +1 -1
- package/fesm2020/skyux-lookup-testing.mjs +255 -1
- package/fesm2020/skyux-lookup-testing.mjs.map +1 -1
- package/fesm2020/skyux-lookup.mjs +17 -3
- package/fesm2020/skyux-lookup.mjs.map +1 -1
- package/lib/modules/autocomplete/autocomplete-input.directive.d.ts +1 -0
- package/package.json +11 -10
- package/testing/autocomplete/autocomplete-harness-filters.d.ts +6 -0
- package/testing/autocomplete/autocomplete-harness.d.ts +79 -0
- package/testing/autocomplete/autocomplete-input-harness.d.ts +39 -0
- package/testing/autocomplete/autocomplete-search-result-harness-filters.d.ts +10 -0
- package/testing/autocomplete/autocomplete-search-result-harness.d.ts +30 -0
- package/testing/public-api.d.ts +4 -0
|
@@ -1,9 +1,263 @@
|
|
|
1
|
+
import { __classPrivateFieldGet } from 'tslib';
|
|
2
|
+
import { SkyComponentHarness, SkyOverlayHarness } from '@skyux/core/testing';
|
|
3
|
+
import { ComponentHarness, HarnessPredicate } from '@angular/cdk/testing';
|
|
1
4
|
import { By } from '@angular/platform-browser';
|
|
2
5
|
import { SkyAppTestUtility } from '@skyux-sdk/testing';
|
|
3
6
|
import * as i0 from '@angular/core';
|
|
4
7
|
import { NgModule } from '@angular/core';
|
|
5
8
|
import { SkyCountryFieldModule, SkySearchModule } from '@skyux/lookup';
|
|
6
9
|
|
|
10
|
+
/**
|
|
11
|
+
* @internal
|
|
12
|
+
*/
|
|
13
|
+
class SkyAutocompleteInputHarness extends ComponentHarness {
|
|
14
|
+
/**
|
|
15
|
+
* Blurs the input.
|
|
16
|
+
*/
|
|
17
|
+
async blur() {
|
|
18
|
+
return (await this.host()).blur();
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Clears the input value.
|
|
22
|
+
*/
|
|
23
|
+
async clear() {
|
|
24
|
+
return (await this.host()).clear();
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Enters text into the input.
|
|
28
|
+
*/
|
|
29
|
+
async enterText(value) {
|
|
30
|
+
const el = await this.host();
|
|
31
|
+
await el.focus();
|
|
32
|
+
await el.clear();
|
|
33
|
+
await el.sendKeys(value);
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Focuses the input.
|
|
37
|
+
*/
|
|
38
|
+
async focus() {
|
|
39
|
+
return (await this.host()).focus();
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Gets the value of the input.
|
|
43
|
+
*/
|
|
44
|
+
async getValue() {
|
|
45
|
+
return (await this.host()).getProperty('value');
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Whether the input is disabled.
|
|
49
|
+
*/
|
|
50
|
+
async isDisabled() {
|
|
51
|
+
const disabled = await (await this.host()).getAttribute('disabled');
|
|
52
|
+
return disabled !== null;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Whether the input is focused.
|
|
56
|
+
*/
|
|
57
|
+
async isFocused() {
|
|
58
|
+
return (await this.host()).isFocused();
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Returns the value of the input's `aria-owns` attribute.
|
|
62
|
+
*/
|
|
63
|
+
async getAriaOwns() {
|
|
64
|
+
return (await this.host()).getAttribute('aria-owns');
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
SkyAutocompleteInputHarness.hostSelector = '[skyAutocomplete]';
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* Harness for interacting with an autocomplete search results in tests.
|
|
71
|
+
*/
|
|
72
|
+
class SkyAutocompleteSearchResultHarness extends ComponentHarness {
|
|
73
|
+
/**
|
|
74
|
+
* Gets a `HarnessPredicate` that can be used to search for a
|
|
75
|
+
* `SkyAutocompleteSearchResultHarness` that meets certain criteria.
|
|
76
|
+
*/
|
|
77
|
+
static with(filters) {
|
|
78
|
+
return new HarnessPredicate(SkyAutocompleteSearchResultHarness, filters).addOption('textContent', filters.textContent, async (harness, text) => HarnessPredicate.stringMatches(await harness.textContent(), text));
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Returns the value of the search result's descriptor property.
|
|
82
|
+
* This value is set by the autocomplete's `descriptorProperty` input.
|
|
83
|
+
*/
|
|
84
|
+
async getDescriptorValue() {
|
|
85
|
+
return (await (await this.host()).getAttribute('data-descriptor-value'));
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Returns a child harness.
|
|
89
|
+
*/
|
|
90
|
+
async queryHarness(query) {
|
|
91
|
+
return this.locatorForOptional(query)();
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Selects the search result.
|
|
95
|
+
*/
|
|
96
|
+
async select() {
|
|
97
|
+
return (await this.host()).click();
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Returns the text content of the search result.
|
|
101
|
+
*/
|
|
102
|
+
async textContent() {
|
|
103
|
+
return (await this.host()).text();
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
SkyAutocompleteSearchResultHarness.hostSelector = '.sky-autocomplete-result';
|
|
107
|
+
|
|
108
|
+
var _SkyAutocompleteHarness_instances, _SkyAutocompleteHarness_documentRootLocator, _SkyAutocompleteHarness_getInput, _SkyAutocompleteHarness_getOverlay;
|
|
109
|
+
/**
|
|
110
|
+
* Harness for interacting with an autocomplete component in tests.
|
|
111
|
+
*/
|
|
112
|
+
class SkyAutocompleteHarness extends SkyComponentHarness {
|
|
113
|
+
constructor() {
|
|
114
|
+
super(...arguments);
|
|
115
|
+
_SkyAutocompleteHarness_instances.add(this);
|
|
116
|
+
_SkyAutocompleteHarness_documentRootLocator.set(this, this.documentRootLocatorFactory());
|
|
117
|
+
_SkyAutocompleteHarness_getInput.set(this, this.locatorFor(SkyAutocompleteInputHarness));
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* Gets a `HarnessPredicate` that can be used to search for a
|
|
121
|
+
* `SkyAutocompleteHarness` that meets certain criteria.
|
|
122
|
+
*/
|
|
123
|
+
static with(filters) {
|
|
124
|
+
return SkyAutocompleteHarness.getDataSkyIdPredicate(filters);
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* Blurs the autocomplete input.
|
|
128
|
+
*/
|
|
129
|
+
async blur() {
|
|
130
|
+
return (await __classPrivateFieldGet(this, _SkyAutocompleteHarness_getInput, "f").call(this)).blur();
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* Clears the input value.
|
|
134
|
+
*/
|
|
135
|
+
async clear() {
|
|
136
|
+
return (await __classPrivateFieldGet(this, _SkyAutocompleteHarness_getInput, "f").call(this)).clear();
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* Enters text into the autocomplete input.
|
|
140
|
+
*/
|
|
141
|
+
async enterText(value) {
|
|
142
|
+
return (await __classPrivateFieldGet(this, _SkyAutocompleteHarness_getInput, "f").call(this)).enterText(value);
|
|
143
|
+
}
|
|
144
|
+
/**
|
|
145
|
+
* Focuses the autocomplete input.
|
|
146
|
+
*/
|
|
147
|
+
async focus() {
|
|
148
|
+
return (await __classPrivateFieldGet(this, _SkyAutocompleteHarness_getInput, "f").call(this)).focus();
|
|
149
|
+
}
|
|
150
|
+
/**
|
|
151
|
+
* Returns search result harnesses.
|
|
152
|
+
*/
|
|
153
|
+
async getSearchResults(filters) {
|
|
154
|
+
const overlay = await __classPrivateFieldGet(this, _SkyAutocompleteHarness_instances, "m", _SkyAutocompleteHarness_getOverlay).call(this);
|
|
155
|
+
if (!overlay) {
|
|
156
|
+
throw new Error('Unable to retrieve search results. The autocomplete is closed.');
|
|
157
|
+
}
|
|
158
|
+
const harnesses = await overlay.queryHarnesses(SkyAutocompleteSearchResultHarness.with(filters || {}));
|
|
159
|
+
if (filters && harnesses.length === 0) {
|
|
160
|
+
// Stringify the regular expression so that it's readable in the console log.
|
|
161
|
+
if (filters.textContent instanceof RegExp) {
|
|
162
|
+
filters.textContent = filters.textContent.toString();
|
|
163
|
+
}
|
|
164
|
+
throw new Error(`Could not find search results matching filter(s): ${JSON.stringify(filters)}`);
|
|
165
|
+
}
|
|
166
|
+
return harnesses;
|
|
167
|
+
}
|
|
168
|
+
/**
|
|
169
|
+
* Returns the text content for each search result.
|
|
170
|
+
*/
|
|
171
|
+
async getSearchResultsText(filters) {
|
|
172
|
+
const harnesses = await this.getSearchResults(filters);
|
|
173
|
+
const text = [];
|
|
174
|
+
for (const harness of harnesses) {
|
|
175
|
+
text.push(await harness.textContent());
|
|
176
|
+
}
|
|
177
|
+
return text;
|
|
178
|
+
}
|
|
179
|
+
/**
|
|
180
|
+
* Gets the value of the autocomplete input.
|
|
181
|
+
*/
|
|
182
|
+
async getValue() {
|
|
183
|
+
return (await __classPrivateFieldGet(this, _SkyAutocompleteHarness_getInput, "f").call(this)).getValue();
|
|
184
|
+
}
|
|
185
|
+
/**
|
|
186
|
+
* Whether the autocomplete input is disabled.
|
|
187
|
+
*/
|
|
188
|
+
async isDisabled() {
|
|
189
|
+
return (await __classPrivateFieldGet(this, _SkyAutocompleteHarness_getInput, "f").call(this)).isDisabled();
|
|
190
|
+
}
|
|
191
|
+
/**
|
|
192
|
+
* Whether the autocomplete input is focused.
|
|
193
|
+
*/
|
|
194
|
+
async isFocused() {
|
|
195
|
+
return (await __classPrivateFieldGet(this, _SkyAutocompleteHarness_getInput, "f").call(this)).isFocused();
|
|
196
|
+
}
|
|
197
|
+
/**
|
|
198
|
+
* Whether the autocomplete is open.
|
|
199
|
+
*/
|
|
200
|
+
async isOpen() {
|
|
201
|
+
const overlay = await __classPrivateFieldGet(this, _SkyAutocompleteHarness_instances, "m", _SkyAutocompleteHarness_getOverlay).call(this);
|
|
202
|
+
return !!overlay;
|
|
203
|
+
}
|
|
204
|
+
/**
|
|
205
|
+
* Selects a search result.
|
|
206
|
+
*/
|
|
207
|
+
async selectSearchResult(filters) {
|
|
208
|
+
const results = await this.getSearchResults(filters);
|
|
209
|
+
if (results && results.length > 0) {
|
|
210
|
+
await results[0].select();
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
/**
|
|
214
|
+
* Clicks the "Add" button in the autocomplete search results panel.
|
|
215
|
+
* (The "Add" functionality is not included in the public API
|
|
216
|
+
* of a "vanilla" autocomplete component, so this method is protected
|
|
217
|
+
* to prevent consumers of the autocomplete harness from calling it.
|
|
218
|
+
* The lookup harness, which extends the autocomplete harness, may
|
|
219
|
+
* still access this feature, however.)
|
|
220
|
+
*/
|
|
221
|
+
async clickAddButton() {
|
|
222
|
+
const overlay = await __classPrivateFieldGet(this, _SkyAutocompleteHarness_instances, "m", _SkyAutocompleteHarness_getOverlay).call(this);
|
|
223
|
+
if (!overlay) {
|
|
224
|
+
throw new Error('Unable to find the "Add" button. The autocomplete is closed.');
|
|
225
|
+
}
|
|
226
|
+
const button = await overlay.querySelector('button.sky-autocomplete-action-add');
|
|
227
|
+
if (!button) {
|
|
228
|
+
throw new Error('The "Add" button cannot be clicked because it does not exist.');
|
|
229
|
+
}
|
|
230
|
+
await button.click();
|
|
231
|
+
}
|
|
232
|
+
/**
|
|
233
|
+
* Clicks the "Show more" button.
|
|
234
|
+
* (The "Show more" functionality is not included in the public API
|
|
235
|
+
* of a "vanilla" autocomplete component, so this method is protected
|
|
236
|
+
* to prevent consumers of the autocomplete harness from calling it.
|
|
237
|
+
* The lookup harness, which extends the autocomplete harness, may
|
|
238
|
+
* still access this feature, however.)
|
|
239
|
+
*/
|
|
240
|
+
async clickShowMoreButton() {
|
|
241
|
+
const overlay = await __classPrivateFieldGet(this, _SkyAutocompleteHarness_instances, "m", _SkyAutocompleteHarness_getOverlay).call(this);
|
|
242
|
+
if (!overlay) {
|
|
243
|
+
throw new Error('Unable to find the "Show more" button. ' +
|
|
244
|
+
'The autocomplete is closed.');
|
|
245
|
+
}
|
|
246
|
+
const button = await overlay.querySelector('button.sky-autocomplete-action-more');
|
|
247
|
+
if (!button) {
|
|
248
|
+
throw new Error('The "Show more" button cannot be clicked because it does not exist.');
|
|
249
|
+
}
|
|
250
|
+
await button.click();
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
_SkyAutocompleteHarness_documentRootLocator = new WeakMap(), _SkyAutocompleteHarness_getInput = new WeakMap(), _SkyAutocompleteHarness_instances = new WeakSet(), _SkyAutocompleteHarness_getOverlay = async function _SkyAutocompleteHarness_getOverlay() {
|
|
254
|
+
const overlayId = await (await __classPrivateFieldGet(this, _SkyAutocompleteHarness_getInput, "f").call(this)).getAriaOwns();
|
|
255
|
+
return overlayId
|
|
256
|
+
? __classPrivateFieldGet(this, _SkyAutocompleteHarness_documentRootLocator, "f").locatorForOptional(SkyOverlayHarness.with({ selector: `#${overlayId}` }))()
|
|
257
|
+
: null;
|
|
258
|
+
};
|
|
259
|
+
SkyAutocompleteHarness.hostSelector = 'sky-autocomplete';
|
|
260
|
+
|
|
7
261
|
/**
|
|
8
262
|
* Allows interaction with a SKY UX country field component.
|
|
9
263
|
*/
|
|
@@ -199,5 +453,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImpor
|
|
|
199
453
|
* Generated bundle index. Do not edit.
|
|
200
454
|
*/
|
|
201
455
|
|
|
202
|
-
export { SkyCountryFieldFixture, SkyCountryFieldTestingModule, SkySearchFixture, SkySearchTestingModule };
|
|
456
|
+
export { SkyAutocompleteHarness, SkyAutocompleteSearchResultHarness, SkyCountryFieldFixture, SkyCountryFieldTestingModule, SkySearchFixture, SkySearchTestingModule };
|
|
203
457
|
//# sourceMappingURL=skyux-lookup-testing.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"skyux-lookup-testing.mjs","sources":["../../../../../libs/components/lookup/testing/src/country-field/country-field-fixture.ts","../../../../../libs/components/lookup/testing/src/country-field/country-field-testing.module.ts","../../../../../libs/components/lookup/testing/src/search/search-fixture.ts","../../../../../libs/components/lookup/testing/src/search/search-testing.module.ts","../../../../../libs/components/lookup/testing/src/skyux-lookup-testing.ts"],"sourcesContent":["import { DebugElement } from '@angular/core';\nimport { ComponentFixture } from '@angular/core/testing';\nimport { By } from '@angular/platform-browser';\nimport { SkyAppTestUtility } from '@skyux-sdk/testing';\n\n/**\n * Allows interaction with a SKY UX country field component.\n */\nexport class SkyCountryFieldFixture {\n private debugEl: DebugElement;\n\n /**\n * The value of the input field's autocomplete attribute.\n */\n public get autocompleteAttribute(): string | null {\n return this.getInputElement().getAttribute('autocomplete');\n }\n\n /**\n * A flag indicating if the country flag is currently visible.\n * The flag will be visible only if a selection has been made\n * and if the hideSelectedCountryFlag option is false.\n */\n public get countryFlagIsVisible(): boolean {\n const flag = this.getCountryFlag();\n return flag !== null;\n }\n\n /**\n * A flag indicating whether or not the input has been disabled.\n */\n public get disabled(): boolean {\n return this.getInputElement().disabled;\n }\n\n /**\n * The value of the input field.\n */\n public get searchText(): string {\n return this.getInputElement().value;\n }\n\n constructor(private fixture: ComponentFixture<any>, skyTestId: string) {\n this.debugEl = SkyAppTestUtility.getDebugElementByTestId(\n fixture,\n skyTestId,\n 'sky-country-field'\n );\n }\n\n /**\n * Enters the search text into the input field displaying search results, but making no selection.\n * @param searchText The name of the country to select.\n * @returns The list of country names matching the search text.\n */\n public async search(searchText: string): Promise<string[]> {\n const resultNodes = await this.searchAndGetResults(\n searchText,\n this.fixture\n );\n const resultArray = Array.prototype.slice.call(resultNodes);\n const results = resultArray.map((result: HTMLElement) => {\n const countryNameEl = result.querySelector('.sky-highlight-mark');\n const countryName = SkyAppTestUtility.getText(countryNameEl)!;\n return countryName;\n });\n\n this.fixture.detectChanges();\n await this.fixture.whenStable();\n\n return results;\n }\n\n /**\n * Enters the search text into the input field and selects the first result (if any).\n * @param searchText The name of the country to select.\n */\n public async searchAndSelectFirstResult(searchText: string): Promise<void> {\n await this.searchAndSelect(searchText, 0, this.fixture);\n\n this.fixture.detectChanges();\n return this.fixture.whenStable();\n }\n\n /**\n * Clears the country selection and input field.\n */\n public clear(): Promise<void> {\n this.enterSearch('', this.fixture);\n\n this.fixture.detectChanges();\n return this.fixture.whenStable();\n }\n\n //#region helpers\n\n private getCountryFlag(): DebugElement {\n return this.debugEl.query(By.css('.sky-country-field-flag'));\n }\n\n private getAutocompleteElement(): HTMLElement {\n return document.querySelector('.sky-autocomplete-results') as HTMLElement;\n }\n\n private getInputElement(): HTMLTextAreaElement {\n const debugEl = this.debugEl.query(By.css('textarea'));\n return debugEl.nativeElement as HTMLTextAreaElement;\n }\n\n private blurInput(fixture: ComponentFixture<any>): Promise<void> {\n SkyAppTestUtility.fireDomEvent(this.getInputElement(), 'blur');\n fixture.detectChanges();\n return fixture.whenStable();\n }\n\n private enterSearch(\n newValue: string,\n fixture: ComponentFixture<any>\n ): Promise<void> {\n const inputElement = this.getInputElement();\n inputElement.value = newValue;\n SkyAppTestUtility.fireDomEvent(inputElement, 'keyup');\n SkyAppTestUtility.fireDomEvent(inputElement, 'input');\n fixture.detectChanges();\n return fixture.whenStable();\n }\n\n private async searchAndGetResults(\n newValue: string,\n fixture: ComponentFixture<any>\n ): Promise<NodeListOf<HTMLElement>> {\n await this.enterSearch(newValue, fixture);\n fixture.detectChanges();\n await fixture.whenStable();\n return this.getAutocompleteElement().querySelectorAll(\n '.sky-autocomplete-result'\n );\n }\n\n private async searchAndSelect(\n newValue: string,\n index: number,\n fixture: ComponentFixture<any>\n ): Promise<void> {\n const inputElement = this.getInputElement();\n const searchResults = await this.searchAndGetResults(newValue, fixture);\n\n if (searchResults.length < index + 1) {\n throw new Error('Index out of range for results');\n }\n\n // Note: the ordering of these events is important!\n SkyAppTestUtility.fireDomEvent(inputElement, 'change');\n SkyAppTestUtility.fireDomEvent(searchResults[index], 'mousedown');\n this.blurInput(fixture);\n }\n\n //#endregion helpers\n}\n","import { NgModule } from '@angular/core';\nimport { SkyCountryFieldModule } from '@skyux/lookup';\n\n@NgModule({\n exports: [SkyCountryFieldModule],\n})\nexport class SkyCountryFieldTestingModule {}\n","import { DebugElement } from '@angular/core';\nimport { ComponentFixture } from '@angular/core/testing';\nimport { By } from '@angular/platform-browser';\nimport { SkyAppTestUtility } from '@skyux-sdk/testing';\n\n/**\n * Allows interaction with a SKY UX search component.\n */\nexport class SkySearchFixture {\n /**\n * Gets the search's current text.\n */\n public get searchText(): string {\n return this.getInputEl().nativeElement.value;\n }\n\n /**\n * Gets the search's current placeholder text.\n */\n public get placeholderText(): string {\n return this.getInputEl().nativeElement.placeholder;\n }\n\n private debugEl: DebugElement;\n\n constructor(fixture: ComponentFixture<any>, skyTestId: string) {\n this.debugEl = SkyAppTestUtility.getDebugElementByTestId(\n fixture,\n skyTestId,\n 'sky-search'\n );\n }\n\n /**\n * Applies the specified search text, invoking the search.\n * @param searchText The search text to apply. If none is specified, the search's\n * current search text will be applied.\n */\n public apply(searchText?: string) {\n if (searchText) {\n SkyAppTestUtility.setInputValue(\n this.getInputEl().nativeElement,\n searchText\n );\n }\n\n const btnEl = this.getApplyBtnEl();\n\n btnEl.triggerEventHandler('click', {});\n }\n\n /**\n * Clears the current search text. If there is no search text or the search text is\n * not currently applied, an error is thrown.\n */\n public clear() {\n const clearEl = this.debugEl.query(By.css('.sky-input-group-clear'));\n\n if (!SkyAppTestUtility.isVisible(clearEl)) {\n throw new Error(\n 'There currently is no search text or the current search text has not been applied, ' +\n 'so the clear button is not visible.'\n );\n }\n\n const btnEl = this.getClearBtnEl();\n\n btnEl.triggerEventHandler('click', {});\n }\n\n private getApplyBtnEl(): DebugElement {\n return this.debugEl.query(By.css('.sky-search-btn-apply'));\n }\n\n private getClearBtnEl(): DebugElement {\n return this.debugEl.query(By.css('.sky-search-btn-clear'));\n }\n\n private getInputEl(): DebugElement {\n return this.debugEl.query(By.css('.sky-search-input'));\n }\n}\n","import { NgModule } from '@angular/core';\nimport { SkySearchModule } from '@skyux/lookup';\n\n@NgModule({\n exports: [SkySearchModule],\n})\nexport class SkySearchTestingModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;AAKA;;AAEG;MACU,sBAAsB,CAAA;IAkCjC,WAAoB,CAAA,OAA8B,EAAE,SAAiB,EAAA;QAAjD,IAAO,CAAA,OAAA,GAAP,OAAO,CAAuB;AAChD,QAAA,IAAI,CAAC,OAAO,GAAG,iBAAiB,CAAC,uBAAuB,CACtD,OAAO,EACP,SAAS,EACT,mBAAmB,CACpB,CAAC;KACH;AArCD;;AAEG;AACH,IAAA,IAAW,qBAAqB,GAAA;QAC9B,OAAO,IAAI,CAAC,eAAe,EAAE,CAAC,YAAY,CAAC,cAAc,CAAC,CAAC;KAC5D;AAED;;;;AAIG;AACH,IAAA,IAAW,oBAAoB,GAAA;AAC7B,QAAA,MAAM,IAAI,GAAG,IAAI,CAAC,cAAc,EAAE,CAAC;QACnC,OAAO,IAAI,KAAK,IAAI,CAAC;KACtB;AAED;;AAEG;AACH,IAAA,IAAW,QAAQ,GAAA;AACjB,QAAA,OAAO,IAAI,CAAC,eAAe,EAAE,CAAC,QAAQ,CAAC;KACxC;AAED;;AAEG;AACH,IAAA,IAAW,UAAU,GAAA;AACnB,QAAA,OAAO,IAAI,CAAC,eAAe,EAAE,CAAC,KAAK,CAAC;KACrC;AAUD;;;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K,CAAC,EAAE,CAAC,GAAG,CAAC,uBAAuB,CAAC,CAAC,CAAC;KAC5D;IAEO,aAAa,GAAA;AACnB,QAAA,OAAO,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC,GAAG,CAAC,uBAAuB,CAAC,CAAC,CAAC;KAC5D;IAEO,UAAU,GAAA;AAChB,QAAA,OAAO,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC,GAAG,CAAC,mBAAmB,CAAC,CAAC,CAAC;KACxD;AACF;;MC3EY,sBAAsB,CAAA;;mHAAtB,sBAAsB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA;AAAtB,sBAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,sBAAsB,YAFvB,eAAe,CAAA,EAAA,CAAA,CAAA;AAEd,sBAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,sBAAsB,YAFvB,eAAe,CAAA,EAAA,CAAA,CAAA;2FAEd,sBAAsB,EAAA,UAAA,EAAA,CAAA;kBAHlC,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;oBACR,OAAO,EAAE,CAAC,eAAe,CAAC;AAC3B,iBAAA,CAAA;;;ACLD;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"skyux-lookup-testing.mjs","sources":["../../../../../libs/components/lookup/testing/src/autocomplete/autocomplete-input-harness.ts","../../../../../libs/components/lookup/testing/src/autocomplete/autocomplete-search-result-harness.ts","../../../../../libs/components/lookup/testing/src/autocomplete/autocomplete-harness.ts","../../../../../libs/components/lookup/testing/src/country-field/country-field-fixture.ts","../../../../../libs/components/lookup/testing/src/country-field/country-field-testing.module.ts","../../../../../libs/components/lookup/testing/src/search/search-fixture.ts","../../../../../libs/components/lookup/testing/src/search/search-testing.module.ts","../../../../../libs/components/lookup/testing/src/skyux-lookup-testing.ts"],"sourcesContent":["import { ComponentHarness } from '@angular/cdk/testing';\n\n/**\n * @internal\n */\nexport class SkyAutocompleteInputHarness extends ComponentHarness {\n public static hostSelector = '[skyAutocomplete]';\n\n /**\n * Blurs the input.\n */\n public async blur(): Promise<void> {\n return (await this.host()).blur();\n }\n\n /**\n * Clears the input value.\n */\n public async clear(): Promise<void> {\n return (await this.host()).clear();\n }\n\n /**\n * Enters text into the input.\n */\n public async enterText(value: string): Promise<void> {\n const el = await this.host();\n await el.focus();\n await el.clear();\n await el.sendKeys(value);\n }\n\n /**\n * Focuses the input.\n */\n public async focus(): Promise<void> {\n return (await this.host()).focus();\n }\n\n /**\n * Gets the value of the input.\n */\n public async getValue(): Promise<string> {\n return (await this.host()).getProperty('value');\n }\n\n /**\n * Whether the input is disabled.\n */\n public async isDisabled(): Promise<boolean> {\n const disabled = await (await this.host()).getAttribute('disabled');\n return disabled !== null;\n }\n\n /**\n * Whether the input is focused.\n */\n public async isFocused(): Promise<boolean> {\n return (await this.host()).isFocused();\n }\n\n /**\n * Returns the value of the input's `aria-owns` attribute.\n */\n public async getAriaOwns(): Promise<string | null> {\n return (await this.host()).getAttribute('aria-owns');\n }\n}\n","import {\n ComponentHarness,\n HarnessPredicate,\n HarnessQuery,\n} from '@angular/cdk/testing';\n\nimport { SkyAutocompleteSearchResultHarnessFilters } from './autocomplete-search-result-harness-filters';\n\n/**\n * Harness for interacting with an autocomplete search results in tests.\n */\nexport class SkyAutocompleteSearchResultHarness extends ComponentHarness {\n public static hostSelector = '.sky-autocomplete-result';\n\n /**\n * Gets a `HarnessPredicate` that can be used to search for a\n * `SkyAutocompleteSearchResultHarness` that meets certain criteria.\n */\n public static with(\n filters: SkyAutocompleteSearchResultHarnessFilters\n ): HarnessPredicate<SkyAutocompleteSearchResultHarness> {\n return new HarnessPredicate(\n SkyAutocompleteSearchResultHarness,\n filters\n ).addOption('textContent', filters.textContent, async (harness, text) =>\n HarnessPredicate.stringMatches(await harness.textContent(), text)\n );\n }\n\n /**\n * Returns the value of the search result's descriptor property.\n * This value is set by the autocomplete's `descriptorProperty` input.\n */\n public async getDescriptorValue(): Promise<string> {\n return (await (\n await this.host()\n ).getAttribute('data-descriptor-value')) as string;\n }\n\n /**\n * Returns a child harness.\n */\n public async queryHarness<T extends ComponentHarness>(\n query: HarnessQuery<T>\n ): Promise<T | null> {\n return this.locatorForOptional(query)();\n }\n\n /**\n * Selects the search result.\n */\n public async select(): Promise<void> {\n return (await this.host()).click();\n }\n\n /**\n * Returns the text content of the search result.\n */\n public async textContent(): Promise<string> {\n return (await this.host()).text();\n }\n}\n","import { HarnessPredicate } from '@angular/cdk/testing';\nimport { SkyComponentHarness, SkyOverlayHarness } from '@skyux/core/testing';\n\nimport { SkyAutocompleteHarnessFilters } from './autocomplete-harness-filters';\nimport { SkyAutocompleteInputHarness } from './autocomplete-input-harness';\nimport { SkyAutocompleteSearchResultHarness } from './autocomplete-search-result-harness';\nimport { SkyAutocompleteSearchResultHarnessFilters } from './autocomplete-search-result-harness-filters';\n\n/**\n * Harness for interacting with an autocomplete component in tests.\n */\nexport class SkyAutocompleteHarness extends SkyComponentHarness {\n public static hostSelector = 'sky-autocomplete';\n\n #documentRootLocator = this.documentRootLocatorFactory();\n\n #getInput = this.locatorFor(SkyAutocompleteInputHarness);\n\n /**\n * Gets a `HarnessPredicate` that can be used to search for a\n * `SkyAutocompleteHarness` that meets certain criteria.\n */\n public static with(\n filters: SkyAutocompleteHarnessFilters\n ): HarnessPredicate<SkyAutocompleteHarness> {\n return SkyAutocompleteHarness.getDataSkyIdPredicate(filters);\n }\n\n /**\n * Blurs the autocomplete input.\n */\n public async blur(): Promise<void> {\n return (await this.#getInput()).blur();\n }\n\n /**\n * Clears the input value.\n */\n public async clear(): Promise<void> {\n return (await this.#getInput()).clear();\n }\n\n /**\n * Enters text into the autocomplete input.\n */\n public async enterText(value: string): Promise<void> {\n return (await this.#getInput()).enterText(value);\n }\n\n /**\n * Focuses the autocomplete input.\n */\n public async focus(): Promise<void> {\n return (await this.#getInput()).focus();\n }\n\n /**\n * Returns search result harnesses.\n */\n public async getSearchResults(\n filters?: SkyAutocompleteSearchResultHarnessFilters\n ): Promise<SkyAutocompleteSearchResultHarness[]> {\n const overlay = await this.#getOverlay();\n\n if (!overlay) {\n throw new Error(\n 'Unable to retrieve search results. The autocomplete is closed.'\n );\n }\n\n const harnesses = await overlay.queryHarnesses(\n SkyAutocompleteSearchResultHarness.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.textContent instanceof RegExp) {\n filters.textContent = filters.textContent.toString();\n }\n\n throw new Error(\n `Could not find search results matching filter(s): ${JSON.stringify(\n filters\n )}`\n );\n }\n\n return harnesses;\n }\n\n /**\n * Returns the text content for each search result.\n */\n public async getSearchResultsText(\n filters?: SkyAutocompleteSearchResultHarnessFilters\n ): Promise<string[]> {\n const harnesses = await this.getSearchResults(filters);\n\n const text: string[] = [];\n for (const harness of harnesses) {\n text.push(await harness.textContent());\n }\n\n return text;\n }\n\n /**\n * Gets the value of the autocomplete input.\n */\n public async getValue(): Promise<string> {\n return (await this.#getInput()).getValue();\n }\n\n /**\n * Whether the autocomplete input is disabled.\n */\n public async isDisabled(): Promise<boolean> {\n return (await this.#getInput()).isDisabled();\n }\n\n /**\n * Whether the autocomplete input is focused.\n */\n public async isFocused(): Promise<boolean> {\n return (await this.#getInput()).isFocused();\n }\n\n /**\n * Whether the autocomplete is open.\n */\n public async isOpen(): Promise<boolean> {\n const overlay = await this.#getOverlay();\n return !!overlay;\n }\n\n /**\n * Selects a search result.\n */\n public async selectSearchResult(\n filters: SkyAutocompleteSearchResultHarnessFilters\n ): Promise<void> {\n const results = await this.getSearchResults(filters);\n if (results && results.length > 0) {\n await results[0].select();\n }\n }\n\n /**\n * Clicks the \"Add\" button in the autocomplete search results panel.\n * (The \"Add\" functionality is not included in the public API\n * of a \"vanilla\" autocomplete component, so this method is protected\n * to prevent consumers of the autocomplete harness from calling it.\n * The lookup harness, which extends the autocomplete harness, may\n * still access this feature, however.)\n */\n protected async clickAddButton(): Promise<void> {\n const overlay = await this.#getOverlay();\n if (!overlay) {\n throw new Error(\n 'Unable to find the \"Add\" button. The autocomplete is closed.'\n );\n }\n\n const button = await overlay.querySelector(\n 'button.sky-autocomplete-action-add'\n );\n\n if (!button) {\n throw new Error(\n 'The \"Add\" button cannot be clicked because it does not exist.'\n );\n }\n\n await button.click();\n }\n\n /**\n * Clicks the \"Show more\" button.\n * (The \"Show more\" functionality is not included in the public API\n * of a \"vanilla\" autocomplete component, so this method is protected\n * to prevent consumers of the autocomplete harness from calling it.\n * The lookup harness, which extends the autocomplete harness, may\n * still access this feature, however.)\n */\n protected async clickShowMoreButton(): Promise<void> {\n const overlay = await this.#getOverlay();\n\n if (!overlay) {\n throw new Error(\n 'Unable to find the \"Show more\" button. ' +\n 'The autocomplete is closed.'\n );\n }\n\n const button = await overlay.querySelector(\n 'button.sky-autocomplete-action-more'\n );\n\n if (!button) {\n throw new Error(\n 'The \"Show more\" button cannot be clicked because it does not exist.'\n );\n }\n\n await button.click();\n }\n\n async #getOverlay(): Promise<SkyOverlayHarness | null> {\n const overlayId = await (await this.#getInput()).getAriaOwns();\n\n return overlayId\n ? this.#documentRootLocator.locatorForOptional(\n SkyOverlayHarness.with({ selector: `#${overlayId}` })\n )()\n : null;\n }\n}\n","import { DebugElement } from '@angular/core';\nimport { ComponentFixture } from '@angular/core/testing';\nimport { By } from '@angular/platform-browser';\nimport { SkyAppTestUtility } from '@skyux-sdk/testing';\n\n/**\n * Allows interaction with a SKY UX country field component.\n */\nexport class SkyCountryFieldFixture {\n private debugEl: DebugElement;\n\n /**\n * The value of the input field's autocomplete attribute.\n */\n public get autocompleteAttribute(): string | null {\n return this.getInputElement().getAttribute('autocomplete');\n }\n\n /**\n * A flag indicating if the country flag is currently visible.\n * The flag will be visible only if a selection has been made\n * and if the hideSelectedCountryFlag option is false.\n */\n public get countryFlagIsVisible(): boolean {\n const flag = this.getCountryFlag();\n return flag !== null;\n }\n\n /**\n * A flag indicating whether or not the input has been disabled.\n */\n public get disabled(): boolean {\n return this.getInputElement().disabled;\n }\n\n /**\n * The value of the input field.\n */\n public get searchText(): string {\n return this.getInputElement().value;\n }\n\n constructor(private fixture: ComponentFixture<any>, skyTestId: string) {\n this.debugEl = SkyAppTestUtility.getDebugElementByTestId(\n fixture,\n skyTestId,\n 'sky-country-field'\n );\n }\n\n /**\n * Enters the search text into the input field displaying search results, but making no selection.\n * @param searchText The name of the country to select.\n * @returns The list of country names matching the search text.\n */\n public async search(searchText: string): Promise<string[]> {\n const resultNodes = await this.searchAndGetResults(\n searchText,\n this.fixture\n );\n const resultArray = Array.prototype.slice.call(resultNodes);\n const results = resultArray.map((result: HTMLElement) => {\n const countryNameEl = result.querySelector('.sky-highlight-mark');\n const countryName = SkyAppTestUtility.getText(countryNameEl)!;\n return countryName;\n });\n\n this.fixture.detectChanges();\n await this.fixture.whenStable();\n\n return results;\n }\n\n /**\n * Enters the search text into the input field and selects the first result (if any).\n * @param searchText The name of the country to select.\n */\n public async searchAndSelectFirstResult(searchText: string): Promise<void> {\n await this.searchAndSelect(searchText, 0, this.fixture);\n\n this.fixture.detectChanges();\n return this.fixture.whenStable();\n }\n\n /**\n * Clears the country selection and input field.\n */\n public clear(): Promise<void> {\n this.enterSearch('', this.fixture);\n\n this.fixture.detectChanges();\n return this.fixture.whenStable();\n }\n\n //#region helpers\n\n private getCountryFlag(): DebugElement {\n return this.debugEl.query(By.css('.sky-country-field-flag'));\n }\n\n private getAutocompleteElement(): HTMLElement {\n return document.querySelector('.sky-autocomplete-results') as HTMLElement;\n }\n\n private getInputElement(): HTMLTextAreaElement {\n const debugEl = this.debugEl.query(By.css('textarea'));\n return debugEl.nativeElement as HTMLTextAreaElement;\n }\n\n private blurInput(fixture: ComponentFixture<any>): Promise<void> {\n SkyAppTestUtility.fireDomEvent(this.getInputElement(), 'blur');\n fixture.detectChanges();\n return fixture.whenStable();\n }\n\n private enterSearch(\n newValue: string,\n fixture: ComponentFixture<any>\n ): Promise<void> {\n const inputElement = this.getInputElement();\n inputElement.value = newValue;\n SkyAppTestUtility.fireDomEvent(inputElement, 'keyup');\n SkyAppTestUtility.fireDomEvent(inputElement, 'input');\n fixture.detectChanges();\n return fixture.whenStable();\n }\n\n private async searchAndGetResults(\n newValue: string,\n fixture: ComponentFixture<any>\n ): Promise<NodeListOf<HTMLElement>> {\n await this.enterSearch(newValue, fixture);\n fixture.detectChanges();\n await fixture.whenStable();\n return this.getAutocompleteElement().querySelectorAll(\n '.sky-autocomplete-result'\n );\n }\n\n private async searchAndSelect(\n newValue: string,\n index: number,\n fixture: ComponentFixture<any>\n ): Promise<void> {\n const inputElement = this.getInputElement();\n const searchResults = await this.searchAndGetResults(newValue, fixture);\n\n if (searchResults.length < index + 1) {\n throw new Error('Index out of range for results');\n }\n\n // Note: the ordering of these events is important!\n SkyAppTestUtility.fireDomEvent(inputElement, 'change');\n SkyAppTestUtility.fireDomEvent(searchResults[index], 'mousedown');\n this.blurInput(fixture);\n }\n\n //#endregion helpers\n}\n","import { NgModule } from '@angular/core';\nimport { SkyCountryFieldModule } from '@skyux/lookup';\n\n@NgModule({\n exports: [SkyCountryFieldModule],\n})\nexport class SkyCountryFieldTestingModule {}\n","import { DebugElement } from '@angular/core';\nimport { ComponentFixture } from '@angular/core/testing';\nimport { By } from '@angular/platform-browser';\nimport { SkyAppTestUtility } from '@skyux-sdk/testing';\n\n/**\n * Allows interaction with a SKY UX search component.\n */\nexport class SkySearchFixture {\n /**\n * Gets the search's current text.\n */\n public get searchText(): string {\n return this.getInputEl().nativeElement.value;\n }\n\n /**\n * Gets the search's current placeholder text.\n */\n public get placeholderText(): string {\n return this.getInputEl().nativeElement.placeholder;\n }\n\n private debugEl: DebugElement;\n\n constructor(fixture: ComponentFixture<any>, skyTestId: string) {\n this.debugEl = SkyAppTestUtility.getDebugElementByTestId(\n fixture,\n skyTestId,\n 'sky-search'\n );\n }\n\n /**\n * Applies the specified search text, invoking the search.\n * @param searchText The search text to apply. If none is specified, the search's\n * current search text will be applied.\n */\n public apply(searchText?: string) {\n if (searchText) {\n SkyAppTestUtility.setInputValue(\n this.getInputEl().nativeElement,\n searchText\n );\n }\n\n const btnEl = this.getApplyBtnEl();\n\n btnEl.triggerEventHandler('click', {});\n }\n\n /**\n * Clears the current search text. If there is no search text or the search text is\n * not currently applied, an error is thrown.\n */\n public clear() {\n const clearEl = this.debugEl.query(By.css('.sky-input-group-clear'));\n\n if (!SkyAppTestUtility.isVisible(clearEl)) {\n throw new Error(\n 'There currently is no search text or the current search text has not been applied, ' +\n 'so the clear button is not visible.'\n );\n }\n\n const btnEl = this.getClearBtnEl();\n\n btnEl.triggerEventHandler('click', {});\n }\n\n private getApplyBtnEl(): DebugElement {\n return this.debugEl.query(By.css('.sky-search-btn-apply'));\n }\n\n private getClearBtnEl(): DebugElement {\n return this.debugEl.query(By.css('.sky-search-btn-clear'));\n }\n\n private getInputEl(): DebugElement {\n return this.debugEl.query(By.css('.sky-search-input'));\n }\n}\n","import { NgModule } from '@angular/core';\nimport { SkySearchModule } from '@skyux/lookup';\n\n@NgModule({\n exports: [SkySearchModule],\n})\nexport class SkySearchTestingModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;AAEA;;AAEG;AACG,MAAO,2BAA4B,SAAQ,gBAAgB,CAAA;AAG/D;;AAEG;AACI,IAAA,MAAM,IAAI,GAAA;QACf,OAAO,CAAC,MAAM,IAAI,CAAC,IAAI,EAAE,EAAE,IAAI,EAAE,CAAC;KACnC;AAED;;AAEG;AACI,IAAA,MAAM,KAAK,GAAA;QAChB,OAAO,CAAC,MAAM,I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C;KACxC;IAEO,aAAa,GAAA;AACnB,QAAA,OAAO,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC,GAAG,CAAC,uBAAuB,CAAC,CAAC,CAAC;KAC5D;IAEO,aAAa,GAAA;AACnB,QAAA,OAAO,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC,GAAG,CAAC,uBAAuB,CAAC,CAAC,CAAC;KAC5D;IAEO,UAAU,GAAA;AAChB,QAAA,OAAO,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC,GAAG,CAAC,mBAAmB,CAAC,CAAC,CAAC;KACxD;AACF;;MC3EY,sBAAsB,CAAA;;mHAAtB,sBAAsB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA;AAAtB,sBAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,sBAAsB,YAFvB,eAAe,CAAA,EAAA,CAAA,CAAA;AAEd,sBAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,sBAAsB,YAFvB,eAAe,CAAA,EAAA,CAAA,CAAA;2FAEd,sBAAsB,EAAA,UAAA,EAAA,CAAA;kBAHlC,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;oBACR,OAAO,EAAE,CAAC,eAAe,CAAC;AAC3B,iBAAA,CAAA;;;ACLD;;AAEG;;;;"}
|
|
@@ -285,6 +285,14 @@ class SkyAutocompleteInputDirective {
|
|
|
285
285
|
__classPrivateFieldGet(this, _SkyAutocompleteInputDirective_renderer, "f").removeAttribute(__classPrivateFieldGet(this, _SkyAutocompleteInputDirective_elementRef, "f").nativeElement, 'aria-activedescendant');
|
|
286
286
|
}
|
|
287
287
|
}
|
|
288
|
+
setAriaOwns(overlayId) {
|
|
289
|
+
if (overlayId) {
|
|
290
|
+
__classPrivateFieldGet(this, _SkyAutocompleteInputDirective_renderer, "f").setAttribute(__classPrivateFieldGet(this, _SkyAutocompleteInputDirective_elementRef, "f").nativeElement, 'aria-owns', overlayId);
|
|
291
|
+
}
|
|
292
|
+
else {
|
|
293
|
+
__classPrivateFieldGet(this, _SkyAutocompleteInputDirective_renderer, "f").removeAttribute(__classPrivateFieldGet(this, _SkyAutocompleteInputDirective_elementRef, "f").nativeElement, 'aria-owns');
|
|
294
|
+
}
|
|
295
|
+
}
|
|
288
296
|
// Angular automatically constructs these methods.
|
|
289
297
|
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
290
298
|
onChange(value) { }
|
|
@@ -453,7 +461,7 @@ var SkyAutocompleteMessageType;
|
|
|
453
461
|
SkyAutocompleteMessageType[SkyAutocompleteMessageType["RepositionDropdown"] = 1] = "RepositionDropdown";
|
|
454
462
|
})(SkyAutocompleteMessageType || (SkyAutocompleteMessageType = {}));
|
|
455
463
|
|
|
456
|
-
var _SkyAutocompleteComponent_instances, _SkyAutocompleteComponent_activeElementIndex, _SkyAutocompleteComponent_adapterService, _SkyAutocompleteComponent_affixer, _SkyAutocompleteComponent_affixService, _SkyAutocompleteComponent_changeDetector, _SkyAutocompleteComponent_elementRef, _SkyAutocompleteComponent_inputBoxHostSvc, _SkyAutocompleteComponent_inputDirectiveUnsubscribe, _SkyAutocompleteComponent_messageStreamSub, _SkyAutocompleteComponent_ngUnsubscribe, _SkyAutocompleteComponent_overlay, _SkyAutocompleteComponent_overlayService, _SkyAutocompleteComponent_overlayFocusableElements, _SkyAutocompleteComponent_currentSearchSub, _SkyAutocompleteComponent__data, _SkyAutocompleteComponent__debounceTime, _SkyAutocompleteComponent__descriptorProperty, _SkyAutocompleteComponent__highlightText, _SkyAutocompleteComponent__inputDirective, _SkyAutocompleteComponent__messageStream, _SkyAutocompleteComponent__propertiesToSearch, _SkyAutocompleteComponent__resultsRef, _SkyAutocompleteComponent__search, _SkyAutocompleteComponent__searchResults, _SkyAutocompleteComponent__searchResultsLimit, _SkyAutocompleteComponent__searchTextMinimumCharacters, _SkyAutocompleteComponent_searchTextChanged, _SkyAutocompleteComponent_performSearch, _SkyAutocompleteComponent_cancelCurrentSearch, _SkyAutocompleteComponent_getHighlightText, _SkyAutocompleteComponent_selectSearchResultById, _SkyAutocompleteComponent_openDropdown, _SkyAutocompleteComponent_closeDropdown, _SkyAutocompleteComponent_setActiveDescendant, _SkyAutocompleteComponent_removeActiveDescendant, _SkyAutocompleteComponent_resetSearch, _SkyAutocompleteComponent_addInputEventListeners, _SkyAutocompleteComponent_destroyOverlay, _SkyAutocompleteComponent_createAffixer, _SkyAutocompleteComponent_destroyAffixer, _SkyAutocompleteComponent_initMessageStream, _SkyAutocompleteComponent_initOverlayFocusableElements, _SkyAutocompleteComponent_getActiveElement, _SkyAutocompleteComponent_removeFocusedClass, _SkyAutocompleteComponent_addFocusedClass;
|
|
464
|
+
var _SkyAutocompleteComponent_instances, _SkyAutocompleteComponent_activeElementIndex, _SkyAutocompleteComponent_adapterService, _SkyAutocompleteComponent_affixer, _SkyAutocompleteComponent_affixService, _SkyAutocompleteComponent_changeDetector, _SkyAutocompleteComponent_elementRef, _SkyAutocompleteComponent_inputBoxHostSvc, _SkyAutocompleteComponent_inputDirectiveUnsubscribe, _SkyAutocompleteComponent_messageStreamSub, _SkyAutocompleteComponent_ngUnsubscribe, _SkyAutocompleteComponent_overlay, _SkyAutocompleteComponent_overlayService, _SkyAutocompleteComponent_overlayFocusableElements, _SkyAutocompleteComponent_currentSearchSub, _SkyAutocompleteComponent__data, _SkyAutocompleteComponent__debounceTime, _SkyAutocompleteComponent__descriptorProperty, _SkyAutocompleteComponent__highlightText, _SkyAutocompleteComponent__inputDirective, _SkyAutocompleteComponent__messageStream, _SkyAutocompleteComponent__propertiesToSearch, _SkyAutocompleteComponent__resultsRef, _SkyAutocompleteComponent__search, _SkyAutocompleteComponent__searchResults, _SkyAutocompleteComponent__searchResultsLimit, _SkyAutocompleteComponent__searchTextMinimumCharacters, _SkyAutocompleteComponent_searchTextChanged, _SkyAutocompleteComponent_performSearch, _SkyAutocompleteComponent_cancelCurrentSearch, _SkyAutocompleteComponent_getHighlightText, _SkyAutocompleteComponent_selectSearchResultById, _SkyAutocompleteComponent_openDropdown, _SkyAutocompleteComponent_closeDropdown, _SkyAutocompleteComponent_setActiveDescendant, _SkyAutocompleteComponent_removeActiveDescendant, _SkyAutocompleteComponent_updateAriaOwns, _SkyAutocompleteComponent_resetSearch, _SkyAutocompleteComponent_addInputEventListeners, _SkyAutocompleteComponent_destroyOverlay, _SkyAutocompleteComponent_createAffixer, _SkyAutocompleteComponent_destroyAffixer, _SkyAutocompleteComponent_initMessageStream, _SkyAutocompleteComponent_initOverlayFocusableElements, _SkyAutocompleteComponent_getActiveElement, _SkyAutocompleteComponent_removeFocusedClass, _SkyAutocompleteComponent_addFocusedClass;
|
|
457
465
|
let uniqueId$1 = 0;
|
|
458
466
|
class SkyAutocompleteComponent {
|
|
459
467
|
constructor(changeDetector, elementRef, affixService, adapterService, overlayService, inputBoxHostSvc) {
|
|
@@ -982,6 +990,7 @@ _SkyAutocompleteComponent_activeElementIndex = new WeakMap(), _SkyAutocompleteCo
|
|
|
982
990
|
__classPrivateFieldSet(this, _SkyAutocompleteComponent_overlay, overlay, "f");
|
|
983
991
|
this.isOpen = true;
|
|
984
992
|
__classPrivateFieldGet(this, _SkyAutocompleteComponent_changeDetector, "f").markForCheck();
|
|
993
|
+
__classPrivateFieldGet(this, _SkyAutocompleteComponent_instances, "m", _SkyAutocompleteComponent_updateAriaOwns).call(this);
|
|
985
994
|
__classPrivateFieldGet(this, _SkyAutocompleteComponent_instances, "m", _SkyAutocompleteComponent_initOverlayFocusableElements).call(this);
|
|
986
995
|
}
|
|
987
996
|
}, _SkyAutocompleteComponent_closeDropdown = function _SkyAutocompleteComponent_closeDropdown() {
|
|
@@ -989,6 +998,7 @@ _SkyAutocompleteComponent_activeElementIndex = new WeakMap(), _SkyAutocompleteCo
|
|
|
989
998
|
this.isOpen = false;
|
|
990
999
|
__classPrivateFieldGet(this, _SkyAutocompleteComponent_instances, "m", _SkyAutocompleteComponent_destroyOverlay).call(this);
|
|
991
1000
|
__classPrivateFieldGet(this, _SkyAutocompleteComponent_instances, "m", _SkyAutocompleteComponent_removeActiveDescendant).call(this);
|
|
1001
|
+
__classPrivateFieldGet(this, _SkyAutocompleteComponent_instances, "m", _SkyAutocompleteComponent_updateAriaOwns).call(this);
|
|
992
1002
|
__classPrivateFieldGet(this, _SkyAutocompleteComponent_changeDetector, "f").markForCheck();
|
|
993
1003
|
}, _SkyAutocompleteComponent_setActiveDescendant = function _SkyAutocompleteComponent_setActiveDescendant() {
|
|
994
1004
|
const activeElement = __classPrivateFieldGet(this, _SkyAutocompleteComponent_overlayFocusableElements, "f")[__classPrivateFieldGet(this, _SkyAutocompleteComponent_activeElementIndex, "f")];
|
|
@@ -1001,6 +1011,10 @@ _SkyAutocompleteComponent_activeElementIndex = new WeakMap(), _SkyAutocompleteCo
|
|
|
1001
1011
|
if (this.inputDirective) {
|
|
1002
1012
|
this.inputDirective.setActiveDescendant(null);
|
|
1003
1013
|
}
|
|
1014
|
+
}, _SkyAutocompleteComponent_updateAriaOwns = function _SkyAutocompleteComponent_updateAriaOwns() {
|
|
1015
|
+
if (this.inputDirective) {
|
|
1016
|
+
this.inputDirective.setAriaOwns(__classPrivateFieldGet(this, _SkyAutocompleteComponent_overlay, "f")?.id || null);
|
|
1017
|
+
}
|
|
1004
1018
|
}, _SkyAutocompleteComponent_resetSearch = function _SkyAutocompleteComponent_resetSearch() {
|
|
1005
1019
|
this.searchResults = [];
|
|
1006
1020
|
this.searchText = '';
|
|
@@ -1095,10 +1109,10 @@ _SkyAutocompleteComponent_activeElementIndex = new WeakMap(), _SkyAutocompleteCo
|
|
|
1095
1109
|
}
|
|
1096
1110
|
};
|
|
1097
1111
|
SkyAutocompleteComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: SkyAutocompleteComponent, deps: [{ token: i0.ChangeDetectorRef }, { token: i0.ElementRef }, { token: i1.SkyAffixService }, { token: SkyAutocompleteAdapterService }, { token: i1.SkyOverlayService }, { token: i6.SkyInputBoxHostService, optional: true }], target: i0.ɵɵFactoryTarget.Component });
|
|
1098
|
-
SkyAutocompleteComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.2", type: SkyAutocompleteComponent, selector: "sky-autocomplete", inputs: { ariaLabelledBy: "ariaLabelledBy", data: "data", debounceTime: "debounceTime", descriptorProperty: "descriptorProperty", enableShowMore: "enableShowMore", messageStream: "messageStream", wrapperClass: "wrapperClass", propertiesToSearch: "propertiesToSearch", search: "search", searchResultTemplate: "searchResultTemplate", searchTextMinimumCharacters: "searchTextMinimumCharacters", searchFilters: "searchFilters", searchResultsLimit: "searchResultsLimit", showAddButton: "showAddButton", noResultsFoundText: "noResultsFoundText", searchAsyncDisabled: "searchAsyncDisabled" }, outputs: { addClick: "addClick", showMoreClick: "showMoreClick", selectionChange: "selectionChange", searchAsync: "searchAsync" }, providers: [SkyAutocompleteAdapterService], queries: [{ propertyName: "inputDirective", first: true, predicate: SkyAutocompleteInputDirective, descendants: true }], viewQueries: [{ propertyName: "resultsTemplateRef", first: true, predicate: ["resultsTemplateRef"], descendants: true, read: TemplateRef }, { propertyName: "resultsRef", first: true, predicate: ["resultsRef"], descendants: true, read: ElementRef }], ngImport: i0, template: "<div\n aria-autocomplete=\"list\"\n aria-haspopup=\"listbox\"\n class=\"sky-autocomplete\"\n role=\"combobox\"\n [attr.aria-expanded]=\"isOpen && searchText\"\n [attr.aria-labelledby]=\"ariaLabelledBy\"\n [attr.aria-owns]=\"isOpen ? resultsListId : null\"\n [attr.id]=\"resultsWrapperId\"\n>\n <ng-content></ng-content>\n</div>\n\n<ng-template #resultsTemplateRef>\n <div\n class=\"sky-autocomplete-results-container\"\n [skyThemeClass]=\"{\n 'sky-shadow': 'default',\n 'sky-elevation-4': 'modern'\n }\"\n (keydown)=\"handleKeydown($event)\"\n #resultsRef\n >\n <div\n *ngIf=\"isSearchingAsync; else resultControlsTemplateRef\"\n class=\"sky-autocomplete-results-waiting\"\n >\n <sky-wait [isWaiting]=\"true\"></sky-wait>\n </div>\n </div>\n</ng-template>\n\n<ng-template #resultControlsTemplateRef>\n <div\n *ngIf=\"searchText && (!showActionsArea || searchResults.length > 0)\"\n class=\"sky-autocomplete-results\"\n role=\"listbox\"\n [attr.aria-labelledby]=\"ariaLabelledBy\"\n [attr.id]=\"resultsListId\"\n >\n <ng-container *ngFor=\"let result of searchResults; let i = index\">\n <div\n *ngIf=\"!searchResultsLimit || i < searchResultsLimit\"\n class=\"sky-autocomplete-result\"\n role=\"option\"\n tabindex=\"0\"\n [attr.aria-selected]=\"isElementFocused(searchResultEl)\"\n [attr.id]=\"result.elementId\"\n [skyHighlight]=\"highlightText\"\n (mousedown)=\"onResultMouseDown(result.elementId, $event)\"\n (mousemove)=\"onResultMouseMove(i)\"\n #searchResultEl\n >\n <ng-container\n *ngTemplateOutlet=\"\n searchResultTemplate || defaultSearchResultTemplate;\n context: { item: result.data }\n \"\n >\n </ng-container>\n </div>\n </ng-container>\n <div\n *ngIf=\"searchResults.length === 0\"\n class=\"sky-deemphasized sky-padding-squish-default\"\n >\n {{\n noResultsFoundText ||\n ('skyux_autocomplete_no_results' | skyLibResources)\n }}\n </div>\n </div>\n <div *ngIf=\"showActionsArea\" class=\"sky-autocomplete-actions\">\n <button\n *ngIf=\"enableShowMore && (!searchText || searchResults.length > 0)\"\n class=\"sky-autocomplete-action sky-autocomplete-action-more sky-btn sky-btn-link\"\n type=\"button\"\n (mousedown)=\"moreButtonClicked()\"\n >\n <ng-container\n *ngIf=\"\n !(\n searchAsync\n | skyAutocompleteSearchAsyncDisabled: searchAsyncDisabled\n ) &&\n searchResults.length === 0 &&\n !searchText\n \"\n >\n {{ 'skyux_autocomplete_show_all' | skyLibResources }}\n </ng-container>\n <ng-container\n *ngIf=\"\n (searchAsync\n | skyAutocompleteSearchAsyncDisabled: searchAsyncDisabled) &&\n !searchText\n \"\n >\n {{\n 'skyux_autocomplete_show_all_count'\n | skyLibResources: (data.length | skyNumeric: { truncate: false })\n }}\n </ng-container>\n <ng-container *ngIf=\"searchText\">\n {{\n 'skyux_autocomplete_show_matches_count'\n | skyLibResources\n : (searchResultsCount === undefined\n ? data.length\n : (searchResultsCount | skyNumeric: { truncate: false }))\n }}\n </ng-container>\n </button>\n <div\n *ngIf=\"searchText && searchResults.length === 0\"\n class=\"sky-font-deemphasized sky-autocomplete-actions-no-results\"\n >\n {{\n noResultsFoundText ||\n ('skyux_autocomplete_no_results' | skyLibResources)\n }}\n </div>\n <button\n *ngIf=\"showAddButton\"\n class=\"sky-autocomplete-action sky-autocomplete-action-add sky-btn sky-btn-link\"\n tabindex=\"0\"\n type=\"button\"\n [class.focused]=\"isElementFocused(addButtonEl)\"\n (mousedown)=\"addButtonClicked()\"\n #addButtonEl\n >\n <sky-icon *skyThemeIf=\"'modern'\" icon=\"add\" iconType=\"skyux\"></sky-icon>\n <sky-icon *skyThemeIf=\"'default'\" icon=\"plus-circle\"></sky-icon>\n {{ 'skyux_autocomplete_add' | skyLibResources }}\n </button>\n </div>\n</ng-template>\n\n<ng-template let-item=\"item\" #defaultSearchResultTemplate>\n {{ item[descriptorProperty] }}\n</ng-template>\n", styles: [".sky-autocomplete-results-container{position:fixed;background-color:#fff}.sky-autocomplete-results-waiting{height:70px}.sky-autocomplete-results{display:flex;flex-direction:column;padding:4px;overflow-y:auto;overflow-x:hidden;min-height:35px;max-height:calc(50vh - 50px)}.sky-autocomplete-result{color:#212327;margin-bottom:4px;padding:3px 20px;cursor:pointer}.sky-autocomplete-result:last-child{margin-bottom:0}.sky-autocomplete-actions{border-top:1px solid #cdcfd2}.sky-autocomplete-actions .sky-autocomplete-action{border:none}.sky-autocomplete-actions .sky-autocomplete-actions-no-results{display:inline-block;padding:7px 13px}.sky-autocomplete-action-add{float:right}.sky-autocomplete-action-add sky-icon{padding-right:5px}.sky-autocomplete-descendant-focus:not(.sky-autocomplete-action){background-color:#eeeeef}.sky-autocomplete-descendant-focus.sky-autocomplete-action{outline:thin dotted;outline:-webkit-focus-ring-color auto 5px}::ng-deep .sky-theme-modern .sky-autocomplete-results-container{border-radius:6px}::ng-deep .sky-theme-modern .sky-autocomplete-results{padding:10px 0}::ng-deep .sky-theme-modern .sky-autocomplete-result{margin-bottom:0;padding:10px 0 10px 15px}::ng-deep .sky-theme-modern .sky-autocomplete-descendant-focus:not(.sky-autocomplete-action){background-color:inherit}::ng-deep .sky-theme-modern .sky-autocomplete-descendant-focus{border:none;box-shadow:inset 0 0 0 2px #1870b8,0 1px 8px #0000004d}\n"], components: [{ type: i4.λ14, selector: "sky-wait", inputs: ["ariaLabel", "isWaiting", "isFullPage", "isNonBlocking"] }, { type: i4.λ4, selector: "sky-icon", inputs: ["icon", "iconType", "size", "fixedWidth", "variant"] }], directives: [{ type: i7.λ2, selector: "[skyThemeClass]", inputs: ["class", "skyThemeClass"] }, { type: i6$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i6$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i4.λ11, selector: "[skyHighlight]", inputs: ["skyHighlight"] }, { type: i6$1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }, { type: i7.λ3, selector: "[skyThemeIf]", inputs: ["skyThemeIf"] }], pipes: { "skyLibResources": i4$1.SkyLibResourcesPipe, "skyAutocompleteSearchAsyncDisabled": SkyAutcompleteSearchAsyncDisabledPipe, "skyNumeric": i1.SkyNumericPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1112
|
+
SkyAutocompleteComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.2", type: SkyAutocompleteComponent, selector: "sky-autocomplete", inputs: { ariaLabelledBy: "ariaLabelledBy", data: "data", debounceTime: "debounceTime", descriptorProperty: "descriptorProperty", enableShowMore: "enableShowMore", messageStream: "messageStream", wrapperClass: "wrapperClass", propertiesToSearch: "propertiesToSearch", search: "search", searchResultTemplate: "searchResultTemplate", searchTextMinimumCharacters: "searchTextMinimumCharacters", searchFilters: "searchFilters", searchResultsLimit: "searchResultsLimit", showAddButton: "showAddButton", noResultsFoundText: "noResultsFoundText", searchAsyncDisabled: "searchAsyncDisabled" }, outputs: { addClick: "addClick", showMoreClick: "showMoreClick", selectionChange: "selectionChange", searchAsync: "searchAsync" }, providers: [SkyAutocompleteAdapterService], queries: [{ propertyName: "inputDirective", first: true, predicate: SkyAutocompleteInputDirective, descendants: true }], viewQueries: [{ propertyName: "resultsTemplateRef", first: true, predicate: ["resultsTemplateRef"], descendants: true, read: TemplateRef }, { propertyName: "resultsRef", first: true, predicate: ["resultsRef"], descendants: true, read: ElementRef }], ngImport: i0, template: "<div\n aria-autocomplete=\"list\"\n aria-haspopup=\"listbox\"\n class=\"sky-autocomplete\"\n role=\"combobox\"\n [attr.aria-expanded]=\"isOpen && searchText\"\n [attr.aria-labelledby]=\"ariaLabelledBy\"\n [attr.aria-owns]=\"isOpen ? resultsListId : null\"\n [attr.id]=\"resultsWrapperId\"\n>\n <ng-content></ng-content>\n</div>\n\n<ng-template #resultsTemplateRef>\n <div\n class=\"sky-autocomplete-results-container\"\n [skyThemeClass]=\"{\n 'sky-shadow': 'default',\n 'sky-elevation-4': 'modern'\n }\"\n (keydown)=\"handleKeydown($event)\"\n #resultsRef\n >\n <div\n *ngIf=\"isSearchingAsync; else resultControlsTemplateRef\"\n class=\"sky-autocomplete-results-waiting\"\n >\n <sky-wait [isWaiting]=\"true\"></sky-wait>\n </div>\n </div>\n</ng-template>\n\n<ng-template #resultControlsTemplateRef>\n <div\n *ngIf=\"searchText && (!showActionsArea || searchResults.length > 0)\"\n class=\"sky-autocomplete-results\"\n role=\"listbox\"\n [attr.aria-labelledby]=\"ariaLabelledBy\"\n [attr.id]=\"resultsListId\"\n >\n <ng-container *ngFor=\"let result of searchResults; let i = index\">\n <div\n *ngIf=\"!searchResultsLimit || i < searchResultsLimit\"\n class=\"sky-autocomplete-result\"\n role=\"option\"\n tabindex=\"0\"\n [attr.aria-selected]=\"isElementFocused(searchResultEl)\"\n [attr.data-descriptor-value]=\"result.data[descriptorProperty]\"\n [attr.id]=\"result.elementId\"\n [skyHighlight]=\"highlightText\"\n (mousedown)=\"onResultMouseDown(result.elementId, $event)\"\n (mousemove)=\"onResultMouseMove(i)\"\n #searchResultEl\n >\n <ng-container\n *ngTemplateOutlet=\"\n searchResultTemplate || defaultSearchResultTemplate;\n context: { item: result.data }\n \"\n >\n </ng-container>\n </div>\n </ng-container>\n <div\n *ngIf=\"searchResults.length === 0\"\n class=\"sky-deemphasized sky-padding-squish-default\"\n >\n {{\n noResultsFoundText ||\n ('skyux_autocomplete_no_results' | skyLibResources)\n }}\n </div>\n </div>\n <div *ngIf=\"showActionsArea\" class=\"sky-autocomplete-actions\">\n <button\n *ngIf=\"enableShowMore && (!searchText || searchResults.length > 0)\"\n class=\"sky-autocomplete-action sky-autocomplete-action-more sky-btn sky-btn-link\"\n type=\"button\"\n (mousedown)=\"moreButtonClicked()\"\n >\n <ng-container\n *ngIf=\"\n !(\n searchAsync\n | skyAutocompleteSearchAsyncDisabled: searchAsyncDisabled\n ) &&\n searchResults.length === 0 &&\n !searchText\n \"\n >\n {{ 'skyux_autocomplete_show_all' | skyLibResources }}\n </ng-container>\n <ng-container\n *ngIf=\"\n (searchAsync\n | skyAutocompleteSearchAsyncDisabled: searchAsyncDisabled) &&\n !searchText\n \"\n >\n {{\n 'skyux_autocomplete_show_all_count'\n | skyLibResources: (data.length | skyNumeric: { truncate: false })\n }}\n </ng-container>\n <ng-container *ngIf=\"searchText\">\n {{\n 'skyux_autocomplete_show_matches_count'\n | skyLibResources\n : (searchResultsCount === undefined\n ? data.length\n : (searchResultsCount | skyNumeric: { truncate: false }))\n }}\n </ng-container>\n </button>\n <div\n *ngIf=\"searchText && searchResults.length === 0\"\n class=\"sky-font-deemphasized sky-autocomplete-actions-no-results\"\n >\n {{\n noResultsFoundText ||\n ('skyux_autocomplete_no_results' | skyLibResources)\n }}\n </div>\n <button\n *ngIf=\"showAddButton\"\n class=\"sky-autocomplete-action sky-autocomplete-action-add sky-btn sky-btn-link\"\n tabindex=\"0\"\n type=\"button\"\n [class.focused]=\"isElementFocused(addButtonEl)\"\n (mousedown)=\"addButtonClicked()\"\n #addButtonEl\n >\n <sky-icon *skyThemeIf=\"'modern'\" icon=\"add\" iconType=\"skyux\"></sky-icon>\n <sky-icon *skyThemeIf=\"'default'\" icon=\"plus-circle\"></sky-icon>\n {{ 'skyux_autocomplete_add' | skyLibResources }}\n </button>\n </div>\n</ng-template>\n\n<ng-template let-item=\"item\" #defaultSearchResultTemplate>\n {{ item[descriptorProperty] }}\n</ng-template>\n", styles: [".sky-autocomplete-results-container{position:fixed;background-color:#fff}.sky-autocomplete-results-waiting{height:70px}.sky-autocomplete-results{display:flex;flex-direction:column;padding:4px;overflow-y:auto;overflow-x:hidden;min-height:35px;max-height:calc(50vh - 50px)}.sky-autocomplete-result{color:#212327;margin-bottom:4px;padding:3px 20px;cursor:pointer}.sky-autocomplete-result:last-child{margin-bottom:0}.sky-autocomplete-actions{border-top:1px solid #cdcfd2}.sky-autocomplete-actions .sky-autocomplete-action{border:none}.sky-autocomplete-actions .sky-autocomplete-actions-no-results{display:inline-block;padding:7px 13px}.sky-autocomplete-action-add{float:right}.sky-autocomplete-action-add sky-icon{padding-right:5px}.sky-autocomplete-descendant-focus:not(.sky-autocomplete-action){background-color:#eeeeef}.sky-autocomplete-descendant-focus.sky-autocomplete-action{outline:thin dotted;outline:-webkit-focus-ring-color auto 5px}::ng-deep .sky-theme-modern .sky-autocomplete-results-container{border-radius:6px}::ng-deep .sky-theme-modern .sky-autocomplete-results{padding:10px 0}::ng-deep .sky-theme-modern .sky-autocomplete-result{margin-bottom:0;padding:10px 0 10px 15px}::ng-deep .sky-theme-modern .sky-autocomplete-descendant-focus:not(.sky-autocomplete-action){background-color:inherit}::ng-deep .sky-theme-modern .sky-autocomplete-descendant-focus{border:none;box-shadow:inset 0 0 0 2px #1870b8,0 1px 8px #0000004d}\n"], components: [{ type: i4.λ14, selector: "sky-wait", inputs: ["ariaLabel", "isWaiting", "isFullPage", "isNonBlocking"] }, { type: i4.λ4, selector: "sky-icon", inputs: ["icon", "iconType", "size", "fixedWidth", "variant"] }], directives: [{ type: i7.λ2, selector: "[skyThemeClass]", inputs: ["class", "skyThemeClass"] }, { type: i6$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i6$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i4.λ11, selector: "[skyHighlight]", inputs: ["skyHighlight"] }, { type: i6$1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }, { type: i7.λ3, selector: "[skyThemeIf]", inputs: ["skyThemeIf"] }], pipes: { "skyLibResources": i4$1.SkyLibResourcesPipe, "skyAutocompleteSearchAsyncDisabled": SkyAutcompleteSearchAsyncDisabledPipe, "skyNumeric": i1.SkyNumericPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1099
1113
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.2", ngImport: i0, type: SkyAutocompleteComponent, decorators: [{
|
|
1100
1114
|
type: Component,
|
|
1101
|
-
args: [{ selector: 'sky-autocomplete', providers: [SkyAutocompleteAdapterService], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div\n aria-autocomplete=\"list\"\n aria-haspopup=\"listbox\"\n class=\"sky-autocomplete\"\n role=\"combobox\"\n [attr.aria-expanded]=\"isOpen && searchText\"\n [attr.aria-labelledby]=\"ariaLabelledBy\"\n [attr.aria-owns]=\"isOpen ? resultsListId : null\"\n [attr.id]=\"resultsWrapperId\"\n>\n <ng-content></ng-content>\n</div>\n\n<ng-template #resultsTemplateRef>\n <div\n class=\"sky-autocomplete-results-container\"\n [skyThemeClass]=\"{\n 'sky-shadow': 'default',\n 'sky-elevation-4': 'modern'\n }\"\n (keydown)=\"handleKeydown($event)\"\n #resultsRef\n >\n <div\n *ngIf=\"isSearchingAsync; else resultControlsTemplateRef\"\n class=\"sky-autocomplete-results-waiting\"\n >\n <sky-wait [isWaiting]=\"true\"></sky-wait>\n </div>\n </div>\n</ng-template>\n\n<ng-template #resultControlsTemplateRef>\n <div\n *ngIf=\"searchText && (!showActionsArea || searchResults.length > 0)\"\n class=\"sky-autocomplete-results\"\n role=\"listbox\"\n [attr.aria-labelledby]=\"ariaLabelledBy\"\n [attr.id]=\"resultsListId\"\n >\n <ng-container *ngFor=\"let result of searchResults; let i = index\">\n <div\n *ngIf=\"!searchResultsLimit || i < searchResultsLimit\"\n class=\"sky-autocomplete-result\"\n role=\"option\"\n tabindex=\"0\"\n [attr.aria-selected]=\"isElementFocused(searchResultEl)\"\n [attr.id]=\"result.elementId\"\n [skyHighlight]=\"highlightText\"\n (mousedown)=\"onResultMouseDown(result.elementId, $event)\"\n (mousemove)=\"onResultMouseMove(i)\"\n #searchResultEl\n >\n <ng-container\n *ngTemplateOutlet=\"\n searchResultTemplate || defaultSearchResultTemplate;\n context: { item: result.data }\n \"\n >\n </ng-container>\n </div>\n </ng-container>\n <div\n *ngIf=\"searchResults.length === 0\"\n class=\"sky-deemphasized sky-padding-squish-default\"\n >\n {{\n noResultsFoundText ||\n ('skyux_autocomplete_no_results' | skyLibResources)\n }}\n </div>\n </div>\n <div *ngIf=\"showActionsArea\" class=\"sky-autocomplete-actions\">\n <button\n *ngIf=\"enableShowMore && (!searchText || searchResults.length > 0)\"\n class=\"sky-autocomplete-action sky-autocomplete-action-more sky-btn sky-btn-link\"\n type=\"button\"\n (mousedown)=\"moreButtonClicked()\"\n >\n <ng-container\n *ngIf=\"\n !(\n searchAsync\n | skyAutocompleteSearchAsyncDisabled: searchAsyncDisabled\n ) &&\n searchResults.length === 0 &&\n !searchText\n \"\n >\n {{ 'skyux_autocomplete_show_all' | skyLibResources }}\n </ng-container>\n <ng-container\n *ngIf=\"\n (searchAsync\n | skyAutocompleteSearchAsyncDisabled: searchAsyncDisabled) &&\n !searchText\n \"\n >\n {{\n 'skyux_autocomplete_show_all_count'\n | skyLibResources: (data.length | skyNumeric: { truncate: false })\n }}\n </ng-container>\n <ng-container *ngIf=\"searchText\">\n {{\n 'skyux_autocomplete_show_matches_count'\n | skyLibResources\n : (searchResultsCount === undefined\n ? data.length\n : (searchResultsCount | skyNumeric: { truncate: false }))\n }}\n </ng-container>\n </button>\n <div\n *ngIf=\"searchText && searchResults.length === 0\"\n class=\"sky-font-deemphasized sky-autocomplete-actions-no-results\"\n >\n {{\n noResultsFoundText ||\n ('skyux_autocomplete_no_results' | skyLibResources)\n }}\n </div>\n <button\n *ngIf=\"showAddButton\"\n class=\"sky-autocomplete-action sky-autocomplete-action-add sky-btn sky-btn-link\"\n tabindex=\"0\"\n type=\"button\"\n [class.focused]=\"isElementFocused(addButtonEl)\"\n (mousedown)=\"addButtonClicked()\"\n #addButtonEl\n >\n <sky-icon *skyThemeIf=\"'modern'\" icon=\"add\" iconType=\"skyux\"></sky-icon>\n <sky-icon *skyThemeIf=\"'default'\" icon=\"plus-circle\"></sky-icon>\n {{ 'skyux_autocomplete_add' | skyLibResources }}\n </button>\n </div>\n</ng-template>\n\n<ng-template let-item=\"item\" #defaultSearchResultTemplate>\n {{ item[descriptorProperty] }}\n</ng-template>\n", styles: [".sky-autocomplete-results-container{position:fixed;background-color:#fff}.sky-autocomplete-results-waiting{height:70px}.sky-autocomplete-results{display:flex;flex-direction:column;padding:4px;overflow-y:auto;overflow-x:hidden;min-height:35px;max-height:calc(50vh - 50px)}.sky-autocomplete-result{color:#212327;margin-bottom:4px;padding:3px 20px;cursor:pointer}.sky-autocomplete-result:last-child{margin-bottom:0}.sky-autocomplete-actions{border-top:1px solid #cdcfd2}.sky-autocomplete-actions .sky-autocomplete-action{border:none}.sky-autocomplete-actions .sky-autocomplete-actions-no-results{display:inline-block;padding:7px 13px}.sky-autocomplete-action-add{float:right}.sky-autocomplete-action-add sky-icon{padding-right:5px}.sky-autocomplete-descendant-focus:not(.sky-autocomplete-action){background-color:#eeeeef}.sky-autocomplete-descendant-focus.sky-autocomplete-action{outline:thin dotted;outline:-webkit-focus-ring-color auto 5px}::ng-deep .sky-theme-modern .sky-autocomplete-results-container{border-radius:6px}::ng-deep .sky-theme-modern .sky-autocomplete-results{padding:10px 0}::ng-deep .sky-theme-modern .sky-autocomplete-result{margin-bottom:0;padding:10px 0 10px 15px}::ng-deep .sky-theme-modern .sky-autocomplete-descendant-focus:not(.sky-autocomplete-action){background-color:inherit}::ng-deep .sky-theme-modern .sky-autocomplete-descendant-focus{border:none;box-shadow:inset 0 0 0 2px #1870b8,0 1px 8px #0000004d}\n"] }]
|
|
1115
|
+
args: [{ selector: 'sky-autocomplete', providers: [SkyAutocompleteAdapterService], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div\n aria-autocomplete=\"list\"\n aria-haspopup=\"listbox\"\n class=\"sky-autocomplete\"\n role=\"combobox\"\n [attr.aria-expanded]=\"isOpen && searchText\"\n [attr.aria-labelledby]=\"ariaLabelledBy\"\n [attr.aria-owns]=\"isOpen ? resultsListId : null\"\n [attr.id]=\"resultsWrapperId\"\n>\n <ng-content></ng-content>\n</div>\n\n<ng-template #resultsTemplateRef>\n <div\n class=\"sky-autocomplete-results-container\"\n [skyThemeClass]=\"{\n 'sky-shadow': 'default',\n 'sky-elevation-4': 'modern'\n }\"\n (keydown)=\"handleKeydown($event)\"\n #resultsRef\n >\n <div\n *ngIf=\"isSearchingAsync; else resultControlsTemplateRef\"\n class=\"sky-autocomplete-results-waiting\"\n >\n <sky-wait [isWaiting]=\"true\"></sky-wait>\n </div>\n </div>\n</ng-template>\n\n<ng-template #resultControlsTemplateRef>\n <div\n *ngIf=\"searchText && (!showActionsArea || searchResults.length > 0)\"\n class=\"sky-autocomplete-results\"\n role=\"listbox\"\n [attr.aria-labelledby]=\"ariaLabelledBy\"\n [attr.id]=\"resultsListId\"\n >\n <ng-container *ngFor=\"let result of searchResults; let i = index\">\n <div\n *ngIf=\"!searchResultsLimit || i < searchResultsLimit\"\n class=\"sky-autocomplete-result\"\n role=\"option\"\n tabindex=\"0\"\n [attr.aria-selected]=\"isElementFocused(searchResultEl)\"\n [attr.data-descriptor-value]=\"result.data[descriptorProperty]\"\n [attr.id]=\"result.elementId\"\n [skyHighlight]=\"highlightText\"\n (mousedown)=\"onResultMouseDown(result.elementId, $event)\"\n (mousemove)=\"onResultMouseMove(i)\"\n #searchResultEl\n >\n <ng-container\n *ngTemplateOutlet=\"\n searchResultTemplate || defaultSearchResultTemplate;\n context: { item: result.data }\n \"\n >\n </ng-container>\n </div>\n </ng-container>\n <div\n *ngIf=\"searchResults.length === 0\"\n class=\"sky-deemphasized sky-padding-squish-default\"\n >\n {{\n noResultsFoundText ||\n ('skyux_autocomplete_no_results' | skyLibResources)\n }}\n </div>\n </div>\n <div *ngIf=\"showActionsArea\" class=\"sky-autocomplete-actions\">\n <button\n *ngIf=\"enableShowMore && (!searchText || searchResults.length > 0)\"\n class=\"sky-autocomplete-action sky-autocomplete-action-more sky-btn sky-btn-link\"\n type=\"button\"\n (mousedown)=\"moreButtonClicked()\"\n >\n <ng-container\n *ngIf=\"\n !(\n searchAsync\n | skyAutocompleteSearchAsyncDisabled: searchAsyncDisabled\n ) &&\n searchResults.length === 0 &&\n !searchText\n \"\n >\n {{ 'skyux_autocomplete_show_all' | skyLibResources }}\n </ng-container>\n <ng-container\n *ngIf=\"\n (searchAsync\n | skyAutocompleteSearchAsyncDisabled: searchAsyncDisabled) &&\n !searchText\n \"\n >\n {{\n 'skyux_autocomplete_show_all_count'\n | skyLibResources: (data.length | skyNumeric: { truncate: false })\n }}\n </ng-container>\n <ng-container *ngIf=\"searchText\">\n {{\n 'skyux_autocomplete_show_matches_count'\n | skyLibResources\n : (searchResultsCount === undefined\n ? data.length\n : (searchResultsCount | skyNumeric: { truncate: false }))\n }}\n </ng-container>\n </button>\n <div\n *ngIf=\"searchText && searchResults.length === 0\"\n class=\"sky-font-deemphasized sky-autocomplete-actions-no-results\"\n >\n {{\n noResultsFoundText ||\n ('skyux_autocomplete_no_results' | skyLibResources)\n }}\n </div>\n <button\n *ngIf=\"showAddButton\"\n class=\"sky-autocomplete-action sky-autocomplete-action-add sky-btn sky-btn-link\"\n tabindex=\"0\"\n type=\"button\"\n [class.focused]=\"isElementFocused(addButtonEl)\"\n (mousedown)=\"addButtonClicked()\"\n #addButtonEl\n >\n <sky-icon *skyThemeIf=\"'modern'\" icon=\"add\" iconType=\"skyux\"></sky-icon>\n <sky-icon *skyThemeIf=\"'default'\" icon=\"plus-circle\"></sky-icon>\n {{ 'skyux_autocomplete_add' | skyLibResources }}\n </button>\n </div>\n</ng-template>\n\n<ng-template let-item=\"item\" #defaultSearchResultTemplate>\n {{ item[descriptorProperty] }}\n</ng-template>\n", styles: [".sky-autocomplete-results-container{position:fixed;background-color:#fff}.sky-autocomplete-results-waiting{height:70px}.sky-autocomplete-results{display:flex;flex-direction:column;padding:4px;overflow-y:auto;overflow-x:hidden;min-height:35px;max-height:calc(50vh - 50px)}.sky-autocomplete-result{color:#212327;margin-bottom:4px;padding:3px 20px;cursor:pointer}.sky-autocomplete-result:last-child{margin-bottom:0}.sky-autocomplete-actions{border-top:1px solid #cdcfd2}.sky-autocomplete-actions .sky-autocomplete-action{border:none}.sky-autocomplete-actions .sky-autocomplete-actions-no-results{display:inline-block;padding:7px 13px}.sky-autocomplete-action-add{float:right}.sky-autocomplete-action-add sky-icon{padding-right:5px}.sky-autocomplete-descendant-focus:not(.sky-autocomplete-action){background-color:#eeeeef}.sky-autocomplete-descendant-focus.sky-autocomplete-action{outline:thin dotted;outline:-webkit-focus-ring-color auto 5px}::ng-deep .sky-theme-modern .sky-autocomplete-results-container{border-radius:6px}::ng-deep .sky-theme-modern .sky-autocomplete-results{padding:10px 0}::ng-deep .sky-theme-modern .sky-autocomplete-result{margin-bottom:0;padding:10px 0 10px 15px}::ng-deep .sky-theme-modern .sky-autocomplete-descendant-focus:not(.sky-autocomplete-action){background-color:inherit}::ng-deep .sky-theme-modern .sky-autocomplete-descendant-focus{border:none;box-shadow:inset 0 0 0 2px #1870b8,0 1px 8px #0000004d}\n"] }]
|
|
1102
1116
|
}], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }, { type: i0.ElementRef }, { type: i1.SkyAffixService }, { type: SkyAutocompleteAdapterService }, { type: i1.SkyOverlayService }, { type: i6.SkyInputBoxHostService, decorators: [{
|
|
1103
1117
|
type: Optional
|
|
1104
1118
|
}] }]; }, propDecorators: { ariaLabelledBy: [{
|