@skyux/lists 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/esm2022/lib/modules/filter/filter-button.component.mjs +73 -0
- package/{esm2020 → esm2022}/lib/modules/filter/filter-inline-item.component.mjs +4 -4
- package/{esm2020 → esm2022}/lib/modules/filter/filter-inline.component.mjs +4 -4
- package/esm2022/lib/modules/filter/filter-summary-item.component.mjs +52 -0
- package/{esm2020 → esm2022}/lib/modules/filter/filter-summary.component.mjs +4 -4
- package/{esm2020 → esm2022}/lib/modules/filter/filter.module.mjs +21 -21
- package/esm2022/lib/modules/infinite-scroll/infinite-scroll-dom-adapter.service.mjs +82 -0
- package/esm2022/lib/modules/infinite-scroll/infinite-scroll.component.mjs +116 -0
- package/{esm2020 → esm2022}/lib/modules/infinite-scroll/infinite-scroll.module.mjs +5 -5
- package/esm2022/lib/modules/paging/paging.component.mjs +122 -0
- package/{esm2020 → esm2022}/lib/modules/paging/paging.module.mjs +11 -11
- package/esm2022/lib/modules/repeater/repeater-adapter.service.mjs +75 -0
- package/{esm2020 → esm2022}/lib/modules/repeater/repeater-auto-scroll.service.mjs +4 -4
- package/{esm2020 → esm2022}/lib/modules/repeater/repeater-item-content.component.mjs +4 -4
- package/{esm2020 → esm2022}/lib/modules/repeater/repeater-item-context-menu.component.mjs +4 -4
- package/{esm2020 → esm2022}/lib/modules/repeater/repeater-item-title.component.mjs +4 -4
- package/esm2022/lib/modules/repeater/repeater-item.component.mjs +504 -0
- package/esm2022/lib/modules/repeater/repeater.component.mjs +373 -0
- package/{esm2020 → esm2022}/lib/modules/repeater/repeater.module.mjs +27 -27
- package/esm2022/lib/modules/repeater/repeater.service.mjs +86 -0
- package/{esm2020 → esm2022}/lib/modules/shared/sky-lists-resources.module.mjs +11 -11
- package/esm2022/lib/modules/sort/sort-item.component.mjs +66 -0
- package/{esm2020 → esm2022}/lib/modules/sort/sort-menu-heading.component.mjs +4 -4
- package/{esm2020 → esm2022}/lib/modules/sort/sort.component.mjs +4 -4
- package/{esm2020 → esm2022}/lib/modules/sort/sort.module.mjs +17 -17
- package/{esm2020 → esm2022}/lib/modules/sort/sort.service.mjs +4 -4
- package/esm2022/testing/filter/filter-fixture-button.mjs +53 -0
- package/esm2022/testing/filter/filter-fixture-summary.mjs +31 -0
- package/{esm2020 → esm2022}/testing/filter/filter-testing.module.mjs +5 -5
- package/esm2022/testing/infinite-scroll/infinite-scroll-fixture.mjs +31 -0
- package/esm2022/testing/infinite-scroll/infinite-scroll-harness.mjs +49 -0
- package/{esm2020 → esm2022}/testing/infinite-scroll/infinite-scroll-testing.module.mjs +5 -5
- package/esm2022/testing/paging/paging-fixture.mjs +95 -0
- package/{esm2020 → esm2022}/testing/paging/paging-testing.module.mjs +5 -5
- package/esm2022/testing/repeater/repeater-harness.mjs +25 -0
- package/esm2022/testing/repeater/repeater-item-harness.mjs +167 -0
- package/esm2022/testing/sort/sort-fixture.mjs +149 -0
- package/{esm2020 → esm2022}/testing/sort/sort-testing.module.mjs +5 -5
- package/fesm2022/skyux-lists-testing.mjs +664 -0
- package/{fesm2020 → fesm2022}/skyux-lists-testing.mjs.map +1 -1
- package/fesm2022/skyux-lists.mjs +1913 -0
- package/{fesm2020 → fesm2022}/skyux-lists.mjs.map +1 -1
- package/lib/modules/filter/filter-button.component.d.ts +1 -1
- package/lib/modules/filter/filter-summary-item.component.d.ts +1 -1
- package/lib/modules/infinite-scroll/infinite-scroll.component.d.ts +1 -1
- package/lib/modules/paging/paging.component.d.ts +1 -1
- package/lib/modules/repeater/repeater-item.component.d.ts +1 -1
- package/lib/modules/repeater/repeater.component.d.ts +1 -1
- package/lib/modules/sort/sort-item.component.d.ts +1 -1
- package/lib/modules/sort/sort.component.d.ts +1 -1
- package/package.json +22 -30
- package/esm2020/lib/modules/filter/filter-button.component.mjs +0 -75
- package/esm2020/lib/modules/filter/filter-summary-item.component.mjs +0 -54
- package/esm2020/lib/modules/infinite-scroll/infinite-scroll-dom-adapter.service.mjs +0 -84
- package/esm2020/lib/modules/infinite-scroll/infinite-scroll.component.mjs +0 -116
- package/esm2020/lib/modules/paging/paging.component.mjs +0 -123
- package/esm2020/lib/modules/repeater/repeater-adapter.service.mjs +0 -73
- package/esm2020/lib/modules/repeater/repeater-item.component.mjs +0 -492
- package/esm2020/lib/modules/repeater/repeater.component.mjs +0 -357
- package/esm2020/lib/modules/repeater/repeater.service.mjs +0 -88
- package/esm2020/lib/modules/sort/sort-item.component.mjs +0 -69
- package/esm2020/testing/filter/filter-fixture-button.mjs +0 -55
- package/esm2020/testing/filter/filter-fixture-summary.mjs +0 -34
- package/esm2020/testing/infinite-scroll/infinite-scroll-fixture.mjs +0 -34
- package/esm2020/testing/infinite-scroll/infinite-scroll-harness.mjs +0 -55
- package/esm2020/testing/paging/paging-fixture.mjs +0 -91
- package/esm2020/testing/repeater/repeater-harness.mjs +0 -25
- package/esm2020/testing/repeater/repeater-item-harness.mjs +0 -173
- package/esm2020/testing/sort/sort-fixture.mjs +0 -148
- package/fesm2015/skyux-lists-testing.mjs +0 -747
- package/fesm2015/skyux-lists-testing.mjs.map +0 -1
- package/fesm2015/skyux-lists.mjs +0 -1894
- package/fesm2015/skyux-lists.mjs.map +0 -1
- package/fesm2020/skyux-lists-testing.mjs +0 -673
- package/fesm2020/skyux-lists.mjs +0 -1886
- /package/{esm2020 → esm2022}/index.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/modules/repeater/repeater-auto-scroll-options.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/modules/repeater/repeater-auto-scroller.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/modules/repeater/repeater-expand-mode-type.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/modules/repeater/repeater-item-roles.type.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/modules/repeater/repeater-role.type.mjs +0 -0
- /package/{esm2020 → esm2022}/skyux-lists.mjs +0 -0
- /package/{esm2020 → esm2022}/testing/filter/lists-filter-fixture-button.mjs +0 -0
- /package/{esm2020 → esm2022}/testing/infinite-scroll/infinite-scroll-harness-filters.mjs +0 -0
- /package/{esm2020 → esm2022}/testing/paging/paging-fixture-button.mjs +0 -0
- /package/{esm2020 → esm2022}/testing/public-api.mjs +0 -0
- /package/{esm2020 → esm2022}/testing/repeater/repeater-harness-filters.mjs +0 -0
- /package/{esm2020 → esm2022}/testing/repeater/repeater-item-harness-filters.mjs +0 -0
- /package/{esm2020 → esm2022}/testing/skyux-lists-testing.mjs +0 -0
- /package/{esm2020 → esm2022}/testing/sort/sort-fixture-menu-item.mjs +0 -0
- /package/{esm2020 → esm2022}/testing/sort/sort-fixture-menu.mjs +0 -0
|
@@ -1,673 +0,0 @@
|
|
|
1
|
-
import * as i0 from '@angular/core';
|
|
2
|
-
import { NgModule } from '@angular/core';
|
|
3
|
-
import { SkyFilterModule, SkyPagingModule, SkySortModule, SkyInfiniteScrollModule } from '@skyux/lists';
|
|
4
|
-
import { __classPrivateFieldSet, __classPrivateFieldGet } from 'tslib';
|
|
5
|
-
import { SkyAppTestUtility } from '@skyux-sdk/testing';
|
|
6
|
-
import { By } from '@angular/platform-browser';
|
|
7
|
-
import { SkyComponentHarness } from '@skyux/core/testing';
|
|
8
|
-
import { HarnessPredicate } from '@angular/cdk/testing';
|
|
9
|
-
import { SkyCheckboxHarness } from '@skyux/forms/testing';
|
|
10
|
-
import { SkyChevronHarness } from '@skyux/indicators/testing';
|
|
11
|
-
import { NoopAnimationsModule } from '@angular/platform-browser/animations';
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* @internal
|
|
15
|
-
*/
|
|
16
|
-
class SkyFilterTestingModule {
|
|
17
|
-
}
|
|
18
|
-
SkyFilterTestingModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: SkyFilterTestingModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
19
|
-
SkyFilterTestingModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.9", ngImport: i0, type: SkyFilterTestingModule, exports: [SkyFilterModule] });
|
|
20
|
-
SkyFilterTestingModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: SkyFilterTestingModule, imports: [SkyFilterModule] });
|
|
21
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: SkyFilterTestingModule, decorators: [{
|
|
22
|
-
type: NgModule,
|
|
23
|
-
args: [{
|
|
24
|
-
exports: [SkyFilterModule],
|
|
25
|
-
}]
|
|
26
|
-
}] });
|
|
27
|
-
|
|
28
|
-
var _SkyFilterFixtureSummary_debugElement, _SkyFilterFixtureSummary_fixture;
|
|
29
|
-
/**
|
|
30
|
-
* Provides information for and interaction with a SKY UX filter summary component.
|
|
31
|
-
* By using the fixture API, a test insulates itself against updates to the internals
|
|
32
|
-
* of a component, such as changing its DOM structure.
|
|
33
|
-
* @internal
|
|
34
|
-
*/
|
|
35
|
-
class SkyFilterFixtureSummary {
|
|
36
|
-
constructor(fixture, skyTestId) {
|
|
37
|
-
_SkyFilterFixtureSummary_debugElement.set(this, void 0);
|
|
38
|
-
_SkyFilterFixtureSummary_fixture.set(this, void 0);
|
|
39
|
-
__classPrivateFieldSet(this, _SkyFilterFixtureSummary_fixture, fixture, "f");
|
|
40
|
-
__classPrivateFieldSet(this, _SkyFilterFixtureSummary_debugElement, SkyAppTestUtility.getDebugElementByTestId(__classPrivateFieldGet(this, _SkyFilterFixtureSummary_fixture, "f"), skyTestId, 'sky-filter-summary'), "f");
|
|
41
|
-
}
|
|
42
|
-
async filterCloseClick(index) {
|
|
43
|
-
const summaryItems = __classPrivateFieldGet(this, _SkyFilterFixtureSummary_debugElement, "f").nativeElement.querySelectorAll('sky-filter-summary-item');
|
|
44
|
-
if (summaryItems.length > index) {
|
|
45
|
-
const summaryItem = summaryItems[index];
|
|
46
|
-
if (summaryItem instanceof HTMLElement) {
|
|
47
|
-
const closeButton = summaryItem.querySelector('.sky-token-btn-close');
|
|
48
|
-
if (closeButton instanceof HTMLElement) {
|
|
49
|
-
closeButton.click();
|
|
50
|
-
__classPrivateFieldGet(this, _SkyFilterFixtureSummary_fixture, "f").detectChanges();
|
|
51
|
-
return __classPrivateFieldGet(this, _SkyFilterFixtureSummary_fixture, "f").whenStable();
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
throw new Error(`Unable to click close for a filter index ${index}`);
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
_SkyFilterFixtureSummary_debugElement = new WeakMap(), _SkyFilterFixtureSummary_fixture = new WeakMap();
|
|
59
|
-
|
|
60
|
-
var _SkyFilterFixtureButton_instances, _SkyFilterFixtureButton_debugElement, _SkyFilterFixtureButton_fixture, _SkyFilterFixtureButton_getButtonElement, _SkyFilterFixtureButton_normalizeText;
|
|
61
|
-
/**
|
|
62
|
-
* Provides information for and interaction with a SKY UX filter button component.
|
|
63
|
-
* By using the fixture API, a test insulates itself against updates to the internals
|
|
64
|
-
* of a component, such as changing its DOM structure.
|
|
65
|
-
* @internal
|
|
66
|
-
*/
|
|
67
|
-
class SkyFilterFixtureButton {
|
|
68
|
-
constructor(fixture, skyTestId) {
|
|
69
|
-
_SkyFilterFixtureButton_instances.add(this);
|
|
70
|
-
_SkyFilterFixtureButton_debugElement.set(this, void 0);
|
|
71
|
-
_SkyFilterFixtureButton_fixture.set(this, void 0);
|
|
72
|
-
__classPrivateFieldSet(this, _SkyFilterFixtureButton_fixture, fixture, "f");
|
|
73
|
-
__classPrivateFieldSet(this, _SkyFilterFixtureButton_debugElement, SkyAppTestUtility.getDebugElementByTestId(fixture, skyTestId, 'sky-filter-button'), "f");
|
|
74
|
-
}
|
|
75
|
-
/**
|
|
76
|
-
* Click the button to apply the filter.
|
|
77
|
-
*/
|
|
78
|
-
async clickFilterButton() {
|
|
79
|
-
const button = __classPrivateFieldGet(this, _SkyFilterFixtureButton_instances, "m", _SkyFilterFixtureButton_getButtonElement).call(this);
|
|
80
|
-
if (button instanceof HTMLButtonElement && !button.disabled) {
|
|
81
|
-
button.click();
|
|
82
|
-
}
|
|
83
|
-
__classPrivateFieldGet(this, _SkyFilterFixtureButton_fixture, "f").detectChanges();
|
|
84
|
-
return __classPrivateFieldGet(this, _SkyFilterFixtureButton_fixture, "f").whenStable();
|
|
85
|
-
}
|
|
86
|
-
get button() {
|
|
87
|
-
const buttonElement = __classPrivateFieldGet(this, _SkyFilterFixtureButton_instances, "m", _SkyFilterFixtureButton_getButtonElement).call(this);
|
|
88
|
-
return {
|
|
89
|
-
ariaControls: buttonElement?.getAttribute('aria-controls') ?? undefined,
|
|
90
|
-
ariaExpanded: buttonElement?.getAttribute('aria-expanded') === 'true',
|
|
91
|
-
disabled: !!buttonElement?.disabled,
|
|
92
|
-
id: buttonElement?.id,
|
|
93
|
-
};
|
|
94
|
-
}
|
|
95
|
-
/**
|
|
96
|
-
* Get the button text.
|
|
97
|
-
*/
|
|
98
|
-
get buttonText() {
|
|
99
|
-
const text = __classPrivateFieldGet(this, _SkyFilterFixtureButton_instances, "m", _SkyFilterFixtureButton_getButtonElement).call(this)?.innerText;
|
|
100
|
-
return __classPrivateFieldGet(this, _SkyFilterFixtureButton_instances, "m", _SkyFilterFixtureButton_normalizeText).call(this, text);
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
_SkyFilterFixtureButton_debugElement = new WeakMap(), _SkyFilterFixtureButton_fixture = new WeakMap(), _SkyFilterFixtureButton_instances = new WeakSet(), _SkyFilterFixtureButton_getButtonElement = function _SkyFilterFixtureButton_getButtonElement() {
|
|
104
|
-
return __classPrivateFieldGet(this, _SkyFilterFixtureButton_debugElement, "f").nativeElement.querySelector('.sky-filter-btn');
|
|
105
|
-
}, _SkyFilterFixtureButton_normalizeText = function _SkyFilterFixtureButton_normalizeText(text) {
|
|
106
|
-
let retVal = '';
|
|
107
|
-
if (text) {
|
|
108
|
-
retVal = text?.trim().replace(/\s+/g, ' ');
|
|
109
|
-
}
|
|
110
|
-
return retVal;
|
|
111
|
-
};
|
|
112
|
-
|
|
113
|
-
/**
|
|
114
|
-
* @internal
|
|
115
|
-
*/
|
|
116
|
-
class SkyPagingTestingModule {
|
|
117
|
-
}
|
|
118
|
-
SkyPagingTestingModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: SkyPagingTestingModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
119
|
-
SkyPagingTestingModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.9", ngImport: i0, type: SkyPagingTestingModule, exports: [SkyPagingModule] });
|
|
120
|
-
SkyPagingTestingModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: SkyPagingTestingModule, imports: [SkyPagingModule] });
|
|
121
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: SkyPagingTestingModule, decorators: [{
|
|
122
|
-
type: NgModule,
|
|
123
|
-
args: [{
|
|
124
|
-
exports: [SkyPagingModule],
|
|
125
|
-
}]
|
|
126
|
-
}] });
|
|
127
|
-
|
|
128
|
-
var _SkyPagingFixture_instances, _SkyPagingFixture__debugEl, _SkyPagingFixture_fixture, _SkyPagingFixture_activePageButton_get, _SkyPagingFixture_nextPageButton_get, _SkyPagingFixture_previousPageButton_get, _SkyPagingFixture_pagingLinks_get, _SkyPagingFixture_getPageLink, _SkyPagingFixture_getPageId, _SkyPagingFixture_waitForComponentInitialization;
|
|
129
|
-
/**
|
|
130
|
-
* Provides information for and interaction with a SKY UX paging component.
|
|
131
|
-
* By using the fixture API, a test insulates itself against updates to the internals
|
|
132
|
-
* of a component, such as changing its DOM structure.
|
|
133
|
-
* @internal
|
|
134
|
-
*/
|
|
135
|
-
class SkyPagingFixture {
|
|
136
|
-
/**
|
|
137
|
-
* The id of the active page, if available.
|
|
138
|
-
*/
|
|
139
|
-
get activePageId() {
|
|
140
|
-
return __classPrivateFieldGet(this, _SkyPagingFixture_instances, "m", _SkyPagingFixture_getPageId).call(this, __classPrivateFieldGet(this, _SkyPagingFixture_instances, "a", _SkyPagingFixture_activePageButton_get));
|
|
141
|
-
}
|
|
142
|
-
/**
|
|
143
|
-
* Properties of the page links displayed in the paging component.
|
|
144
|
-
*/
|
|
145
|
-
get pageLinks() {
|
|
146
|
-
return __classPrivateFieldGet(this, _SkyPagingFixture_instances, "a", _SkyPagingFixture_pagingLinks_get).map((page) => {
|
|
147
|
-
return {
|
|
148
|
-
id: __classPrivateFieldGet(this, _SkyPagingFixture_instances, "m", _SkyPagingFixture_getPageId).call(this, page.nativeElement),
|
|
149
|
-
isActive: page.nativeElement.classList.contains('sky-paging-current'),
|
|
150
|
-
isEnabled: !page.nativeElement.disabled,
|
|
151
|
-
};
|
|
152
|
-
});
|
|
153
|
-
}
|
|
154
|
-
constructor(fixture, skyTestId) {
|
|
155
|
-
_SkyPagingFixture_instances.add(this);
|
|
156
|
-
_SkyPagingFixture__debugEl.set(this, void 0);
|
|
157
|
-
_SkyPagingFixture_fixture.set(this, void 0);
|
|
158
|
-
__classPrivateFieldSet(this, _SkyPagingFixture_fixture, fixture, "f");
|
|
159
|
-
__classPrivateFieldSet(this, _SkyPagingFixture__debugEl, SkyAppTestUtility.getDebugElementByTestId(fixture, skyTestId, 'sky-paging'), "f");
|
|
160
|
-
__classPrivateFieldGet(this, _SkyPagingFixture_instances, "m", _SkyPagingFixture_waitForComponentInitialization).call(this);
|
|
161
|
-
}
|
|
162
|
-
/**
|
|
163
|
-
* Selects the specified page by id, if it is enabled.
|
|
164
|
-
*/
|
|
165
|
-
async selectPage(id) {
|
|
166
|
-
const pageButton = __classPrivateFieldGet(this, _SkyPagingFixture_instances, "m", _SkyPagingFixture_getPageLink).call(this, id.toString());
|
|
167
|
-
if (pageButton !== undefined && !pageButton.disabled) {
|
|
168
|
-
pageButton.click();
|
|
169
|
-
__classPrivateFieldGet(this, _SkyPagingFixture_fixture, "f").detectChanges();
|
|
170
|
-
return __classPrivateFieldGet(this, _SkyPagingFixture_fixture, "f").whenStable();
|
|
171
|
-
}
|
|
172
|
-
}
|
|
173
|
-
/**
|
|
174
|
-
* Clicks the next page button, if it is enabled.
|
|
175
|
-
*/
|
|
176
|
-
async selectNextPage() {
|
|
177
|
-
const nextButton = __classPrivateFieldGet(this, _SkyPagingFixture_instances, "a", _SkyPagingFixture_nextPageButton_get);
|
|
178
|
-
if (nextButton !== undefined && !nextButton.disabled) {
|
|
179
|
-
nextButton.click();
|
|
180
|
-
__classPrivateFieldGet(this, _SkyPagingFixture_fixture, "f").detectChanges();
|
|
181
|
-
return __classPrivateFieldGet(this, _SkyPagingFixture_fixture, "f").whenStable();
|
|
182
|
-
}
|
|
183
|
-
}
|
|
184
|
-
/**
|
|
185
|
-
* Clicks the previous page button, if it is enabled.
|
|
186
|
-
*/
|
|
187
|
-
async selectPreviousPage() {
|
|
188
|
-
const previousButton = __classPrivateFieldGet(this, _SkyPagingFixture_instances, "a", _SkyPagingFixture_previousPageButton_get);
|
|
189
|
-
if (previousButton !== undefined && !previousButton.disabled) {
|
|
190
|
-
previousButton.click();
|
|
191
|
-
__classPrivateFieldGet(this, _SkyPagingFixture_fixture, "f").detectChanges();
|
|
192
|
-
return __classPrivateFieldGet(this, _SkyPagingFixture_fixture, "f").whenStable();
|
|
193
|
-
}
|
|
194
|
-
}
|
|
195
|
-
}
|
|
196
|
-
_SkyPagingFixture__debugEl = new WeakMap(), _SkyPagingFixture_fixture = new WeakMap(), _SkyPagingFixture_instances = new WeakSet(), _SkyPagingFixture_activePageButton_get = function _SkyPagingFixture_activePageButton_get() {
|
|
197
|
-
return __classPrivateFieldGet(this, _SkyPagingFixture__debugEl, "f").query(By.css('.sky-list-paging-link .sky-paging-current'))?.nativeElement;
|
|
198
|
-
}, _SkyPagingFixture_nextPageButton_get = function _SkyPagingFixture_nextPageButton_get() {
|
|
199
|
-
return __classPrivateFieldGet(this, _SkyPagingFixture__debugEl, "f").query(By.css('.sky-paging-btn[sky-cmp-id="next"]'))
|
|
200
|
-
?.nativeElement;
|
|
201
|
-
}, _SkyPagingFixture_previousPageButton_get = function _SkyPagingFixture_previousPageButton_get() {
|
|
202
|
-
return __classPrivateFieldGet(this, _SkyPagingFixture__debugEl, "f").query(By.css('.sky-paging-btn[sky-cmp-id="previous"]'))?.nativeElement;
|
|
203
|
-
}, _SkyPagingFixture_pagingLinks_get = function _SkyPagingFixture_pagingLinks_get() {
|
|
204
|
-
return __classPrivateFieldGet(this, _SkyPagingFixture__debugEl, "f").queryAll(By.css('.sky-list-paging-link button'));
|
|
205
|
-
}, _SkyPagingFixture_getPageLink = function _SkyPagingFixture_getPageLink(id) {
|
|
206
|
-
return __classPrivateFieldGet(this, _SkyPagingFixture__debugEl, "f").query(By.css(`.sky-list-paging-link button[sky-cmp-id="${id}"]`))?.nativeElement;
|
|
207
|
-
}, _SkyPagingFixture_getPageId = function _SkyPagingFixture_getPageId(page) {
|
|
208
|
-
return page?.getAttribute('sky-cmp-id') ?? '';
|
|
209
|
-
}, _SkyPagingFixture_waitForComponentInitialization = async function _SkyPagingFixture_waitForComponentInitialization() {
|
|
210
|
-
__classPrivateFieldGet(this, _SkyPagingFixture_fixture, "f").detectChanges();
|
|
211
|
-
await __classPrivateFieldGet(this, _SkyPagingFixture_fixture, "f").whenStable();
|
|
212
|
-
__classPrivateFieldGet(this, _SkyPagingFixture_fixture, "f").detectChanges();
|
|
213
|
-
return __classPrivateFieldGet(this, _SkyPagingFixture_fixture, "f").whenStable();
|
|
214
|
-
};
|
|
215
|
-
|
|
216
|
-
var _SkyRepeaterItemHarness_getBackToTop, _SkyRepeaterItemHarness_getCheckbox, _SkyRepeaterItemHarness_getChevron, _SkyRepeaterItemHarness_getContent, _SkyRepeaterItemHarness_getItem, _SkyRepeaterItemHarness_getReorderHandle, _SkyRepeaterItemHarness_getTitle;
|
|
217
|
-
/**
|
|
218
|
-
* Harness for interacting with a repeater item component in tests.
|
|
219
|
-
*/
|
|
220
|
-
class SkyRepeaterItemHarness extends SkyComponentHarness {
|
|
221
|
-
constructor() {
|
|
222
|
-
super(...arguments);
|
|
223
|
-
_SkyRepeaterItemHarness_getBackToTop.set(this, this.locatorForOptional('button.sky-repeater-item-reorder-top'));
|
|
224
|
-
_SkyRepeaterItemHarness_getCheckbox.set(this, this.locatorForOptional(SkyCheckboxHarness));
|
|
225
|
-
_SkyRepeaterItemHarness_getChevron.set(this, this.locatorForOptional(SkyChevronHarness));
|
|
226
|
-
_SkyRepeaterItemHarness_getContent.set(this, this.locatorFor('.sky-repeater-item-content'));
|
|
227
|
-
_SkyRepeaterItemHarness_getItem.set(this, this.locatorFor('.sky-repeater-item'));
|
|
228
|
-
_SkyRepeaterItemHarness_getReorderHandle.set(this, this.locatorForOptional('button.sky-repeater-item-grab-handle'));
|
|
229
|
-
_SkyRepeaterItemHarness_getTitle.set(this, this.locatorFor('.sky-repeater-item-title'));
|
|
230
|
-
}
|
|
231
|
-
/**
|
|
232
|
-
* Gets a `HarnessPredicate` that can be used to search for a
|
|
233
|
-
* `SkyRepeaterItemHarness` that meets certain criteria.
|
|
234
|
-
*/
|
|
235
|
-
static with(filters) {
|
|
236
|
-
return SkyRepeaterItemHarness.getDataSkyIdPredicate(filters)
|
|
237
|
-
.addOption('contentText', filters.contentText, async (harness, text) => HarnessPredicate.stringMatches(await harness.getContentText(), text))
|
|
238
|
-
.addOption('titleText', filters.titleText, async (harness, text) => HarnessPredicate.stringMatches(await harness.getTitleText(), text));
|
|
239
|
-
}
|
|
240
|
-
/**
|
|
241
|
-
* Returns a child harness.
|
|
242
|
-
*/
|
|
243
|
-
async queryHarness(query) {
|
|
244
|
-
return this.locatorForOptional(query)();
|
|
245
|
-
}
|
|
246
|
-
/**
|
|
247
|
-
* Returns child harnesses.
|
|
248
|
-
*/
|
|
249
|
-
async queryHarnesses(harness) {
|
|
250
|
-
return this.locatorForAll(harness)();
|
|
251
|
-
}
|
|
252
|
-
/**
|
|
253
|
-
* Returns a child test element.
|
|
254
|
-
*/
|
|
255
|
-
async querySelector(selector) {
|
|
256
|
-
return this.locatorForOptional(selector)();
|
|
257
|
-
}
|
|
258
|
-
/**
|
|
259
|
-
* Returns child test elements.
|
|
260
|
-
*/
|
|
261
|
-
async querySelectorAll(selector) {
|
|
262
|
-
return this.locatorForAll(selector)();
|
|
263
|
-
}
|
|
264
|
-
/**
|
|
265
|
-
* Clicks on the repeater item.
|
|
266
|
-
*/
|
|
267
|
-
async click() {
|
|
268
|
-
await (await __classPrivateFieldGet(this, _SkyRepeaterItemHarness_getItem, "f").call(this)).click();
|
|
269
|
-
}
|
|
270
|
-
/**
|
|
271
|
-
* Whether the repeater item is selectable.
|
|
272
|
-
*/
|
|
273
|
-
async isSelectable() {
|
|
274
|
-
return !!(await __classPrivateFieldGet(this, _SkyRepeaterItemHarness_getCheckbox, "f").call(this));
|
|
275
|
-
}
|
|
276
|
-
/**
|
|
277
|
-
* Whether the repeater item is selected.
|
|
278
|
-
*/
|
|
279
|
-
async isSelected() {
|
|
280
|
-
const checkbox = await __classPrivateFieldGet(this, _SkyRepeaterItemHarness_getCheckbox, "f").call(this);
|
|
281
|
-
if (!checkbox) {
|
|
282
|
-
throw new Error('Could not determine if repeater item is selected because it is not selectable.');
|
|
283
|
-
}
|
|
284
|
-
return checkbox.isChecked();
|
|
285
|
-
}
|
|
286
|
-
/**
|
|
287
|
-
* Selects the repeater item.
|
|
288
|
-
*/
|
|
289
|
-
async select() {
|
|
290
|
-
const checkbox = await __classPrivateFieldGet(this, _SkyRepeaterItemHarness_getCheckbox, "f").call(this);
|
|
291
|
-
if (!checkbox) {
|
|
292
|
-
throw new Error('Could not select the repeater item because it is not selectable.');
|
|
293
|
-
}
|
|
294
|
-
await checkbox.check();
|
|
295
|
-
}
|
|
296
|
-
/**
|
|
297
|
-
* Deselects the repeater item.
|
|
298
|
-
*/
|
|
299
|
-
async deselect() {
|
|
300
|
-
const checkbox = await __classPrivateFieldGet(this, _SkyRepeaterItemHarness_getCheckbox, "f").call(this);
|
|
301
|
-
if (!checkbox) {
|
|
302
|
-
throw new Error('Could not deselect the repeater item because it is not selectable.');
|
|
303
|
-
}
|
|
304
|
-
await checkbox.uncheck();
|
|
305
|
-
}
|
|
306
|
-
/**
|
|
307
|
-
* Gets the text of the repeater item content.
|
|
308
|
-
*/
|
|
309
|
-
async getContentText() {
|
|
310
|
-
return (await __classPrivateFieldGet(this, _SkyRepeaterItemHarness_getContent, "f").call(this)).text();
|
|
311
|
-
}
|
|
312
|
-
/**
|
|
313
|
-
* Gets the text of the repeater item title.
|
|
314
|
-
*/
|
|
315
|
-
async getTitleText() {
|
|
316
|
-
return (await __classPrivateFieldGet(this, _SkyRepeaterItemHarness_getTitle, "f").call(this)).text();
|
|
317
|
-
}
|
|
318
|
-
/**
|
|
319
|
-
* Whether the repeater item is collapsible.
|
|
320
|
-
*/
|
|
321
|
-
async isCollapsible() {
|
|
322
|
-
return !!(await __classPrivateFieldGet(this, _SkyRepeaterItemHarness_getChevron, "f").call(this));
|
|
323
|
-
}
|
|
324
|
-
/**
|
|
325
|
-
* Whether the repeater item is expanded, or throws an error informing of the lack of collapsibility.
|
|
326
|
-
*/
|
|
327
|
-
async isExpanded() {
|
|
328
|
-
const chevron = await __classPrivateFieldGet(this, _SkyRepeaterItemHarness_getChevron, "f").call(this);
|
|
329
|
-
if (chevron) {
|
|
330
|
-
return (await chevron.getDirection()) === 'up';
|
|
331
|
-
}
|
|
332
|
-
throw new Error('Could not determine if repeater item is expanded because it is not collapsible.');
|
|
333
|
-
}
|
|
334
|
-
/**
|
|
335
|
-
* Expands the repeater item, or does nothing if already expanded.
|
|
336
|
-
*/
|
|
337
|
-
async expand() {
|
|
338
|
-
const chevron = await __classPrivateFieldGet(this, _SkyRepeaterItemHarness_getChevron, "f").call(this);
|
|
339
|
-
if (chevron) {
|
|
340
|
-
if ((await chevron.getDirection()) === 'down') {
|
|
341
|
-
await chevron.toggle();
|
|
342
|
-
}
|
|
343
|
-
return;
|
|
344
|
-
}
|
|
345
|
-
throw new Error('Could not expand the repeater item because it is not collapsible.');
|
|
346
|
-
}
|
|
347
|
-
/**
|
|
348
|
-
* Collapses the repeater item, or does nothing if already collapsed.
|
|
349
|
-
*/
|
|
350
|
-
async collapse() {
|
|
351
|
-
const chevron = await __classPrivateFieldGet(this, _SkyRepeaterItemHarness_getChevron, "f").call(this);
|
|
352
|
-
if (chevron) {
|
|
353
|
-
if ((await chevron.getDirection()) === 'up') {
|
|
354
|
-
await chevron.toggle();
|
|
355
|
-
}
|
|
356
|
-
return;
|
|
357
|
-
}
|
|
358
|
-
throw new Error('Could not collapse the repeater item because it is not collapsible.');
|
|
359
|
-
}
|
|
360
|
-
/**
|
|
361
|
-
* Whether the repeater item is reorderable.
|
|
362
|
-
*/
|
|
363
|
-
async isReorderable() {
|
|
364
|
-
return !!(await __classPrivateFieldGet(this, _SkyRepeaterItemHarness_getReorderHandle, "f").call(this));
|
|
365
|
-
}
|
|
366
|
-
/**
|
|
367
|
-
* Moves the repeater item to the top of the list
|
|
368
|
-
*/
|
|
369
|
-
async sendToTop() {
|
|
370
|
-
if (await this.isReorderable()) {
|
|
371
|
-
await (await __classPrivateFieldGet(this, _SkyRepeaterItemHarness_getBackToTop, "f").call(this))?.click();
|
|
372
|
-
}
|
|
373
|
-
else {
|
|
374
|
-
throw new Error('Could not send to top because the repeater is not reorderable.');
|
|
375
|
-
}
|
|
376
|
-
}
|
|
377
|
-
}
|
|
378
|
-
_SkyRepeaterItemHarness_getBackToTop = new WeakMap(), _SkyRepeaterItemHarness_getCheckbox = new WeakMap(), _SkyRepeaterItemHarness_getChevron = new WeakMap(), _SkyRepeaterItemHarness_getContent = new WeakMap(), _SkyRepeaterItemHarness_getItem = new WeakMap(), _SkyRepeaterItemHarness_getReorderHandle = new WeakMap(), _SkyRepeaterItemHarness_getTitle = new WeakMap();
|
|
379
|
-
/**
|
|
380
|
-
* @internal
|
|
381
|
-
*/
|
|
382
|
-
SkyRepeaterItemHarness.hostSelector = 'sky-repeater-item';
|
|
383
|
-
|
|
384
|
-
/**
|
|
385
|
-
* Harness for interacting with a repeater component in tests.
|
|
386
|
-
*/
|
|
387
|
-
class SkyRepeaterHarness extends SkyComponentHarness {
|
|
388
|
-
/**
|
|
389
|
-
* Gets a `HarnessPredicate` that can be used to search for a
|
|
390
|
-
* `SkyRepeaterHarness` that meets certain criteria.
|
|
391
|
-
*/
|
|
392
|
-
static with(filters) {
|
|
393
|
-
return SkyRepeaterHarness.getDataSkyIdPredicate(filters);
|
|
394
|
-
}
|
|
395
|
-
/**
|
|
396
|
-
* Gets a list of child repeater items.
|
|
397
|
-
*/
|
|
398
|
-
async getRepeaterItems(filters) {
|
|
399
|
-
return this.locatorForAll(SkyRepeaterItemHarness.with(filters || {}))();
|
|
400
|
-
}
|
|
401
|
-
}
|
|
402
|
-
/**
|
|
403
|
-
* @internal
|
|
404
|
-
*/
|
|
405
|
-
SkyRepeaterHarness.hostSelector = 'sky-repeater';
|
|
406
|
-
|
|
407
|
-
/**
|
|
408
|
-
* @internal
|
|
409
|
-
*/
|
|
410
|
-
class SkySortTestingModule {
|
|
411
|
-
}
|
|
412
|
-
SkySortTestingModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: SkySortTestingModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
413
|
-
SkySortTestingModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.9", ngImport: i0, type: SkySortTestingModule, imports: [NoopAnimationsModule], exports: [SkySortModule] });
|
|
414
|
-
SkySortTestingModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: SkySortTestingModule, imports: [NoopAnimationsModule, SkySortModule] });
|
|
415
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: SkySortTestingModule, decorators: [{
|
|
416
|
-
type: NgModule,
|
|
417
|
-
args: [{
|
|
418
|
-
imports: [NoopAnimationsModule],
|
|
419
|
-
exports: [SkySortModule],
|
|
420
|
-
}]
|
|
421
|
-
}] });
|
|
422
|
-
|
|
423
|
-
var _SkySortFixture_instances, _SkySortFixture_debugEl, _SkySortFixture_fixture, _SkySortFixture_getDropdownButtonEl, _SkySortFixture_getDropdownMenuEl, _SkySortFixture_getSortButtonTextEl, _SkySortFixture_getSortItems, _SkySortFixture_selectMenuItem;
|
|
424
|
-
/**
|
|
425
|
-
* Provides information for and interaction with a SKY UX sort component.
|
|
426
|
-
* By using the fixture API, a test insulates itself against updates to the internals
|
|
427
|
-
* of a component, such as changing its DOM structure.
|
|
428
|
-
* @internal
|
|
429
|
-
*/
|
|
430
|
-
class SkySortFixture {
|
|
431
|
-
/**
|
|
432
|
-
* The active sort menu item, if one exists. Menu items are only available when the menu dropdown
|
|
433
|
-
* is open. If the menu dropdown is closed, this property will be undefined.
|
|
434
|
-
*/
|
|
435
|
-
get activeMenuItem() {
|
|
436
|
-
return this.menuItems?.find((x) => x.isActive);
|
|
437
|
-
}
|
|
438
|
-
/**
|
|
439
|
-
* The sort menu's properties.
|
|
440
|
-
*/
|
|
441
|
-
get menu() {
|
|
442
|
-
/* istanbul ignore next */
|
|
443
|
-
const buttonText = SkyAppTestUtility.getText(__classPrivateFieldGet(this, _SkySortFixture_instances, "m", _SkySortFixture_getSortButtonTextEl).call(this)) || '';
|
|
444
|
-
return {
|
|
445
|
-
buttonText,
|
|
446
|
-
isOpen: __classPrivateFieldGet(this, _SkySortFixture_instances, "m", _SkySortFixture_getDropdownMenuEl).call(this) !== null,
|
|
447
|
-
};
|
|
448
|
-
}
|
|
449
|
-
/**
|
|
450
|
-
* The properties of each sort menu item. Menu items are only available when the menu dropdown
|
|
451
|
-
* is open. If the menu dropdown is closed, this property will be undefined.
|
|
452
|
-
*/
|
|
453
|
-
get menuItems() {
|
|
454
|
-
// Return undefined when we can't determine what the options are.
|
|
455
|
-
// We do this to avoid any confusion with an empty set of options.
|
|
456
|
-
if (!this.menu.isOpen) {
|
|
457
|
-
return;
|
|
458
|
-
}
|
|
459
|
-
return __classPrivateFieldGet(this, _SkySortFixture_instances, "m", _SkySortFixture_getSortItems).call(this).map((item, i) => {
|
|
460
|
-
const itemButton = item.querySelector('button');
|
|
461
|
-
return {
|
|
462
|
-
index: i,
|
|
463
|
-
isActive: item.classList.contains('sky-sort-item-selected'),
|
|
464
|
-
text: SkyAppTestUtility.getText(itemButton),
|
|
465
|
-
};
|
|
466
|
-
});
|
|
467
|
-
}
|
|
468
|
-
constructor(fixture, skyTestId) {
|
|
469
|
-
_SkySortFixture_instances.add(this);
|
|
470
|
-
_SkySortFixture_debugEl.set(this, void 0);
|
|
471
|
-
_SkySortFixture_fixture.set(this, void 0);
|
|
472
|
-
__classPrivateFieldSet(this, _SkySortFixture_fixture, fixture, "f");
|
|
473
|
-
__classPrivateFieldSet(this, _SkySortFixture_debugEl, SkyAppTestUtility.getDebugElementByTestId(fixture, skyTestId, 'sky-sort'), "f");
|
|
474
|
-
}
|
|
475
|
-
/**
|
|
476
|
-
* Closes the sort dropdown menu if it isn't closed already.
|
|
477
|
-
*/
|
|
478
|
-
async closeMenu() {
|
|
479
|
-
// if the menu is already closed, do nothing
|
|
480
|
-
if (!this.menu.isOpen) {
|
|
481
|
-
return;
|
|
482
|
-
}
|
|
483
|
-
const menu = __classPrivateFieldGet(this, _SkySortFixture_instances, "m", _SkySortFixture_getDropdownButtonEl).call(this);
|
|
484
|
-
if (menu !== undefined && !menu.disabled) {
|
|
485
|
-
menu.click();
|
|
486
|
-
__classPrivateFieldGet(this, _SkySortFixture_fixture, "f").detectChanges();
|
|
487
|
-
await __classPrivateFieldGet(this, _SkySortFixture_fixture, "f").whenStable();
|
|
488
|
-
__classPrivateFieldGet(this, _SkySortFixture_fixture, "f").detectChanges();
|
|
489
|
-
return __classPrivateFieldGet(this, _SkySortFixture_fixture, "f").whenStable();
|
|
490
|
-
}
|
|
491
|
-
}
|
|
492
|
-
/**
|
|
493
|
-
* Opens the sort dropdown menu if it isn't open already.
|
|
494
|
-
*/
|
|
495
|
-
async openMenu() {
|
|
496
|
-
// if the menu is already open, do nothing
|
|
497
|
-
if (this.menu.isOpen) {
|
|
498
|
-
return;
|
|
499
|
-
}
|
|
500
|
-
const menu = __classPrivateFieldGet(this, _SkySortFixture_instances, "m", _SkySortFixture_getDropdownButtonEl).call(this);
|
|
501
|
-
if (menu !== undefined && !menu.disabled) {
|
|
502
|
-
menu.click();
|
|
503
|
-
__classPrivateFieldGet(this, _SkySortFixture_fixture, "f").detectChanges();
|
|
504
|
-
await __classPrivateFieldGet(this, _SkySortFixture_fixture, "f").whenStable();
|
|
505
|
-
__classPrivateFieldGet(this, _SkySortFixture_fixture, "f").detectChanges();
|
|
506
|
-
return __classPrivateFieldGet(this, _SkySortFixture_fixture, "f").whenStable();
|
|
507
|
-
}
|
|
508
|
-
}
|
|
509
|
-
/**
|
|
510
|
-
* Ensures the sort menu is open and selects the menu item with the specified index, if it exists.
|
|
511
|
-
* @param menuItemIndex The index of the menu item to select.
|
|
512
|
-
*/
|
|
513
|
-
async selectMenuItemByIndex(menuItemIndex) {
|
|
514
|
-
return __classPrivateFieldGet(this, _SkySortFixture_instances, "m", _SkySortFixture_selectMenuItem).call(this, (_item, index) => {
|
|
515
|
-
return index === menuItemIndex;
|
|
516
|
-
});
|
|
517
|
-
}
|
|
518
|
-
/**
|
|
519
|
-
* Ensures the sort menu is open and selects the menu item with the specified text,
|
|
520
|
-
* if a matching item is available.
|
|
521
|
-
* @param menuItemText The text of the menu item to select.
|
|
522
|
-
*/
|
|
523
|
-
async selectMenuItemByText(menuItemText) {
|
|
524
|
-
/* istanbul ignore else */
|
|
525
|
-
if (menuItemText) {
|
|
526
|
-
return __classPrivateFieldGet(this, _SkySortFixture_instances, "m", _SkySortFixture_selectMenuItem).call(this, (item) => {
|
|
527
|
-
return SkyAppTestUtility.getText(item) === menuItemText;
|
|
528
|
-
});
|
|
529
|
-
}
|
|
530
|
-
else {
|
|
531
|
-
return;
|
|
532
|
-
}
|
|
533
|
-
}
|
|
534
|
-
}
|
|
535
|
-
_SkySortFixture_debugEl = new WeakMap(), _SkySortFixture_fixture = new WeakMap(), _SkySortFixture_instances = new WeakSet(), _SkySortFixture_getDropdownButtonEl = function _SkySortFixture_getDropdownButtonEl() {
|
|
536
|
-
return __classPrivateFieldGet(this, _SkySortFixture_debugEl, "f").query(By.css('.sky-dropdown-button')).nativeElement;
|
|
537
|
-
}, _SkySortFixture_getDropdownMenuEl = function _SkySortFixture_getDropdownMenuEl() {
|
|
538
|
-
return document.querySelector('sky-overlay .sky-dropdown-menu');
|
|
539
|
-
}, _SkySortFixture_getSortButtonTextEl = function _SkySortFixture_getSortButtonTextEl() {
|
|
540
|
-
return __classPrivateFieldGet(this, _SkySortFixture_debugEl, "f").query(By.css('.sky-sort-btn-text')).nativeElement;
|
|
541
|
-
}, _SkySortFixture_getSortItems = function _SkySortFixture_getSortItems() {
|
|
542
|
-
const resultNodes = document.querySelectorAll('sky-overlay .sky-sort-item');
|
|
543
|
-
return Array.prototype.slice.call(resultNodes);
|
|
544
|
-
}, _SkySortFixture_selectMenuItem =
|
|
545
|
-
/**
|
|
546
|
-
* Ensures the sort menu is open and selects the menu item via a selection predicate,
|
|
547
|
-
* if a matching item is available.
|
|
548
|
-
* @param selectionPredicate The menu item selector method to use.
|
|
549
|
-
*/
|
|
550
|
-
async function _SkySortFixture_selectMenuItem(selectionPredicate) {
|
|
551
|
-
// make sure the sort menu is open
|
|
552
|
-
if (!this.menu.isOpen) {
|
|
553
|
-
await this.openMenu();
|
|
554
|
-
}
|
|
555
|
-
// find the requested menu item using the selectionPredicate parameter
|
|
556
|
-
const items = __classPrivateFieldGet(this, _SkySortFixture_instances, "m", _SkySortFixture_getSortItems).call(this);
|
|
557
|
-
const targetItem = items.find((item, index) => selectionPredicate(item, index));
|
|
558
|
-
// if we found the item, select it
|
|
559
|
-
if (targetItem) {
|
|
560
|
-
// we've got the '.sky-sort-item' div, but we want to click it's child button element
|
|
561
|
-
const targetButton = targetItem.querySelector('button');
|
|
562
|
-
targetButton?.click();
|
|
563
|
-
__classPrivateFieldGet(this, _SkySortFixture_fixture, "f").detectChanges();
|
|
564
|
-
return __classPrivateFieldGet(this, _SkySortFixture_fixture, "f").whenStable();
|
|
565
|
-
}
|
|
566
|
-
};
|
|
567
|
-
|
|
568
|
-
/**
|
|
569
|
-
* @internal
|
|
570
|
-
*/
|
|
571
|
-
class SkyInfiniteScrollTestingModule {
|
|
572
|
-
}
|
|
573
|
-
SkyInfiniteScrollTestingModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: SkyInfiniteScrollTestingModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
574
|
-
SkyInfiniteScrollTestingModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.9", ngImport: i0, type: SkyInfiniteScrollTestingModule, exports: [SkyInfiniteScrollModule] });
|
|
575
|
-
SkyInfiniteScrollTestingModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: SkyInfiniteScrollTestingModule, imports: [SkyInfiniteScrollModule] });
|
|
576
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: SkyInfiniteScrollTestingModule, decorators: [{
|
|
577
|
-
type: NgModule,
|
|
578
|
-
args: [{
|
|
579
|
-
exports: [SkyInfiniteScrollModule],
|
|
580
|
-
}]
|
|
581
|
-
}] });
|
|
582
|
-
|
|
583
|
-
var _SkyInfiniteScrollFixture_instances, _SkyInfiniteScrollFixture_debugElement, _SkyInfiniteScrollFixture_fixture, _SkyInfiniteScrollFixture_getButton;
|
|
584
|
-
/**
|
|
585
|
-
* Provides information for and interaction with a SKY UX infinite scroll component.
|
|
586
|
-
* By using the fixture API, a test insulates itself against updates to the internals
|
|
587
|
-
* of a component, such as changing its DOM structure.
|
|
588
|
-
* @deprecated Use `SkyInfiniteScrollHarness` instead.
|
|
589
|
-
* @internal
|
|
590
|
-
*/
|
|
591
|
-
class SkyInfiniteScrollFixture {
|
|
592
|
-
constructor(fixture, skyTestId) {
|
|
593
|
-
_SkyInfiniteScrollFixture_instances.add(this);
|
|
594
|
-
_SkyInfiniteScrollFixture_debugElement.set(this, void 0);
|
|
595
|
-
_SkyInfiniteScrollFixture_fixture.set(this, void 0);
|
|
596
|
-
__classPrivateFieldSet(this, _SkyInfiniteScrollFixture_fixture, fixture, "f");
|
|
597
|
-
__classPrivateFieldSet(this, _SkyInfiniteScrollFixture_debugElement, SkyAppTestUtility.getDebugElementByTestId(fixture, skyTestId, 'sky-infinite-scroll'), "f");
|
|
598
|
-
}
|
|
599
|
-
get loadMoreButtonIsVisible() {
|
|
600
|
-
return __classPrivateFieldGet(this, _SkyInfiniteScrollFixture_instances, "m", _SkyInfiniteScrollFixture_getButton).call(this) instanceof HTMLButtonElement;
|
|
601
|
-
}
|
|
602
|
-
async clickLoadMoreButton() {
|
|
603
|
-
const button = __classPrivateFieldGet(this, _SkyInfiniteScrollFixture_instances, "m", _SkyInfiniteScrollFixture_getButton).call(this);
|
|
604
|
-
if (button instanceof HTMLButtonElement) {
|
|
605
|
-
button.click();
|
|
606
|
-
}
|
|
607
|
-
__classPrivateFieldGet(this, _SkyInfiniteScrollFixture_fixture, "f").detectChanges();
|
|
608
|
-
return __classPrivateFieldGet(this, _SkyInfiniteScrollFixture_fixture, "f").whenStable();
|
|
609
|
-
}
|
|
610
|
-
}
|
|
611
|
-
_SkyInfiniteScrollFixture_debugElement = new WeakMap(), _SkyInfiniteScrollFixture_fixture = new WeakMap(), _SkyInfiniteScrollFixture_instances = new WeakSet(), _SkyInfiniteScrollFixture_getButton = function _SkyInfiniteScrollFixture_getButton() {
|
|
612
|
-
return __classPrivateFieldGet(this, _SkyInfiniteScrollFixture_debugElement, "f").nativeElement.querySelector('.sky-infinite-scroll .sky-btn');
|
|
613
|
-
};
|
|
614
|
-
|
|
615
|
-
var _SkyInfiniteScrollHarness_showMoreButton;
|
|
616
|
-
/**
|
|
617
|
-
* Harness for interacting with an infinite scroll component in tests.
|
|
618
|
-
* @internal
|
|
619
|
-
*/
|
|
620
|
-
class SkyInfiniteScrollHarness extends SkyComponentHarness {
|
|
621
|
-
constructor() {
|
|
622
|
-
super(...arguments);
|
|
623
|
-
_SkyInfiniteScrollHarness_showMoreButton.set(this, this.locatorForOptional('button.sky-infinite-scroll-load-more-button'));
|
|
624
|
-
}
|
|
625
|
-
/**
|
|
626
|
-
* Gets a `HarnessPredicate` that can be used to search for a
|
|
627
|
-
* `SkyInfiniteScrollHarness` that meets certain criteria.
|
|
628
|
-
*/
|
|
629
|
-
static with(filters) {
|
|
630
|
-
return this.getDataSkyIdPredicate(filters);
|
|
631
|
-
}
|
|
632
|
-
/**
|
|
633
|
-
* Whether the infinite scroll is enabled.
|
|
634
|
-
*/
|
|
635
|
-
async isEnabled() {
|
|
636
|
-
return (await this.locatorForOptional('.sky-infinite-scroll')()) !== null;
|
|
637
|
-
}
|
|
638
|
-
/**
|
|
639
|
-
* Whether the infinite scroll is loading.
|
|
640
|
-
*/
|
|
641
|
-
async isLoading() {
|
|
642
|
-
return (await this.isEnabled()) && (await __classPrivateFieldGet(this, _SkyInfiniteScrollHarness_showMoreButton, "f").call(this)) === null;
|
|
643
|
-
}
|
|
644
|
-
/**
|
|
645
|
-
* Clicks the "Load more" button.
|
|
646
|
-
*/
|
|
647
|
-
async loadMore() {
|
|
648
|
-
const button = await __classPrivateFieldGet(this, _SkyInfiniteScrollHarness_showMoreButton, "f").call(this);
|
|
649
|
-
if (button) {
|
|
650
|
-
await button.click();
|
|
651
|
-
}
|
|
652
|
-
else {
|
|
653
|
-
if (!(await this.isEnabled())) {
|
|
654
|
-
throw new Error('Unable to click the "Load more" button because the infinite scroll is not enabled.');
|
|
655
|
-
}
|
|
656
|
-
else {
|
|
657
|
-
throw new Error('Unable to click the "Load more" button because the infinite scroll is loading.');
|
|
658
|
-
}
|
|
659
|
-
}
|
|
660
|
-
}
|
|
661
|
-
}
|
|
662
|
-
_SkyInfiniteScrollHarness_showMoreButton = new WeakMap();
|
|
663
|
-
/**
|
|
664
|
-
* @internal
|
|
665
|
-
*/
|
|
666
|
-
SkyInfiniteScrollHarness.hostSelector = 'sky-infinite-scroll';
|
|
667
|
-
|
|
668
|
-
/**
|
|
669
|
-
* Generated bundle index. Do not edit.
|
|
670
|
-
*/
|
|
671
|
-
|
|
672
|
-
export { SkyFilterFixtureButton, SkyFilterFixtureSummary, SkyFilterTestingModule, SkyInfiniteScrollFixture, SkyInfiniteScrollHarness, SkyInfiniteScrollTestingModule, SkyPagingFixture, SkyPagingTestingModule, SkyRepeaterHarness, SkyRepeaterItemHarness, SkySortFixture, SkySortTestingModule };
|
|
673
|
-
//# sourceMappingURL=skyux-lists-testing.mjs.map
|