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