@skyux/list-builder 5.0.0-beta.0 → 5.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/bundles/skyux-list-builder.umd.js +1308 -1130
- package/bundles/skyux-list-builder.umd.js.map +1 -1
- package/documentation.json +6679 -0
- package/esm2015/modules/list/list-data-request.model.js +1 -1
- package/esm2015/modules/list/list-data-response.model.js +1 -1
- package/esm2015/modules/list/list-data.provider.js +1 -1
- package/esm2015/modules/list/list-paging.component.js +1 -1
- package/esm2015/modules/list/list-view.component.js +9 -8
- package/esm2015/modules/list/list.component.js +81 -87
- package/esm2015/modules/list/list.module.js +15 -18
- package/esm2015/modules/list/state/filters/filters.orchestrator.js +2 -3
- package/esm2015/modules/list/state/filters/update.action.js +1 -1
- package/esm2015/modules/list/state/items/items.orchestrator.js +12 -9
- package/esm2015/modules/list/state/items/load.action.js +1 -1
- package/esm2015/modules/list/state/items/set-items-selected.action.js +4 -2
- package/esm2015/modules/list/state/items/set-loading.action.js +1 -1
- package/esm2015/modules/list/state/list-state-action.type.js +2 -1
- package/esm2015/modules/list/state/list-state.model.js +1 -1
- package/esm2015/modules/list/state/list-state.rxstate.js +10 -8
- package/esm2015/modules/list/state/list-state.state-node.js +11 -14
- package/esm2015/modules/list/state/paging/paging.model.js +1 -1
- package/esm2015/modules/list/state/paging/paging.orchestrator.js +2 -3
- package/esm2015/modules/list/state/paging/set-items-per-page.action.js +1 -1
- package/esm2015/modules/list/state/paging/set-max-pages.action.js +1 -1
- package/esm2015/modules/list/state/paging/set-page-number.action.js +1 -1
- package/esm2015/modules/list/state/search/search.model.js +1 -1
- package/esm2015/modules/list/state/search/search.orchestrator.js +5 -4
- package/esm2015/modules/list/state/search/set-field-selectors.action.js +1 -1
- package/esm2015/modules/list/state/search/set-functions.action.js +1 -1
- package/esm2015/modules/list/state/search/set-options.action.js +1 -1
- package/esm2015/modules/list/state/search/set-search-text.action.js +1 -1
- package/esm2015/modules/list/state/selected/load.action.js +1 -1
- package/esm2015/modules/list/state/selected/selected.model.js +1 -1
- package/esm2015/modules/list/state/selected/selected.orchestrator.js +9 -10
- package/esm2015/modules/list/state/selected/set-item-selected.action.js +1 -1
- package/esm2015/modules/list/state/selected/set-items-selected.action.js +1 -1
- package/esm2015/modules/list/state/selected/set-loading.action.js +1 -1
- package/esm2015/modules/list/state/sort/label.model.js +1 -1
- package/esm2015/modules/list/state/sort/set-available.action.js +1 -1
- package/esm2015/modules/list/state/sort/set-field-selectors.action.js +1 -1
- package/esm2015/modules/list/state/sort/set-global.action.js +1 -1
- package/esm2015/modules/list/state/sort/sort.model.js +1 -1
- package/esm2015/modules/list/state/sort/sort.orchestrator.js +4 -5
- package/esm2015/modules/list/state/toolbar/disable.action.js +1 -1
- package/esm2015/modules/list/state/toolbar/load.action.js +1 -1
- package/esm2015/modules/list/state/toolbar/remove.action.js +1 -1
- package/esm2015/modules/list/state/toolbar/set-exists.action.js +1 -1
- package/esm2015/modules/list/state/toolbar/set-type.action.js +1 -1
- package/esm2015/modules/list/state/toolbar/show-multiselect-toolbar.action.js +1 -1
- package/esm2015/modules/list/state/toolbar/toolbar-item.model.js +1 -1
- package/esm2015/modules/list/state/toolbar/toolbar.model.js +1 -1
- package/esm2015/modules/list/state/toolbar/toolbar.orchestrator.js +3 -4
- package/esm2015/modules/list/state/views/load.action.js +1 -1
- package/esm2015/modules/list/state/views/set-active.action.js +1 -1
- package/esm2015/modules/list/state/views/view.model.js +1 -1
- package/esm2015/modules/list/state/views/views.model.js +1 -1
- package/esm2015/modules/list/state/views/views.orchestrator.js +2 -4
- package/esm2015/modules/list-data-provider-in-memory/list-data-in-memory.provider.js +25 -14
- package/esm2015/modules/list-filters/filter.model.js +1 -1
- package/esm2015/modules/list-filters/list-filter-button.component.js +23 -24
- package/esm2015/modules/list-filters/list-filter-inline-item-renderer.component.js +24 -24
- package/esm2015/modules/list-filters/list-filter-inline-item.component.js +32 -32
- package/esm2015/modules/list-filters/list-filter-inline.component.js +28 -26
- package/esm2015/modules/list-filters/list-filter-inline.model.js +1 -1
- package/esm2015/modules/list-filters/list-filter-summary.component.js +22 -23
- package/esm2015/modules/list-filters/list-filters.module.js +33 -27
- package/esm2015/modules/list-paging/list-paging.component.js +37 -40
- package/esm2015/modules/list-paging/list-paging.module.js +15 -19
- package/esm2015/modules/list-toolbar/list-multiselect-toolbar.component.js +45 -41
- package/esm2015/modules/list-toolbar/list-secondary-actions/list-secondary-action.component.js +22 -23
- package/esm2015/modules/list-toolbar/list-secondary-actions/list-secondary-action.js +2 -1
- package/esm2015/modules/list-toolbar/list-secondary-actions/list-secondary-actions-host.component.js +22 -20
- package/esm2015/modules/list-toolbar/list-secondary-actions/list-secondary-actions.component.js +26 -30
- package/esm2015/modules/list-toolbar/list-secondary-actions/list-secondary-actions.module.js +34 -23
- package/esm2015/modules/list-toolbar/list-secondary-actions/list-secondary-actions.service.js +10 -9
- package/esm2015/modules/list-toolbar/list-toolbar-item-renderer.component.js +22 -21
- package/esm2015/modules/list-toolbar/list-toolbar-item.component.js +23 -24
- package/esm2015/modules/list-toolbar/list-toolbar-search-actions.component.js +15 -13
- package/esm2015/modules/list-toolbar/list-toolbar-sort.component.js +21 -23
- package/esm2015/modules/list-toolbar/list-toolbar-view-actions.component.js +14 -12
- package/esm2015/modules/list-toolbar/list-toolbar.component.js +142 -139
- package/esm2015/modules/list-toolbar/list-toolbar.module.js +62 -31
- package/esm2015/modules/list-toolbar/state/config/config.model.js +1 -1
- package/esm2015/modules/list-toolbar/state/config/config.orchestrator.js +2 -4
- package/esm2015/modules/list-toolbar/state/config/set-search-enabled.action.js +1 -1
- package/esm2015/modules/list-toolbar/state/config/set-sort-selector-enabled.action.js +1 -1
- package/esm2015/modules/list-toolbar/state/toolbar-state-action.type.js +2 -1
- package/esm2015/modules/list-toolbar/state/toolbar-state.model.js +1 -1
- package/esm2015/modules/list-toolbar/state/toolbar-state.rxstate.js +9 -8
- package/esm2015/modules/list-toolbar/state/toolbar-state.state-node.js +12 -17
- package/esm2015/modules/shared/sky-list-builder-resources.module.js +53 -0
- package/esm2015/public-api.js +78 -0
- package/esm2015/skyux-list-builder.js +2 -23
- package/fesm2015/skyux-list-builder.js +992 -915
- package/fesm2015/skyux-list-builder.js.map +1 -1
- package/modules/list/list.component.d.ts +3 -0
- package/modules/list/list.module.d.ts +6 -0
- package/modules/list/state/list-state.rxstate.d.ts +3 -0
- package/modules/list/state/list-state.state-node.d.ts +3 -0
- package/modules/list-filters/list-filter-button.component.d.ts +3 -0
- package/modules/list-filters/list-filter-inline-item-renderer.component.d.ts +3 -0
- package/modules/list-filters/list-filter-inline-item.component.d.ts +3 -0
- package/modules/list-filters/list-filter-inline.component.d.ts +3 -0
- package/modules/list-filters/list-filter-summary.component.d.ts +3 -0
- package/modules/list-filters/list-filters.module.d.ts +11 -0
- package/modules/list-paging/list-paging.component.d.ts +3 -0
- package/modules/list-paging/list-paging.module.d.ts +7 -0
- package/modules/list-toolbar/list-multiselect-toolbar.component.d.ts +3 -0
- package/modules/list-toolbar/list-secondary-actions/list-secondary-action.component.d.ts +3 -0
- package/modules/list-toolbar/list-secondary-actions/list-secondary-actions-host.component.d.ts +3 -0
- package/modules/list-toolbar/list-secondary-actions/list-secondary-actions.component.d.ts +3 -0
- package/modules/list-toolbar/list-secondary-actions/list-secondary-actions.module.d.ts +12 -0
- package/modules/list-toolbar/list-secondary-actions/list-secondary-actions.service.d.ts +3 -0
- package/modules/list-toolbar/list-toolbar-item-renderer.component.d.ts +3 -0
- package/modules/list-toolbar/list-toolbar-item.component.d.ts +3 -0
- package/modules/list-toolbar/list-toolbar-search-actions.component.d.ts +3 -0
- package/modules/list-toolbar/list-toolbar-sort.component.d.ts +3 -0
- package/modules/list-toolbar/list-toolbar-view-actions.component.d.ts +3 -0
- package/modules/list-toolbar/list-toolbar.component.d.ts +3 -0
- package/modules/list-toolbar/list-toolbar.module.d.ts +20 -0
- package/modules/list-toolbar/state/toolbar-state.rxstate.d.ts +3 -0
- package/modules/list-toolbar/state/toolbar-state.state-node.d.ts +3 -0
- package/modules/shared/sky-list-builder-resources.module.d.ts +14 -0
- package/package.json +16 -31
- package/{public_api.d.ts → public-api.d.ts} +11 -0
- package/skyux-list-builder.d.ts +2 -22
- package/CHANGELOG.md +0 -161
- package/bundles/skyux-list-builder.umd.min.js +0 -16
- package/bundles/skyux-list-builder.umd.min.js.map +0 -1
- package/esm2015/modules/shared/list-builder-resources.module.js +0 -17
- package/esm2015/plugin-resources/list-builder-resources-provider.js +0 -16
- package/esm2015/public_api.js +0 -63
- package/esm5/modules/list/list-data-request.model.js +0 -20
- package/esm5/modules/list/list-data-response.model.js +0 -11
- package/esm5/modules/list/list-data.provider.js +0 -10
- package/esm5/modules/list/list-paging.component.js +0 -15
- package/esm5/modules/list/list-view.component.js +0 -38
- package/esm5/modules/list/list.component.js +0 -337
- package/esm5/modules/list/list.module.js +0 -24
- package/esm5/modules/list/state/filters/filters.orchestrator.js +0 -22
- package/esm5/modules/list/state/filters/update.action.js +0 -11
- package/esm5/modules/list/state/items/items.orchestrator.js +0 -55
- package/esm5/modules/list/state/items/load.action.js +0 -16
- package/esm5/modules/list/state/items/set-items-selected.action.js +0 -15
- package/esm5/modules/list/state/items/set-loading.action.js +0 -12
- package/esm5/modules/list/state/list-state-action.type.js +0 -1
- package/esm5/modules/list/state/list-state.model.js +0 -26
- package/esm5/modules/list/state/list-state.rxstate.js +0 -91
- package/esm5/modules/list/state/list-state.state-node.js +0 -42
- package/esm5/modules/list/state/paging/paging.model.js +0 -16
- package/esm5/modules/list/state/paging/paging.orchestrator.js +0 -33
- package/esm5/modules/list/state/paging/set-items-per-page.action.js +0 -11
- package/esm5/modules/list/state/paging/set-max-pages.action.js +0 -11
- package/esm5/modules/list/state/paging/set-page-number.action.js +0 -11
- package/esm5/modules/list/state/search/search.model.js +0 -34
- package/esm5/modules/list/state/search/search.orchestrator.js +0 -51
- package/esm5/modules/list/state/search/set-field-selectors.action.js +0 -12
- package/esm5/modules/list/state/search/set-functions.action.js +0 -12
- package/esm5/modules/list/state/search/set-options.action.js +0 -13
- package/esm5/modules/list/state/search/set-search-text.action.js +0 -11
- package/esm5/modules/list/state/selected/load.action.js +0 -11
- package/esm5/modules/list/state/selected/selected.model.js +0 -11
- package/esm5/modules/list/state/selected/selected.orchestrator.js +0 -62
- package/esm5/modules/list/state/selected/set-item-selected.action.js +0 -12
- package/esm5/modules/list/state/selected/set-items-selected.action.js +0 -15
- package/esm5/modules/list/state/selected/set-loading.action.js +0 -12
- package/esm5/modules/list/state/sort/label.model.js +0 -27
- package/esm5/modules/list/state/sort/set-available.action.js +0 -11
- package/esm5/modules/list/state/sort/set-field-selectors.action.js +0 -11
- package/esm5/modules/list/state/sort/set-global.action.js +0 -11
- package/esm5/modules/list/state/sort/sort.model.js +0 -29
- package/esm5/modules/list/state/sort/sort.orchestrator.js +0 -36
- package/esm5/modules/list/state/toolbar/disable.action.js +0 -11
- package/esm5/modules/list/state/toolbar/load.action.js +0 -13
- package/esm5/modules/list/state/toolbar/remove.action.js +0 -11
- package/esm5/modules/list/state/toolbar/set-exists.action.js +0 -11
- package/esm5/modules/list/state/toolbar/set-type.action.js +0 -11
- package/esm5/modules/list/state/toolbar/show-multiselect-toolbar.action.js +0 -11
- package/esm5/modules/list/state/toolbar/toolbar-item.model.js +0 -18
- package/esm5/modules/list/state/toolbar/toolbar.model.js +0 -19
- package/esm5/modules/list/state/toolbar/toolbar.orchestrator.js +0 -86
- package/esm5/modules/list/state/views/load.action.js +0 -11
- package/esm5/modules/list/state/views/set-active.action.js +0 -11
- package/esm5/modules/list/state/views/view.model.js +0 -12
- package/esm5/modules/list/state/views/views.model.js +0 -15
- package/esm5/modules/list/state/views/views.orchestrator.js +0 -28
- package/esm5/modules/list-data-provider-in-memory/list-data-in-memory.provider.js +0 -157
- package/esm5/modules/list-filters/filter.model.js +0 -20
- package/esm5/modules/list-filters/list-filter-button.component.js +0 -45
- package/esm5/modules/list-filters/list-filter-inline-item-renderer.component.js +0 -37
- package/esm5/modules/list-filters/list-filter-inline-item.component.js +0 -50
- package/esm5/modules/list-filters/list-filter-inline.component.js +0 -73
- package/esm5/modules/list-filters/list-filter-inline.model.js +0 -23
- package/esm5/modules/list-filters/list-filter-summary.component.js +0 -62
- package/esm5/modules/list-filters/list-filters.module.js +0 -38
- package/esm5/modules/list-paging/list-paging.component.js +0 -102
- package/esm5/modules/list-paging/list-paging.module.js +0 -26
- package/esm5/modules/list-toolbar/list-multiselect-toolbar.component.js +0 -153
- package/esm5/modules/list-toolbar/list-secondary-actions/list-secondary-action.component.js +0 -34
- package/esm5/modules/list-toolbar/list-secondary-actions/list-secondary-action.js +0 -1
- package/esm5/modules/list-toolbar/list-secondary-actions/list-secondary-actions-host.component.js +0 -49
- package/esm5/modules/list-toolbar/list-secondary-actions/list-secondary-actions.component.js +0 -49
- package/esm5/modules/list-toolbar/list-secondary-actions/list-secondary-actions.module.js +0 -38
- package/esm5/modules/list-toolbar/list-secondary-actions/list-secondary-actions.service.js +0 -36
- package/esm5/modules/list-toolbar/list-toolbar-item-renderer.component.js +0 -32
- package/esm5/modules/list-toolbar/list-toolbar-item.component.js +0 -53
- package/esm5/modules/list-toolbar/list-toolbar-search-actions.component.js +0 -20
- package/esm5/modules/list-toolbar/list-toolbar-sort.component.js +0 -30
- package/esm5/modules/list-toolbar/list-toolbar-view-actions.component.js +0 -22
- package/esm5/modules/list-toolbar/list-toolbar.component.js +0 -375
- package/esm5/modules/list-toolbar/list-toolbar.module.js +0 -59
- package/esm5/modules/list-toolbar/state/config/config.model.js +0 -16
- package/esm5/modules/list-toolbar/state/config/config.orchestrator.js +0 -28
- package/esm5/modules/list-toolbar/state/config/set-search-enabled.action.js +0 -11
- package/esm5/modules/list-toolbar/state/config/set-sort-selector-enabled.action.js +0 -13
- package/esm5/modules/list-toolbar/state/toolbar-state-action.type.js +0 -1
- package/esm5/modules/list-toolbar/state/toolbar-state.model.js +0 -12
- package/esm5/modules/list-toolbar/state/toolbar-state.rxstate.js +0 -29
- package/esm5/modules/list-toolbar/state/toolbar-state.state-node.js +0 -29
- package/esm5/modules/shared/list-builder-resources.module.js +0 -20
- package/esm5/plugin-resources/list-builder-resources-provider.js +0 -17
- package/esm5/public_api.js +0 -63
- package/esm5/skyux-list-builder.js +0 -26
- package/fesm5/skyux-list-builder.js +0 -2884
- package/fesm5/skyux-list-builder.js.map +0 -1
- package/modules/shared/list-builder-resources.module.d.ts +0 -2
- package/plugin-resources/list-builder-resources-provider.d.ts +0 -5
- package/skyux-list-builder.metadata.json +0 -1
- package/src/assets/img/list-toolbar-context.png +0 -0
- package/src/assets/img/toolbar-anatomy.png +0 -0
- package/src/assets/locales/resources_en_US.json +0 -22
|
@@ -1,15 +1,23 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { Injectable, EventEmitter,
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { Injectable, EventEmitter, Component, ChangeDetectionStrategy, Input, Output, ContentChildren, NgModule, TemplateRef, ViewChild, ViewContainerRef, forwardRef } from '@angular/core';
|
|
3
|
+
import * as i4 from '@angular/common';
|
|
3
4
|
import { CommonModule } from '@angular/common';
|
|
4
5
|
import { BehaviorSubject, Observable, Subject, of, combineLatest } from 'rxjs';
|
|
5
6
|
import { map, take, distinctUntilChanged, takeUntil, skip, flatMap, scan } from 'rxjs/operators';
|
|
6
7
|
import { ListItemModel, getData, compare, AsyncList, AsyncItem, StateOrchestrator, StateDispatcher, StateNode, getValue, isObservable } from '@skyux/list-builder-common';
|
|
8
|
+
import * as i3 from '@skyux/lists';
|
|
7
9
|
import { SkyFilterModule, SkyPagingModule, SkySortModule } from '@skyux/lists';
|
|
8
|
-
import
|
|
10
|
+
import * as i5 from '@skyux/i18n';
|
|
11
|
+
import { getLibStringForLocale, SkyI18nModule, SKY_LIB_RESOURCES_PROVIDERS } from '@skyux/i18n';
|
|
12
|
+
import * as i3$1 from '@skyux/indicators';
|
|
9
13
|
import { SkyIconModule } from '@skyux/indicators';
|
|
14
|
+
import * as i2 from '@skyux/popovers';
|
|
10
15
|
import { SkyDropdownModule } from '@skyux/popovers';
|
|
16
|
+
import * as i3$2 from '@skyux/layout';
|
|
11
17
|
import { SkyToolbarModule } from '@skyux/layout';
|
|
18
|
+
import * as i8 from '@skyux/lookup';
|
|
12
19
|
import { SkySearchComponent, SkySearchModule } from '@skyux/lookup';
|
|
20
|
+
import * as i5$1 from '@skyux/forms';
|
|
13
21
|
import { SkyCheckboxModule } from '@skyux/forms';
|
|
14
22
|
|
|
15
23
|
class ListDataRequestModel {
|
|
@@ -152,15 +160,15 @@ class ListSearchModel {
|
|
|
152
160
|
}
|
|
153
161
|
}
|
|
154
162
|
|
|
155
|
-
let idIndex = 0;
|
|
163
|
+
let idIndex$3 = 0;
|
|
156
164
|
class SkyListInMemoryDataProvider extends ListDataProvider {
|
|
157
165
|
constructor(data, searchFunction) {
|
|
158
166
|
super(data);
|
|
159
167
|
this.items = new BehaviorSubject([]);
|
|
160
168
|
this.searchFunction = searchFunction;
|
|
161
169
|
if (data) {
|
|
162
|
-
data.subscribe(items => {
|
|
163
|
-
this.items.next(items.map(d => new ListItemModel(d.id || `sky-list-data-in-memory-provider-item-${++idIndex}`, d)));
|
|
170
|
+
data.subscribe((items) => {
|
|
171
|
+
this.items.next(items.map((d) => new ListItemModel(d.id || `sky-list-data-in-memory-provider-item-${++idIndex$3}`, d)));
|
|
164
172
|
});
|
|
165
173
|
}
|
|
166
174
|
}
|
|
@@ -174,20 +182,20 @@ class SkyListInMemoryDataProvider extends ListDataProvider {
|
|
|
174
182
|
let pagedResult = result.slice(itemStart, itemStart + request.pageSize);
|
|
175
183
|
return new ListDataResponseModel({
|
|
176
184
|
count: result.length,
|
|
177
|
-
items: pagedResult
|
|
185
|
+
items: pagedResult,
|
|
178
186
|
});
|
|
179
187
|
}
|
|
180
188
|
else {
|
|
181
189
|
return new ListDataResponseModel({
|
|
182
190
|
count: result.length,
|
|
183
|
-
items: result
|
|
191
|
+
items: result,
|
|
184
192
|
});
|
|
185
193
|
}
|
|
186
194
|
}));
|
|
187
195
|
}
|
|
188
196
|
filteredItems(request) {
|
|
189
197
|
const showSelectedId = ['show-selected'];
|
|
190
|
-
return this.items.pipe(map(items => {
|
|
198
|
+
return this.items.pipe(map((items) => {
|
|
191
199
|
let dataChanged = false;
|
|
192
200
|
let search = request.search;
|
|
193
201
|
let sort = request.sort;
|
|
@@ -201,7 +209,7 @@ class SkyListInMemoryDataProvider extends ListDataProvider {
|
|
|
201
209
|
if (request.isToolbarDisabled) {
|
|
202
210
|
searchChanged = true;
|
|
203
211
|
search = new ListSearchModel();
|
|
204
|
-
filters = filters.filter(f => showSelectedId.indexOf(f.name) >= 0);
|
|
212
|
+
filters = filters.filter((f) => showSelectedId.indexOf(f.name) >= 0);
|
|
205
213
|
filtersChanged = true;
|
|
206
214
|
}
|
|
207
215
|
else {
|
|
@@ -216,11 +224,13 @@ class SkyListInMemoryDataProvider extends ListDataProvider {
|
|
|
216
224
|
this.lastFilters = filters;
|
|
217
225
|
let result = items;
|
|
218
226
|
// Apply filters.
|
|
219
|
-
if (!dataChanged &&
|
|
227
|
+
if (!dataChanged &&
|
|
228
|
+
!filtersChanged &&
|
|
229
|
+
this.lastFilterResults !== undefined) {
|
|
220
230
|
result = this.lastFilterResults;
|
|
221
231
|
}
|
|
222
232
|
else if (filters && filters.length > 0) {
|
|
223
|
-
result = result.filter(item => {
|
|
233
|
+
result = result.filter((item) => {
|
|
224
234
|
for (let i = 0; i < filters.length; i++) {
|
|
225
235
|
let filter = filters[i];
|
|
226
236
|
if (filter.value === undefined ||
|
|
@@ -241,10 +251,16 @@ class SkyListInMemoryDataProvider extends ListDataProvider {
|
|
|
241
251
|
this.lastFilterResults = undefined;
|
|
242
252
|
}
|
|
243
253
|
// Apply search.
|
|
244
|
-
|
|
254
|
+
/* istanbul ignore next */
|
|
255
|
+
if (!dataChanged &&
|
|
256
|
+
!searchChanged &&
|
|
257
|
+
this.lastSearchResults !== undefined &&
|
|
258
|
+
!filtersChanged) {
|
|
245
259
|
result = this.lastSearchResults;
|
|
246
260
|
}
|
|
247
|
-
else if (search &&
|
|
261
|
+
else if (search &&
|
|
262
|
+
search.searchText !== undefined &&
|
|
263
|
+
search.searchText.length > 0) {
|
|
248
264
|
let searchText = search.searchText.toLowerCase();
|
|
249
265
|
let searchFunctions;
|
|
250
266
|
if (this.searchFunction !== undefined) {
|
|
@@ -253,12 +269,13 @@ class SkyListInMemoryDataProvider extends ListDataProvider {
|
|
|
253
269
|
else {
|
|
254
270
|
searchFunctions = search.functions;
|
|
255
271
|
}
|
|
256
|
-
result = result.filter(item => {
|
|
272
|
+
result = result.filter((item) => {
|
|
257
273
|
let isMatch = false;
|
|
258
274
|
for (let i = 0; i < searchFunctions.length; i++) {
|
|
259
275
|
let searchFunction = searchFunctions[i];
|
|
260
276
|
let searchResult = searchFunction(item.data, searchText);
|
|
261
|
-
if ((typeof searchResult === 'string' &&
|
|
277
|
+
if ((typeof searchResult === 'string' &&
|
|
278
|
+
searchResult.indexOf(searchText) !== -1) ||
|
|
262
279
|
searchResult === true) {
|
|
263
280
|
isMatch = true;
|
|
264
281
|
break;
|
|
@@ -273,7 +290,9 @@ class SkyListInMemoryDataProvider extends ListDataProvider {
|
|
|
273
290
|
}
|
|
274
291
|
// Apply sort.
|
|
275
292
|
if (sort && sort.fieldSelectors.length > 0) {
|
|
276
|
-
result = result
|
|
293
|
+
result = result
|
|
294
|
+
.slice()
|
|
295
|
+
.sort((item1, item2) => {
|
|
277
296
|
let compareResult = 0;
|
|
278
297
|
for (let i = 0; i < sort.fieldSelectors.length; i++) {
|
|
279
298
|
let selector = sort.fieldSelectors[i];
|
|
@@ -504,7 +523,7 @@ class ListStateOrchestrator extends StateOrchestrator {
|
|
|
504
523
|
/**
|
|
505
524
|
* @internal
|
|
506
525
|
*/
|
|
507
|
-
|
|
526
|
+
class ListStateDispatcher extends StateDispatcher {
|
|
508
527
|
viewsSetActive(id) {
|
|
509
528
|
this.next(new ListViewsSetActiveAction(id));
|
|
510
529
|
}
|
|
@@ -526,6 +545,7 @@ let ListStateDispatcher = class ListStateDispatcher extends StateDispatcher {
|
|
|
526
545
|
searchSetFunctions(sortFunctions) {
|
|
527
546
|
this.next(new ListSearchSetFunctionsAction(sortFunctions));
|
|
528
547
|
}
|
|
548
|
+
/* istanbul ignore next */
|
|
529
549
|
searchSetFieldSelectors(fieldSelectors) {
|
|
530
550
|
this.next(new ListSearchSetFieldSelectorsAction(fieldSelectors));
|
|
531
551
|
}
|
|
@@ -550,10 +570,12 @@ let ListStateDispatcher = class ListStateDispatcher extends StateDispatcher {
|
|
|
550
570
|
setSelected(selectedIds, selected, refresh = false) {
|
|
551
571
|
this.next(new ListSelectedSetItemsSelectedAction(selectedIds, selected, refresh));
|
|
552
572
|
}
|
|
553
|
-
}
|
|
554
|
-
ListStateDispatcher =
|
|
555
|
-
|
|
556
|
-
|
|
573
|
+
}
|
|
574
|
+
ListStateDispatcher.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: ListStateDispatcher, deps: null, target: i0.ɵɵFactoryTarget.Injectable });
|
|
575
|
+
ListStateDispatcher.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: ListStateDispatcher });
|
|
576
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: ListStateDispatcher, decorators: [{
|
|
577
|
+
type: Injectable
|
|
578
|
+
}] });
|
|
557
579
|
|
|
558
580
|
/**
|
|
559
581
|
* @internal
|
|
@@ -562,8 +584,7 @@ class ListFiltersOrchestrator extends ListStateOrchestrator {
|
|
|
562
584
|
/* istanbul ignore next */
|
|
563
585
|
constructor() {
|
|
564
586
|
super();
|
|
565
|
-
this
|
|
566
|
-
.register(ListFiltersUpdateAction, this.update);
|
|
587
|
+
this.register(ListFiltersUpdateAction, this.update);
|
|
567
588
|
}
|
|
568
589
|
update(state, action) {
|
|
569
590
|
return [...action.filters];
|
|
@@ -574,7 +595,9 @@ class ListFiltersOrchestrator extends ListStateOrchestrator {
|
|
|
574
595
|
* @internal
|
|
575
596
|
*/
|
|
576
597
|
class ListItemsSetSelectedAction {
|
|
577
|
-
constructor(items,
|
|
598
|
+
constructor(items,
|
|
599
|
+
/* istanbul ignore next */
|
|
600
|
+
selected = false, refresh = true) {
|
|
578
601
|
this.items = items;
|
|
579
602
|
this.selected = selected;
|
|
580
603
|
this.refresh = refresh;
|
|
@@ -588,8 +611,7 @@ class ListItemsOrchestrator extends ListStateOrchestrator {
|
|
|
588
611
|
/* istanbul ignore next */
|
|
589
612
|
constructor() {
|
|
590
613
|
super();
|
|
591
|
-
this
|
|
592
|
-
.register(ListItemsSetLoadingAction, this.setLoading)
|
|
614
|
+
this.register(ListItemsSetLoadingAction, this.setLoading)
|
|
593
615
|
.register(ListItemsLoadAction, this.load)
|
|
594
616
|
.register(ListItemsSetSelectedAction, this.setItemsSelected);
|
|
595
617
|
}
|
|
@@ -597,19 +619,23 @@ class ListItemsOrchestrator extends ListStateOrchestrator {
|
|
|
597
619
|
return new AsyncList(state.items, state.lastUpdate, action.loading, state.count);
|
|
598
620
|
}
|
|
599
621
|
load(state, action) {
|
|
600
|
-
const newListItems = action.items.map(g => new ListItemModel(g.id, g.data, g.isSelected));
|
|
601
|
-
const resultItems =
|
|
622
|
+
const newListItems = action.items.map((g) => new ListItemModel(g.id, g.data, g.isSelected));
|
|
623
|
+
const resultItems = action.refresh
|
|
624
|
+
? [...newListItems]
|
|
625
|
+
: [...state.items, ...newListItems];
|
|
602
626
|
let count = action.count === undefined ? resultItems.length : action.count;
|
|
603
627
|
return new AsyncList(resultItems, action.dataChanged ? Date.now() : state.lastUpdate, false, count);
|
|
604
628
|
}
|
|
605
629
|
setItemsSelected(state, action) {
|
|
630
|
+
/* istanbul ignore next */
|
|
606
631
|
const newSelectedIds = action.items || [];
|
|
607
632
|
let newListItemModels = this.cloneListItemModelArray(state.items);
|
|
608
633
|
if (action.refresh) {
|
|
609
|
-
newListItemModels.forEach(item => item.isSelected = undefined);
|
|
634
|
+
newListItemModels.forEach((item) => (item.isSelected = undefined));
|
|
610
635
|
}
|
|
611
|
-
newSelectedIds.map(s => {
|
|
612
|
-
let newItem = newListItemModels.find(i => i.id === s);
|
|
636
|
+
newSelectedIds.map((s) => {
|
|
637
|
+
let newItem = newListItemModels.find((i) => i.id === s);
|
|
638
|
+
/* istanbul ignore next */
|
|
613
639
|
if (newItem) {
|
|
614
640
|
newItem.isSelected = action.selected;
|
|
615
641
|
}
|
|
@@ -618,7 +644,7 @@ class ListItemsOrchestrator extends ListStateOrchestrator {
|
|
|
618
644
|
}
|
|
619
645
|
cloneListItemModelArray(source) {
|
|
620
646
|
let newListItems = [];
|
|
621
|
-
source.forEach(item => {
|
|
647
|
+
source.forEach((item) => {
|
|
622
648
|
newListItems.push(new ListItemModel(item.id, Object.assign({}, item.data), item.isSelected));
|
|
623
649
|
});
|
|
624
650
|
return newListItems;
|
|
@@ -659,8 +685,7 @@ class ListPagingOrchestrator extends ListStateOrchestrator {
|
|
|
659
685
|
/* istanbul ignore next */
|
|
660
686
|
constructor() {
|
|
661
687
|
super();
|
|
662
|
-
this
|
|
663
|
-
.register(ListPagingSetMaxPagesAction, this.setMaxPages)
|
|
688
|
+
this.register(ListPagingSetMaxPagesAction, this.setMaxPages)
|
|
664
689
|
.register(ListPagingSetItemsPerPageAction, this.setItemsPerPage)
|
|
665
690
|
.register(ListPagingSetPageNumberAction, this.setPageNumber);
|
|
666
691
|
}
|
|
@@ -691,9 +716,7 @@ class ListViewsOrchestrator extends ListStateOrchestrator {
|
|
|
691
716
|
/* istanbul ignore next */
|
|
692
717
|
constructor() {
|
|
693
718
|
super();
|
|
694
|
-
this
|
|
695
|
-
.register(ListViewsSetActiveAction, this.setActive)
|
|
696
|
-
.register(ListViewsLoadAction, this.load);
|
|
719
|
+
this.register(ListViewsSetActiveAction, this.setActive).register(ListViewsLoadAction, this.load);
|
|
697
720
|
}
|
|
698
721
|
setActive(state, action) {
|
|
699
722
|
return new ListViewsModel(Object.assign({}, state, { active: action.view }));
|
|
@@ -735,8 +758,7 @@ class ListToolbarOrchestrator extends ListStateOrchestrator {
|
|
|
735
758
|
/* istanbul ignore next */
|
|
736
759
|
constructor() {
|
|
737
760
|
super();
|
|
738
|
-
this
|
|
739
|
-
.register(ListToolbarSetExistsAction, this.setExists)
|
|
761
|
+
this.register(ListToolbarSetExistsAction, this.setExists)
|
|
740
762
|
.register(ListToolbarItemsDisableAction, this.setDisabled)
|
|
741
763
|
.register(ListToolbarItemsLoadAction, this.load)
|
|
742
764
|
.register(ListToolbarSetTypeAction, this.setType)
|
|
@@ -760,7 +782,7 @@ class ListToolbarOrchestrator extends ListStateOrchestrator {
|
|
|
760
782
|
}
|
|
761
783
|
load(state, action) {
|
|
762
784
|
const newModel = new ListToolbarModel(state);
|
|
763
|
-
const newListItems = action.items.map(item => {
|
|
785
|
+
const newListItems = action.items.map((item) => {
|
|
764
786
|
/**
|
|
765
787
|
* NOTE: Originally this function went off the action index and item models did not include
|
|
766
788
|
* the index. We changed this but must leave functionality to convert the action index for
|
|
@@ -807,14 +829,15 @@ class ListSearchOrchestrator extends ListStateOrchestrator {
|
|
|
807
829
|
/* istanbul ignore next */
|
|
808
830
|
constructor() {
|
|
809
831
|
super();
|
|
810
|
-
this
|
|
811
|
-
.register(ListSearchSetSearchTextAction, this.setSearchText)
|
|
832
|
+
this.register(ListSearchSetSearchTextAction, this.setSearchText)
|
|
812
833
|
.register(ListSearchSetFunctionsAction, this.setFunctions)
|
|
813
834
|
.register(ListSearchSetFieldSelectorsAction, this.setFieldSelectors)
|
|
814
835
|
.register(ListSearchSetOptionsAction, this.setOptions);
|
|
815
836
|
}
|
|
816
837
|
setSearchText(state, action) {
|
|
817
|
-
return new ListSearchModel(Object.assign({}, state, {
|
|
838
|
+
return new ListSearchModel(Object.assign({}, state, {
|
|
839
|
+
searchText: action.searchText ? action.searchText : '',
|
|
840
|
+
}));
|
|
818
841
|
}
|
|
819
842
|
setFunctions(state, action) {
|
|
820
843
|
return new ListSearchModel(Object.assign({}, state, { functions: [...action.functions] }));
|
|
@@ -857,8 +880,7 @@ class ListSelectedOrchestrator extends ListStateOrchestrator {
|
|
|
857
880
|
/* istanbul ignore next */
|
|
858
881
|
constructor() {
|
|
859
882
|
super();
|
|
860
|
-
this
|
|
861
|
-
.register(ListSelectedSetLoadingAction, this.setLoading)
|
|
883
|
+
this.register(ListSelectedSetLoadingAction, this.setLoading)
|
|
862
884
|
.register(ListSelectedSetItemSelectedAction, this.setItemSelected)
|
|
863
885
|
.register(ListSelectedSetItemsSelectedAction, this.setItemsSelected)
|
|
864
886
|
.register(ListSelectedLoadAction, this.load);
|
|
@@ -868,7 +890,7 @@ class ListSelectedOrchestrator extends ListStateOrchestrator {
|
|
|
868
890
|
}
|
|
869
891
|
load(state, action) {
|
|
870
892
|
const newSelected = new ListSelectedModel();
|
|
871
|
-
action.items.map(s => newSelected.selectedIdMap.set(s, true));
|
|
893
|
+
action.items.map((s) => newSelected.selectedIdMap.set(s, true));
|
|
872
894
|
return new AsyncItem(Object.assign({}, state.item, newSelected), Date.now(), false);
|
|
873
895
|
}
|
|
874
896
|
setItemSelected(state, action) {
|
|
@@ -878,16 +900,16 @@ class ListSelectedOrchestrator extends ListStateOrchestrator {
|
|
|
878
900
|
}
|
|
879
901
|
setItemsSelected(state, action) {
|
|
880
902
|
const newSelectedIds = action.items || [];
|
|
881
|
-
const newListSelectedModel = action.refresh
|
|
903
|
+
const newListSelectedModel = action.refresh
|
|
904
|
+
? new ListSelectedModel()
|
|
905
|
+
: this.cloneListSelectedModel(state.item);
|
|
882
906
|
if (newSelectedIds instanceof Observable) {
|
|
883
|
-
newSelectedIds
|
|
884
|
-
.
|
|
885
|
-
.subscribe(selectedIds => {
|
|
886
|
-
selectedIds.map(s => newListSelectedModel.selectedIdMap.set(s, action.selected));
|
|
907
|
+
newSelectedIds.pipe(take(1)).subscribe((selectedIds) => {
|
|
908
|
+
selectedIds.map((s) => newListSelectedModel.selectedIdMap.set(s, action.selected));
|
|
887
909
|
});
|
|
888
910
|
}
|
|
889
911
|
else {
|
|
890
|
-
newSelectedIds.map(s => newListSelectedModel.selectedIdMap.set(s, action.selected));
|
|
912
|
+
newSelectedIds.map((s) => newListSelectedModel.selectedIdMap.set(s, action.selected));
|
|
891
913
|
}
|
|
892
914
|
return new AsyncItem(newListSelectedModel, state.lastUpdate, state.loading);
|
|
893
915
|
}
|
|
@@ -930,8 +952,7 @@ class ListSortOrchestrator extends ListStateOrchestrator {
|
|
|
930
952
|
/* istanbul ignore next */
|
|
931
953
|
constructor() {
|
|
932
954
|
super();
|
|
933
|
-
this
|
|
934
|
-
.register(ListSortSetFieldSelectorsAction, this.setFieldSelectors)
|
|
955
|
+
this.register(ListSortSetFieldSelectorsAction, this.setFieldSelectors)
|
|
935
956
|
.register(ListSortSetAvailableAction, this.setAvailable)
|
|
936
957
|
.register(ListSortSetGlobalAction, this.setGlobal);
|
|
937
958
|
}
|
|
@@ -939,11 +960,11 @@ class ListSortOrchestrator extends ListStateOrchestrator {
|
|
|
939
960
|
return new ListSortModel(Object.assign({}, state, { fieldSelectors: action.fieldSelectors }));
|
|
940
961
|
}
|
|
941
962
|
setAvailable(state, action) {
|
|
942
|
-
const newAvailable = action.available.map(available => new ListSortLabelModel(available));
|
|
963
|
+
const newAvailable = action.available.map((available) => new ListSortLabelModel(available));
|
|
943
964
|
return new ListSortModel(Object.assign({}, state, { available: newAvailable }));
|
|
944
965
|
}
|
|
945
966
|
setGlobal(state, action) {
|
|
946
|
-
const newGlobal = action.global.map(global => new ListSortLabelModel(global));
|
|
967
|
+
const newGlobal = action.global.map((global) => new ListSortLabelModel(global));
|
|
947
968
|
return new ListSortModel(Object.assign({}, state, { global: newGlobal }));
|
|
948
969
|
}
|
|
949
970
|
}
|
|
@@ -951,11 +972,10 @@ class ListSortOrchestrator extends ListStateOrchestrator {
|
|
|
951
972
|
/**
|
|
952
973
|
* @internal
|
|
953
974
|
*/
|
|
954
|
-
|
|
975
|
+
class ListState extends StateNode {
|
|
955
976
|
constructor(dispatcher) {
|
|
956
977
|
super(new ListStateModel(), dispatcher);
|
|
957
|
-
this
|
|
958
|
-
.register('filters', ListFiltersOrchestrator)
|
|
978
|
+
this.register('filters', ListFiltersOrchestrator)
|
|
959
979
|
.register('items', ListItemsOrchestrator)
|
|
960
980
|
.register('paging', ListPagingOrchestrator)
|
|
961
981
|
.register('search', ListSearchOrchestrator)
|
|
@@ -965,26 +985,28 @@ let ListState = class ListState extends StateNode {
|
|
|
965
985
|
.register('selected', ListSelectedOrchestrator)
|
|
966
986
|
.begin();
|
|
967
987
|
}
|
|
968
|
-
}
|
|
969
|
-
ListState
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
], ListState);
|
|
988
|
+
}
|
|
989
|
+
ListState.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: ListState, deps: [{ token: ListStateDispatcher }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
990
|
+
ListState.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: ListState });
|
|
991
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: ListState, decorators: [{
|
|
992
|
+
type: Injectable
|
|
993
|
+
}], ctorParameters: function () { return [{ type: ListStateDispatcher }]; } });
|
|
975
994
|
|
|
976
|
-
let idIndex$
|
|
995
|
+
let idIndex$2 = 0;
|
|
977
996
|
/**
|
|
978
997
|
* @internal
|
|
979
998
|
*/
|
|
980
999
|
class ListViewComponent {
|
|
981
1000
|
constructor(state, defaultName) {
|
|
982
|
-
this.viewId = `sky-list-view-cmp-${++idIndex$
|
|
1001
|
+
this.viewId = `sky-list-view-cmp-${++idIndex$2}`;
|
|
983
1002
|
this.state = state;
|
|
984
1003
|
this.viewName = defaultName;
|
|
985
|
-
|
|
986
|
-
this.
|
|
987
|
-
this.active.pipe(
|
|
1004
|
+
/* istanbul ignore next */
|
|
1005
|
+
this.hasToolbar = this.state.pipe(map((s) => s.toolbar.exists));
|
|
1006
|
+
this.active = this.state.pipe(map((s) => s.views.active === this.viewId));
|
|
1007
|
+
this.active
|
|
1008
|
+
.pipe(distinctUntilChanged())
|
|
1009
|
+
.subscribe((isActive) => isActive ? this.onViewActive() : this.onViewInactive());
|
|
988
1010
|
}
|
|
989
1011
|
get id() {
|
|
990
1012
|
return this.viewId;
|
|
@@ -993,10 +1015,8 @@ class ListViewComponent {
|
|
|
993
1015
|
return this.viewName;
|
|
994
1016
|
}
|
|
995
1017
|
/* istanbul ignore next */
|
|
996
|
-
onViewActive() {
|
|
997
|
-
}
|
|
998
|
-
onViewInactive() {
|
|
999
|
-
}
|
|
1018
|
+
onViewActive() { }
|
|
1019
|
+
onViewInactive() { }
|
|
1000
1020
|
}
|
|
1001
1021
|
|
|
1002
1022
|
/**
|
|
@@ -1009,12 +1029,12 @@ class ListViewModel {
|
|
|
1009
1029
|
}
|
|
1010
1030
|
}
|
|
1011
1031
|
|
|
1012
|
-
let idIndex$
|
|
1013
|
-
|
|
1032
|
+
let idIndex$1 = 0;
|
|
1033
|
+
class SkyListComponent {
|
|
1014
1034
|
constructor(state, dispatcher) {
|
|
1015
1035
|
this.state = state;
|
|
1016
1036
|
this.dispatcher = dispatcher;
|
|
1017
|
-
this.id = `sky-list-cmp-${++idIndex$
|
|
1037
|
+
this.id = `sky-list-cmp-${++idIndex$1}`;
|
|
1018
1038
|
/**
|
|
1019
1039
|
* Specifies the data to display. The list component requires this property or the
|
|
1020
1040
|
* `dataProvider` property. For checklist or multiselect grids, each row requires an
|
|
@@ -1039,7 +1059,6 @@ let SkyListComponent = class SkyListComponent {
|
|
|
1039
1059
|
* Emits the filters applied to the list.
|
|
1040
1060
|
*/
|
|
1041
1061
|
this.appliedFiltersChange = new EventEmitter();
|
|
1042
|
-
/* tslint:enable */
|
|
1043
1062
|
this.dataFirstLoad = false;
|
|
1044
1063
|
this.lastSelectedIds = [];
|
|
1045
1064
|
this.lastFilters = [];
|
|
@@ -1050,8 +1069,10 @@ let SkyListComponent = class SkyListComponent {
|
|
|
1050
1069
|
this.dataFirstLoad = true;
|
|
1051
1070
|
}
|
|
1052
1071
|
if (this.listViews.length > 0) {
|
|
1053
|
-
let defaultView =
|
|
1054
|
-
|
|
1072
|
+
let defaultView = this.defaultView === undefined
|
|
1073
|
+
? this.listViews.first
|
|
1074
|
+
: this.defaultView;
|
|
1075
|
+
this.dispatcher.next(new ListViewsLoadAction(this.listViews.map((v) => new ListViewModel(v.id, v.label))));
|
|
1055
1076
|
// activate the default view
|
|
1056
1077
|
this.dispatcher.next(new ListViewsSetActiveAction(defaultView.id));
|
|
1057
1078
|
}
|
|
@@ -1069,14 +1090,14 @@ let SkyListComponent = class SkyListComponent {
|
|
|
1069
1090
|
}
|
|
1070
1091
|
this.dispatcher.next(new ListSortSetFieldSelectorsAction(sortArray || []));
|
|
1071
1092
|
});
|
|
1072
|
-
this.displayedItems.subscribe(result => {
|
|
1093
|
+
this.displayedItems.subscribe((result) => {
|
|
1073
1094
|
this.dispatcher.next(new ListItemsSetLoadingAction());
|
|
1074
1095
|
this.dispatcher.next(new ListItemsLoadAction(result.items, true, true, result.count));
|
|
1075
1096
|
});
|
|
1076
1097
|
// Watch for selection changes.
|
|
1077
1098
|
this.state
|
|
1078
|
-
.pipe(map(current => current.selected), takeUntil(this.ngUnsubscribe), distinctUntilChanged())
|
|
1079
|
-
.subscribe(selected => {
|
|
1099
|
+
.pipe(map((current) => current.selected), takeUntil(this.ngUnsubscribe), distinctUntilChanged())
|
|
1100
|
+
.subscribe((selected) => {
|
|
1080
1101
|
// Update lastSelectedIds to help us retain user selections.
|
|
1081
1102
|
let selectedIdsList = [];
|
|
1082
1103
|
selected.item.selectedIdMap.forEach((value, key) => {
|
|
@@ -1093,7 +1114,7 @@ let SkyListComponent = class SkyListComponent {
|
|
|
1093
1114
|
});
|
|
1094
1115
|
if (this.appliedFiltersChange.observers.length > 0) {
|
|
1095
1116
|
this.state
|
|
1096
|
-
.pipe(map(current => current.filters), takeUntil(this.ngUnsubscribe), skip(1))
|
|
1117
|
+
.pipe(map((current) => current.filters), takeUntil(this.ngUnsubscribe), skip(1))
|
|
1097
1118
|
.subscribe((filters) => {
|
|
1098
1119
|
/**
|
|
1099
1120
|
* We are doing this instead of a distinctUntilChange due to memory allocation issues
|
|
@@ -1109,9 +1130,11 @@ let SkyListComponent = class SkyListComponent {
|
|
|
1109
1130
|
}
|
|
1110
1131
|
ngOnChanges(changes) {
|
|
1111
1132
|
if (changes['appliedFilters'] &&
|
|
1112
|
-
changes['appliedFilters'].currentValue !==
|
|
1133
|
+
changes['appliedFilters'].currentValue !==
|
|
1134
|
+
changes['appliedFilters'].previousValue) {
|
|
1113
1135
|
this.state.pipe(take(1)).subscribe((currentState) => {
|
|
1114
|
-
if (currentState.paging.pageNumber &&
|
|
1136
|
+
if (currentState.paging.pageNumber &&
|
|
1137
|
+
currentState.paging.pageNumber !== 1) {
|
|
1115
1138
|
this.dispatcher.next(new ListPagingSetPageNumberAction(Number(1)));
|
|
1116
1139
|
}
|
|
1117
1140
|
this.dispatcher.filtersUpdate(this.appliedFilters);
|
|
@@ -1156,17 +1179,17 @@ let SkyListComponent = class SkyListComponent {
|
|
|
1156
1179
|
// with adding a debounce time to the Observable which watches for state changes.
|
|
1157
1180
|
let cancelLastRequest = new Subject();
|
|
1158
1181
|
return combineLatest([
|
|
1159
|
-
this.state.pipe(map(s => s.filters), distinctUntilChanged()),
|
|
1160
|
-
this.state.pipe(map(s => s.search), distinctUntilChanged()),
|
|
1161
|
-
this.state.pipe(map(s => s.sort.fieldSelectors), distinctUntilChanged()),
|
|
1162
|
-
this.state.pipe(map(s => s.paging.itemsPerPage), distinctUntilChanged()),
|
|
1163
|
-
this.state.pipe(map(s => s.paging.pageNumber), distinctUntilChanged()),
|
|
1164
|
-
this.state.pipe(map(s => s.toolbar.disabled), distinctUntilChanged()),
|
|
1165
|
-
selectedIds.pipe(distinctUntilChanged(), map(selected => {
|
|
1182
|
+
this.state.pipe(map((s) => s.filters), distinctUntilChanged()),
|
|
1183
|
+
this.state.pipe(map((s) => s.search), distinctUntilChanged()),
|
|
1184
|
+
this.state.pipe(map((s) => s.sort.fieldSelectors), distinctUntilChanged()),
|
|
1185
|
+
this.state.pipe(map((s) => s.paging.itemsPerPage), distinctUntilChanged()),
|
|
1186
|
+
this.state.pipe(map((s) => s.paging.pageNumber), distinctUntilChanged()),
|
|
1187
|
+
this.state.pipe(map((s) => s.toolbar.disabled), distinctUntilChanged()),
|
|
1188
|
+
selectedIds.pipe(distinctUntilChanged(), map((selected) => {
|
|
1166
1189
|
selectedChanged = true;
|
|
1167
1190
|
return selected;
|
|
1168
1191
|
})),
|
|
1169
|
-
data.pipe(distinctUntilChanged())
|
|
1192
|
+
data.pipe(distinctUntilChanged()),
|
|
1170
1193
|
], (filters, search, sortFieldSelectors, itemsPerPage, pageNumber, isToolbarDisabled, selected, itemsData) => {
|
|
1171
1194
|
cancelLastRequest.next();
|
|
1172
1195
|
cancelLastRequest.complete();
|
|
@@ -1179,44 +1202,44 @@ let SkyListComponent = class SkyListComponent {
|
|
|
1179
1202
|
let response;
|
|
1180
1203
|
if (this.dataFirstLoad) {
|
|
1181
1204
|
this.dataFirstLoad = false;
|
|
1182
|
-
let initialItems = itemsData.map(d => new ListItemModel(d.id || `sky-list-item-model-${++idIndex$
|
|
1205
|
+
let initialItems = itemsData.map((d) => new ListItemModel(d.id || `sky-list-item-model-${++idIndex$1}`, d));
|
|
1183
1206
|
response = of(new ListDataResponseModel({
|
|
1184
1207
|
count: this.initialTotal,
|
|
1185
|
-
items: initialItems
|
|
1208
|
+
items: initialItems,
|
|
1186
1209
|
})).pipe(takeUntil(cancelLastRequest));
|
|
1187
1210
|
}
|
|
1188
1211
|
else {
|
|
1189
|
-
response = this.dataProvider
|
|
1212
|
+
response = this.dataProvider
|
|
1213
|
+
.get(new ListDataRequestModel({
|
|
1190
1214
|
filters: filters,
|
|
1191
1215
|
pageSize: itemsPerPage,
|
|
1192
1216
|
pageNumber: pageNumber,
|
|
1193
1217
|
search: search,
|
|
1194
1218
|
sort: new ListSortModel({ fieldSelectors: sortFieldSelectors }),
|
|
1195
|
-
isToolbarDisabled: isToolbarDisabled
|
|
1196
|
-
}))
|
|
1219
|
+
isToolbarDisabled: isToolbarDisabled,
|
|
1220
|
+
}))
|
|
1221
|
+
.pipe(takeUntil(cancelLastRequest));
|
|
1197
1222
|
}
|
|
1198
1223
|
return response;
|
|
1199
|
-
})
|
|
1200
|
-
.pipe(takeUntil(this.ngUnsubscribe),
|
|
1224
|
+
}).pipe(takeUntil(this.ngUnsubscribe),
|
|
1201
1225
|
// Retain user selections from previous state.
|
|
1202
1226
|
// This is only necessary for grids component (based on item.isSelected).
|
|
1203
|
-
map(response => {
|
|
1204
|
-
return response.pipe(map(listDataResponseModel => {
|
|
1227
|
+
map((response) => {
|
|
1228
|
+
return response.pipe(map((listDataResponseModel) => {
|
|
1205
1229
|
return new ListDataResponseModel({
|
|
1206
1230
|
count: listDataResponseModel.count,
|
|
1207
|
-
items: this.getItemsAndRetainSelections(listDataResponseModel.items, this.lastSelectedIds)
|
|
1231
|
+
items: this.getItemsAndRetainSelections(listDataResponseModel.items, this.lastSelectedIds),
|
|
1208
1232
|
});
|
|
1209
1233
|
}));
|
|
1210
|
-
}), flatMap(value => value));
|
|
1234
|
+
}), flatMap((value) => value));
|
|
1211
1235
|
}
|
|
1212
1236
|
get selectedItems() {
|
|
1213
|
-
return combineLatest(this.state.pipe(map(current => current.items.items), distinctUntilChanged()), this.state.pipe(map(current => current.selected), distinctUntilChanged()), (items, selected) => {
|
|
1214
|
-
return items.filter(i => selected.item.selectedIdMap.get(i.id));
|
|
1237
|
+
return combineLatest(this.state.pipe(map((current) => current.items.items), distinctUntilChanged()), this.state.pipe(map((current) => current.selected), distinctUntilChanged()), (items, selected) => {
|
|
1238
|
+
return items.filter((i) => selected.item.selectedIdMap.get(i.id));
|
|
1215
1239
|
}).pipe(takeUntil(this.ngUnsubscribe));
|
|
1216
1240
|
}
|
|
1217
1241
|
get lastUpdate() {
|
|
1218
|
-
return this.state
|
|
1219
|
-
.pipe(takeUntil(this.ngUnsubscribe), map(s => s.items.lastUpdate ? new Date(s.items.lastUpdate) : undefined));
|
|
1242
|
+
return this.state.pipe(takeUntil(this.ngUnsubscribe), map((s) => s.items.lastUpdate ? new Date(s.items.lastUpdate) : undefined));
|
|
1220
1243
|
}
|
|
1221
1244
|
get views() {
|
|
1222
1245
|
return this.listViews.toArray();
|
|
@@ -1226,7 +1249,7 @@ let SkyListComponent = class SkyListComponent {
|
|
|
1226
1249
|
}
|
|
1227
1250
|
getItemsAndRetainSelections(newList, selectedIds) {
|
|
1228
1251
|
let updatedListModel = newList.slice();
|
|
1229
|
-
updatedListModel.forEach(item => {
|
|
1252
|
+
updatedListModel.forEach((item) => {
|
|
1230
1253
|
item.isSelected = selectedIds.indexOf(item.id) > -1 ? true : false;
|
|
1231
1254
|
});
|
|
1232
1255
|
return updatedListModel;
|
|
@@ -1249,68 +1272,56 @@ let SkyListComponent = class SkyListComponent {
|
|
|
1249
1272
|
}
|
|
1250
1273
|
return true;
|
|
1251
1274
|
}
|
|
1252
|
-
}
|
|
1253
|
-
SkyListComponent
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
]
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
],
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
],
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
],
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
]
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
]
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
],
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
}
|
|
1301
|
-
|
|
1302
|
-
NgModule({
|
|
1303
|
-
declarations: [
|
|
1304
|
-
SkyListComponent
|
|
1305
|
-
],
|
|
1306
|
-
imports: [
|
|
1307
|
-
CommonModule
|
|
1308
|
-
],
|
|
1309
|
-
exports: [
|
|
1310
|
-
SkyListComponent
|
|
1311
|
-
]
|
|
1312
|
-
})
|
|
1313
|
-
], SkyListModule);
|
|
1275
|
+
}
|
|
1276
|
+
SkyListComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: SkyListComponent, deps: [{ token: ListState }, { token: ListStateDispatcher }], target: i0.ɵɵFactoryTarget.Component });
|
|
1277
|
+
SkyListComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.13", type: SkyListComponent, selector: "sky-list", inputs: { data: "data", dataProvider: "dataProvider", defaultView: "defaultView", initialTotal: "initialTotal", selectedIds: "selectedIds", sortFields: "sortFields", appliedFilters: "appliedFilters", searchFunction: ["search", "searchFunction"] }, outputs: { selectedIdsChange: "selectedIdsChange", appliedFiltersChange: "appliedFiltersChange" }, providers: [ListState, ListStateDispatcher], queries: [{ propertyName: "listViews", predicate: ListViewComponent }], usesOnChanges: true, ngImport: i0, template: '<ng-content></ng-content>', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1278
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: SkyListComponent, decorators: [{
|
|
1279
|
+
type: Component,
|
|
1280
|
+
args: [{
|
|
1281
|
+
selector: 'sky-list',
|
|
1282
|
+
template: '<ng-content></ng-content>',
|
|
1283
|
+
providers: [ListState, ListStateDispatcher],
|
|
1284
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
1285
|
+
}]
|
|
1286
|
+
}], ctorParameters: function () { return [{ type: ListState }, { type: ListStateDispatcher }]; }, propDecorators: { data: [{
|
|
1287
|
+
type: Input
|
|
1288
|
+
}], dataProvider: [{
|
|
1289
|
+
type: Input
|
|
1290
|
+
}], defaultView: [{
|
|
1291
|
+
type: Input
|
|
1292
|
+
}], initialTotal: [{
|
|
1293
|
+
type: Input
|
|
1294
|
+
}], selectedIds: [{
|
|
1295
|
+
type: Input
|
|
1296
|
+
}], sortFields: [{
|
|
1297
|
+
type: Input
|
|
1298
|
+
}], appliedFilters: [{
|
|
1299
|
+
type: Input
|
|
1300
|
+
}], selectedIdsChange: [{
|
|
1301
|
+
type: Output
|
|
1302
|
+
}], appliedFiltersChange: [{
|
|
1303
|
+
type: Output
|
|
1304
|
+
}], searchFunction: [{
|
|
1305
|
+
type: Input,
|
|
1306
|
+
args: ['search']
|
|
1307
|
+
}], listViews: [{
|
|
1308
|
+
type: ContentChildren,
|
|
1309
|
+
args: [ListViewComponent]
|
|
1310
|
+
}] } });
|
|
1311
|
+
|
|
1312
|
+
class SkyListModule {
|
|
1313
|
+
}
|
|
1314
|
+
SkyListModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: SkyListModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
1315
|
+
SkyListModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: SkyListModule, declarations: [SkyListComponent], imports: [CommonModule], exports: [SkyListComponent] });
|
|
1316
|
+
SkyListModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: SkyListModule, imports: [[CommonModule]] });
|
|
1317
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: SkyListModule, decorators: [{
|
|
1318
|
+
type: NgModule,
|
|
1319
|
+
args: [{
|
|
1320
|
+
declarations: [SkyListComponent],
|
|
1321
|
+
imports: [CommonModule],
|
|
1322
|
+
exports: [SkyListComponent],
|
|
1323
|
+
}]
|
|
1324
|
+
}] });
|
|
1314
1325
|
|
|
1315
1326
|
class ListFilterModel {
|
|
1316
1327
|
constructor(data) {
|
|
@@ -1358,7 +1369,7 @@ class SkyListFilterInlineModel {
|
|
|
1358
1369
|
* [list component's](https://developer.blackbaud.com/skyux/components/list/overview#list-properties)
|
|
1359
1370
|
* `appliedFilters` property.
|
|
1360
1371
|
*/
|
|
1361
|
-
|
|
1372
|
+
class SkyListFilterButtonComponent {
|
|
1362
1373
|
constructor(dispatcher) {
|
|
1363
1374
|
this.dispatcher = dispatcher;
|
|
1364
1375
|
this.filterButtonItemToolbarIndex = 5000;
|
|
@@ -1368,26 +1379,26 @@ let SkyListFilterButtonComponent = class SkyListFilterButtonComponent {
|
|
|
1368
1379
|
new ListToolbarItemModel({
|
|
1369
1380
|
template: this.filterButtonTemplate,
|
|
1370
1381
|
location: 'left',
|
|
1371
|
-
index: this.filterButtonItemToolbarIndex
|
|
1372
|
-
})
|
|
1382
|
+
index: this.filterButtonItemToolbarIndex,
|
|
1383
|
+
}),
|
|
1373
1384
|
]);
|
|
1374
1385
|
}
|
|
1375
|
-
}
|
|
1376
|
-
SkyListFilterButtonComponent
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
],
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
]
|
|
1386
|
+
}
|
|
1387
|
+
SkyListFilterButtonComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: SkyListFilterButtonComponent, deps: [{ token: ListStateDispatcher }], target: i0.ɵɵFactoryTarget.Component });
|
|
1388
|
+
SkyListFilterButtonComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.13", type: SkyListFilterButtonComponent, selector: "sky-list-filter-button", viewQueries: [{ propertyName: "filterButtonTemplate", first: true, predicate: ["filterButton"], descendants: true, read: TemplateRef, static: true }], ngImport: i0, template: "<ng-template #filterButton>\n <ng-content></ng-content>\n</ng-template>\n" });
|
|
1389
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: SkyListFilterButtonComponent, decorators: [{
|
|
1390
|
+
type: Component,
|
|
1391
|
+
args: [{
|
|
1392
|
+
selector: 'sky-list-filter-button',
|
|
1393
|
+
templateUrl: './list-filter-button.component.html',
|
|
1394
|
+
}]
|
|
1395
|
+
}], ctorParameters: function () { return [{ type: ListStateDispatcher }]; }, propDecorators: { filterButtonTemplate: [{
|
|
1396
|
+
type: ViewChild,
|
|
1397
|
+
args: ['filterButton', {
|
|
1398
|
+
read: TemplateRef,
|
|
1399
|
+
static: true,
|
|
1400
|
+
}]
|
|
1401
|
+
}] } });
|
|
1391
1402
|
|
|
1392
1403
|
/**
|
|
1393
1404
|
* Creates a filter summary based on the
|
|
@@ -1395,7 +1406,7 @@ SkyListFilterButtonComponent = __decorate([
|
|
|
1395
1406
|
* `appliedFilters` property. Place this component within the
|
|
1396
1407
|
* [`sky-list-toolbar`](https://developer.blackbaud.com/skyux/components/list/toolbar) component.
|
|
1397
1408
|
*/
|
|
1398
|
-
|
|
1409
|
+
class SkyListFilterSummaryComponent {
|
|
1399
1410
|
constructor(state, dispatcher) {
|
|
1400
1411
|
this.state = state;
|
|
1401
1412
|
this.dispatcher = dispatcher;
|
|
@@ -1410,10 +1421,10 @@ let SkyListFilterSummaryComponent = class SkyListFilterSummaryComponent {
|
|
|
1410
1421
|
setTimeout(() => {
|
|
1411
1422
|
this.appliedFilters = this.state.pipe(map((state) => {
|
|
1412
1423
|
return state.filters.filter((filter) => {
|
|
1413
|
-
return filter.value !== '' &&
|
|
1424
|
+
return (filter.value !== '' &&
|
|
1414
1425
|
filter.value !== undefined &&
|
|
1415
1426
|
filter.value !== false &&
|
|
1416
|
-
filter.value !== filter.defaultValue;
|
|
1427
|
+
filter.value !== filter.defaultValue);
|
|
1417
1428
|
});
|
|
1418
1429
|
}));
|
|
1419
1430
|
});
|
|
@@ -1427,27 +1438,24 @@ let SkyListFilterSummaryComponent = class SkyListFilterSummaryComponent {
|
|
|
1427
1438
|
filterSummaryItemClick(item) {
|
|
1428
1439
|
this.summaryItemClick.emit(item);
|
|
1429
1440
|
}
|
|
1430
|
-
}
|
|
1431
|
-
SkyListFilterSummaryComponent
|
|
1432
|
-
{ type:
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
})
|
|
1443
|
-
], SkyListFilterSummaryComponent);
|
|
1441
|
+
}
|
|
1442
|
+
SkyListFilterSummaryComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: SkyListFilterSummaryComponent, deps: [{ token: ListState }, { token: ListStateDispatcher }], target: i0.ɵɵFactoryTarget.Component });
|
|
1443
|
+
SkyListFilterSummaryComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.13", type: SkyListFilterSummaryComponent, selector: "sky-list-filter-summary", outputs: { summaryItemClick: "summaryItemClick" }, ngImport: i0, template: "<sky-filter-summary>\n <sky-filter-summary-item\n *ngFor=\"let item of appliedFilters | async; let i = index\"\n (dismiss)=\"filterSummaryItemDismiss(i)\"\n (itemClick)=\"filterSummaryItemClick(item)\"\n [dismissible]=\"item.dismissible\"\n >\n {{ item.label || item.value }}\n </sky-filter-summary-item>\n</sky-filter-summary>\n", components: [{ type: i3.λ5, selector: "sky-filter-summary" }, { type: i3.λ4, selector: "sky-filter-summary-item", inputs: ["dismissible"], outputs: ["dismiss", "itemClick"] }], directives: [{ type: i4.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }], pipes: { "async": i4.AsyncPipe } });
|
|
1444
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: SkyListFilterSummaryComponent, decorators: [{
|
|
1445
|
+
type: Component,
|
|
1446
|
+
args: [{
|
|
1447
|
+
selector: 'sky-list-filter-summary',
|
|
1448
|
+
templateUrl: './list-filter-summary.component.html',
|
|
1449
|
+
}]
|
|
1450
|
+
}], ctorParameters: function () { return [{ type: ListState }, { type: ListStateDispatcher }]; }, propDecorators: { summaryItemClick: [{
|
|
1451
|
+
type: Output
|
|
1452
|
+
}] } });
|
|
1444
1453
|
|
|
1445
1454
|
/**
|
|
1446
1455
|
* Creates a filter in the list's inline filter area.
|
|
1447
1456
|
*/
|
|
1448
|
-
|
|
1457
|
+
class SkyListFilterInlineItemComponent {
|
|
1449
1458
|
constructor() {
|
|
1450
|
-
/* tslint:enable:no-input-rename */
|
|
1451
1459
|
this.onChange = new EventEmitter();
|
|
1452
1460
|
}
|
|
1453
1461
|
ngOnInit() {
|
|
@@ -1456,55 +1464,89 @@ let SkyListFilterInlineItemComponent = class SkyListFilterInlineItemComponent {
|
|
|
1456
1464
|
}
|
|
1457
1465
|
}
|
|
1458
1466
|
get template() {
|
|
1459
|
-
return this.templates.length > 0
|
|
1467
|
+
return this.templates.length > 0
|
|
1468
|
+
? this.templates.first
|
|
1469
|
+
: this.templateInput;
|
|
1460
1470
|
}
|
|
1461
|
-
}
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
],
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
],
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
],
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
]
|
|
1471
|
+
}
|
|
1472
|
+
SkyListFilterInlineItemComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: SkyListFilterInlineItemComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1473
|
+
SkyListFilterInlineItemComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.13", type: SkyListFilterInlineItemComponent, selector: "sky-list-filter-inline-item", inputs: { name: "name", value: "value", defaultValue: "defaultValue", filterFunction: ["filter", "filterFunction"], templateInput: ["template", "templateInput"] }, queries: [{ propertyName: "templates", predicate: TemplateRef }], ngImport: i0, template: '<ng-content></ng-content>', isInline: true });
|
|
1474
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: SkyListFilterInlineItemComponent, decorators: [{
|
|
1475
|
+
type: Component,
|
|
1476
|
+
args: [{
|
|
1477
|
+
selector: 'sky-list-filter-inline-item',
|
|
1478
|
+
template: '<ng-content></ng-content>',
|
|
1479
|
+
}]
|
|
1480
|
+
}], propDecorators: { name: [{
|
|
1481
|
+
type: Input
|
|
1482
|
+
}], value: [{
|
|
1483
|
+
type: Input
|
|
1484
|
+
}], defaultValue: [{
|
|
1485
|
+
type: Input
|
|
1486
|
+
}], filterFunction: [{
|
|
1487
|
+
type: Input,
|
|
1488
|
+
args: ['filter']
|
|
1489
|
+
}], templateInput: [{
|
|
1490
|
+
type: Input,
|
|
1491
|
+
args: ['template']
|
|
1492
|
+
}], templates: [{
|
|
1493
|
+
type: ContentChildren,
|
|
1494
|
+
args: [TemplateRef]
|
|
1495
|
+
}] } });
|
|
1496
|
+
|
|
1497
|
+
/**
|
|
1498
|
+
* @internal
|
|
1499
|
+
*/
|
|
1500
|
+
class SkyListFilterInlineItemRendererComponent {
|
|
1501
|
+
ngOnInit() {
|
|
1502
|
+
/* istanbul ignore else */
|
|
1503
|
+
/* sanity check */
|
|
1504
|
+
if (this.template !== undefined) {
|
|
1505
|
+
this.container.createEmbeddedView(this.template, this);
|
|
1506
|
+
}
|
|
1507
|
+
}
|
|
1508
|
+
}
|
|
1509
|
+
SkyListFilterInlineItemRendererComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: SkyListFilterInlineItemRendererComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1510
|
+
SkyListFilterInlineItemRendererComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.13", type: SkyListFilterInlineItemRendererComponent, selector: "sky-list-filter-inline-item-renderer", inputs: { template: "template", filter: "filter" }, viewQueries: [{ propertyName: "container", first: true, predicate: ["container"], descendants: true, read: ViewContainerRef, static: true }], ngImport: i0, template: '<ng-template #container></ng-template>', isInline: true });
|
|
1511
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: SkyListFilterInlineItemRendererComponent, decorators: [{
|
|
1512
|
+
type: Component,
|
|
1513
|
+
args: [{
|
|
1514
|
+
selector: 'sky-list-filter-inline-item-renderer',
|
|
1515
|
+
template: '<ng-template #container></ng-template>',
|
|
1516
|
+
}]
|
|
1517
|
+
}], propDecorators: { template: [{
|
|
1518
|
+
type: Input
|
|
1519
|
+
}], filter: [{
|
|
1520
|
+
type: Input
|
|
1521
|
+
}], container: [{
|
|
1522
|
+
type: ViewChild,
|
|
1523
|
+
args: ['container', {
|
|
1524
|
+
read: ViewContainerRef,
|
|
1525
|
+
static: true,
|
|
1526
|
+
}]
|
|
1527
|
+
}] } });
|
|
1486
1528
|
|
|
1487
1529
|
/**
|
|
1488
1530
|
* Creates an inline filter area for the list. Place each filter
|
|
1489
1531
|
* in a `sky-list-filter-inline-item` component.
|
|
1490
1532
|
*/
|
|
1491
|
-
|
|
1533
|
+
class SkyListFilterInlineComponent {
|
|
1492
1534
|
constructor(dispatcher, state) {
|
|
1493
1535
|
this.dispatcher = dispatcher;
|
|
1494
1536
|
this.state = state;
|
|
1495
1537
|
this.inlineFilters = [];
|
|
1496
1538
|
}
|
|
1497
1539
|
ngAfterContentInit() {
|
|
1498
|
-
this.inlineFilters = this.filters.map(filter => {
|
|
1540
|
+
this.inlineFilters = this.filters.map((filter) => {
|
|
1499
1541
|
return new SkyListFilterInlineModel({
|
|
1500
1542
|
name: filter.name,
|
|
1501
1543
|
filterFunction: filter.filterFunction,
|
|
1502
1544
|
template: filter.template,
|
|
1503
1545
|
value: filter.value,
|
|
1504
|
-
defaultValue: filter.defaultValue
|
|
1546
|
+
defaultValue: filter.defaultValue,
|
|
1505
1547
|
});
|
|
1506
1548
|
});
|
|
1507
|
-
this.inlineFilters.forEach(filter => {
|
|
1549
|
+
this.inlineFilters.forEach((filter) => {
|
|
1508
1550
|
filter.onChange.subscribe((value) => {
|
|
1509
1551
|
this.applyFilters();
|
|
1510
1552
|
});
|
|
@@ -1513,7 +1555,8 @@ let SkyListFilterInlineComponent = class SkyListFilterInlineComponent {
|
|
|
1513
1555
|
}
|
|
1514
1556
|
applyFilters() {
|
|
1515
1557
|
this.state.pipe(take(1)).subscribe((currentState) => {
|
|
1516
|
-
if (currentState.paging.pageNumber &&
|
|
1558
|
+
if (currentState.paging.pageNumber &&
|
|
1559
|
+
currentState.paging.pageNumber !== 1) {
|
|
1517
1560
|
this.dispatcher.next(new ListPagingSetPageNumberAction(Number(1)));
|
|
1518
1561
|
}
|
|
1519
1562
|
this.dispatcher.filtersUpdate(this.getFilterModelFromInline(this.inlineFilters));
|
|
@@ -1525,80 +1568,55 @@ let SkyListFilterInlineComponent = class SkyListFilterInlineComponent {
|
|
|
1525
1568
|
name: filter.name,
|
|
1526
1569
|
value: filter.value,
|
|
1527
1570
|
filterFunction: filter.filterFunction,
|
|
1528
|
-
defaultValue: filter.defaultValue
|
|
1571
|
+
defaultValue: filter.defaultValue,
|
|
1529
1572
|
});
|
|
1530
1573
|
});
|
|
1531
1574
|
}
|
|
1532
|
-
}
|
|
1533
|
-
SkyListFilterInlineComponent
|
|
1534
|
-
{ type:
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
}
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
]
|
|
1577
|
-
|
|
1578
|
-
let SkyListFiltersModule = class SkyListFiltersModule {
|
|
1579
|
-
};
|
|
1580
|
-
SkyListFiltersModule = __decorate([
|
|
1581
|
-
NgModule({
|
|
1582
|
-
declarations: [
|
|
1583
|
-
SkyListFilterButtonComponent,
|
|
1584
|
-
SkyListFilterSummaryComponent,
|
|
1585
|
-
SkyListFilterInlineItemComponent,
|
|
1586
|
-
SkyListFilterInlineComponent,
|
|
1587
|
-
SkyListFilterInlineItemRendererComponent
|
|
1588
|
-
],
|
|
1589
|
-
imports: [
|
|
1590
|
-
CommonModule,
|
|
1591
|
-
SkyFilterModule
|
|
1592
|
-
],
|
|
1593
|
-
exports: [
|
|
1594
|
-
SkyListFilterButtonComponent,
|
|
1595
|
-
SkyListFilterSummaryComponent,
|
|
1596
|
-
SkyListFilterInlineItemComponent,
|
|
1597
|
-
SkyListFilterInlineComponent,
|
|
1598
|
-
SkyListFilterInlineItemRendererComponent
|
|
1599
|
-
]
|
|
1600
|
-
})
|
|
1601
|
-
], SkyListFiltersModule);
|
|
1575
|
+
}
|
|
1576
|
+
SkyListFilterInlineComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: SkyListFilterInlineComponent, deps: [{ token: ListStateDispatcher }, { token: ListState }], target: i0.ɵɵFactoryTarget.Component });
|
|
1577
|
+
SkyListFilterInlineComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.13", type: SkyListFilterInlineComponent, selector: "sky-list-filter-inline", queries: [{ propertyName: "filters", predicate: SkyListFilterInlineItemComponent }], ngImport: i0, template: "<ng-content></ng-content>\n\n<sky-filter-inline>\n <sky-filter-inline-item *ngFor=\"let filter of inlineFilters\">\n <sky-list-filter-inline-item-renderer\n [template]=\"filter.template\"\n [filter]=\"filter\"\n >\n </sky-list-filter-inline-item-renderer>\n </sky-filter-inline-item>\n</sky-filter-inline>\n", components: [{ type: i3.λ2, selector: "sky-filter-inline" }, { type: i3.λ3, selector: "sky-filter-inline-item" }, { type: SkyListFilterInlineItemRendererComponent, selector: "sky-list-filter-inline-item-renderer", inputs: ["template", "filter"] }], directives: [{ type: i4.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }] });
|
|
1578
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: SkyListFilterInlineComponent, decorators: [{
|
|
1579
|
+
type: Component,
|
|
1580
|
+
args: [{
|
|
1581
|
+
selector: 'sky-list-filter-inline',
|
|
1582
|
+
templateUrl: './list-filter-inline.component.html',
|
|
1583
|
+
}]
|
|
1584
|
+
}], ctorParameters: function () { return [{ type: ListStateDispatcher }, { type: ListState }]; }, propDecorators: { filters: [{
|
|
1585
|
+
type: ContentChildren,
|
|
1586
|
+
args: [SkyListFilterInlineItemComponent]
|
|
1587
|
+
}] } });
|
|
1588
|
+
|
|
1589
|
+
class SkyListFiltersModule {
|
|
1590
|
+
}
|
|
1591
|
+
SkyListFiltersModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: SkyListFiltersModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
1592
|
+
SkyListFiltersModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: SkyListFiltersModule, declarations: [SkyListFilterButtonComponent,
|
|
1593
|
+
SkyListFilterSummaryComponent,
|
|
1594
|
+
SkyListFilterInlineItemComponent,
|
|
1595
|
+
SkyListFilterInlineComponent,
|
|
1596
|
+
SkyListFilterInlineItemRendererComponent], imports: [CommonModule, SkyFilterModule], exports: [SkyListFilterButtonComponent,
|
|
1597
|
+
SkyListFilterSummaryComponent,
|
|
1598
|
+
SkyListFilterInlineItemComponent,
|
|
1599
|
+
SkyListFilterInlineComponent] });
|
|
1600
|
+
SkyListFiltersModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: SkyListFiltersModule, imports: [[CommonModule, SkyFilterModule]] });
|
|
1601
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: SkyListFiltersModule, decorators: [{
|
|
1602
|
+
type: NgModule,
|
|
1603
|
+
args: [{
|
|
1604
|
+
declarations: [
|
|
1605
|
+
SkyListFilterButtonComponent,
|
|
1606
|
+
SkyListFilterSummaryComponent,
|
|
1607
|
+
SkyListFilterInlineItemComponent,
|
|
1608
|
+
SkyListFilterInlineComponent,
|
|
1609
|
+
SkyListFilterInlineItemRendererComponent,
|
|
1610
|
+
],
|
|
1611
|
+
imports: [CommonModule, SkyFilterModule],
|
|
1612
|
+
exports: [
|
|
1613
|
+
SkyListFilterButtonComponent,
|
|
1614
|
+
SkyListFilterSummaryComponent,
|
|
1615
|
+
SkyListFilterInlineItemComponent,
|
|
1616
|
+
SkyListFilterInlineComponent,
|
|
1617
|
+
],
|
|
1618
|
+
}]
|
|
1619
|
+
}] });
|
|
1602
1620
|
|
|
1603
1621
|
/**
|
|
1604
1622
|
* Provides a SKY UX-themed pagination control to display list data across multiple pages.
|
|
@@ -1612,11 +1630,12 @@ class ListPagingComponent {
|
|
|
1612
1630
|
}
|
|
1613
1631
|
}
|
|
1614
1632
|
|
|
1615
|
-
|
|
1633
|
+
/* istanbul ignore next */
|
|
1634
|
+
const listPagingComponentRef = forwardRef(() => SkyListPagingComponent);
|
|
1616
1635
|
/**
|
|
1617
1636
|
* Displays a pagination control for a SKY UX-themed list of data.
|
|
1618
1637
|
*/
|
|
1619
|
-
|
|
1638
|
+
class SkyListPagingComponent extends ListPagingComponent {
|
|
1620
1639
|
constructor(state, dispatcher) {
|
|
1621
1640
|
super(state, dispatcher);
|
|
1622
1641
|
/**
|
|
@@ -1636,11 +1655,10 @@ let SkyListPagingComponent = SkyListPagingComponent_1 = class SkyListPagingCompo
|
|
|
1636
1655
|
this.pageNumber = 1;
|
|
1637
1656
|
}
|
|
1638
1657
|
ngOnInit() {
|
|
1639
|
-
this.currentPageNumber = this.state.pipe(map(s => s.paging.pageNumber));
|
|
1640
|
-
this.maxDisplayedPages = this.state.pipe(map(s => s.paging.maxDisplayedPages));
|
|
1641
|
-
this.itemsPerPage = this.state.pipe(map(s => s.paging.itemsPerPage));
|
|
1642
|
-
this.itemCount = this.state
|
|
1643
|
-
.pipe(map((s) => {
|
|
1658
|
+
this.currentPageNumber = this.state.pipe(map((s) => s.paging.pageNumber));
|
|
1659
|
+
this.maxDisplayedPages = this.state.pipe(map((s) => s.paging.maxDisplayedPages));
|
|
1660
|
+
this.itemsPerPage = this.state.pipe(map((s) => s.paging.itemsPerPage));
|
|
1661
|
+
this.itemCount = this.state.pipe(map((s) => {
|
|
1644
1662
|
return s.items;
|
|
1645
1663
|
}), scan((previousValue, newValue) => {
|
|
1646
1664
|
if (previousValue.lastUpdate > newValue.lastUpdate) {
|
|
@@ -1664,78 +1682,97 @@ let SkyListPagingComponent = SkyListPagingComponent_1 = class SkyListPagingCompo
|
|
|
1664
1682
|
this.dispatcher.next(new ListPagingSetPageNumberAction(Number(currentPage)));
|
|
1665
1683
|
});
|
|
1666
1684
|
}
|
|
1685
|
+
}
|
|
1686
|
+
SkyListPagingComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: SkyListPagingComponent, deps: [{ token: ListState }, { token: ListStateDispatcher }], target: i0.ɵɵFactoryTarget.Component });
|
|
1687
|
+
SkyListPagingComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.13", type: SkyListPagingComponent, selector: "sky-list-paging", inputs: { pageSize: "pageSize", maxPages: "maxPages", pageNumber: "pageNumber" }, providers: [
|
|
1688
|
+
{ provide: ListPagingComponent, useExisting: listPagingComponentRef },
|
|
1689
|
+
], usesInheritance: true, ngImport: i0, template: "<sky-paging\n [pageSize]=\"itemsPerPage | async\"\n [maxPages]=\"maxDisplayedPages | async\"\n [currentPage]=\"currentPageNumber | async\"\n [itemCount]=\"itemCount | async\"\n (currentPageChange)=\"pageChange($event)\"\n>\n</sky-paging>\n", components: [{ type: i3.λ7, selector: "sky-paging", inputs: ["currentPage", "itemCount", "maxPages", "pageSize", "pagingLabel"], outputs: ["currentPageChange"] }], pipes: { "async": i4.AsyncPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1690
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: SkyListPagingComponent, decorators: [{
|
|
1691
|
+
type: Component,
|
|
1692
|
+
args: [{
|
|
1693
|
+
selector: 'sky-list-paging',
|
|
1694
|
+
templateUrl: './list-paging.component.html',
|
|
1695
|
+
providers: [
|
|
1696
|
+
{ provide: ListPagingComponent, useExisting: listPagingComponentRef },
|
|
1697
|
+
],
|
|
1698
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
1699
|
+
}]
|
|
1700
|
+
}], ctorParameters: function () { return [{ type: ListState }, { type: ListStateDispatcher }]; }, propDecorators: { pageSize: [{
|
|
1701
|
+
type: Input
|
|
1702
|
+
}], maxPages: [{
|
|
1703
|
+
type: Input
|
|
1704
|
+
}], pageNumber: [{
|
|
1705
|
+
type: Input
|
|
1706
|
+
}] } });
|
|
1707
|
+
|
|
1708
|
+
class SkyListPagingModule {
|
|
1709
|
+
}
|
|
1710
|
+
SkyListPagingModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: SkyListPagingModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
1711
|
+
SkyListPagingModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: SkyListPagingModule, declarations: [SkyListPagingComponent], imports: [CommonModule, SkyPagingModule], exports: [SkyListPagingComponent] });
|
|
1712
|
+
SkyListPagingModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: SkyListPagingModule, imports: [[CommonModule, SkyPagingModule]] });
|
|
1713
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: SkyListPagingModule, decorators: [{
|
|
1714
|
+
type: NgModule,
|
|
1715
|
+
args: [{
|
|
1716
|
+
declarations: [SkyListPagingComponent],
|
|
1717
|
+
imports: [CommonModule, SkyPagingModule],
|
|
1718
|
+
exports: [SkyListPagingComponent],
|
|
1719
|
+
}]
|
|
1720
|
+
}] });
|
|
1721
|
+
|
|
1722
|
+
/**
|
|
1723
|
+
* NOTICE: DO NOT MODIFY THIS FILE!
|
|
1724
|
+
* The contents of this file were automatically generated by
|
|
1725
|
+
* the 'ng generate @skyux/i18n:lib-resources-module modules/shared/sky-list-builder' schematic.
|
|
1726
|
+
* To update this file, simply rerun the command.
|
|
1727
|
+
*/
|
|
1728
|
+
const RESOURCES = {
|
|
1729
|
+
'EN-US': {
|
|
1730
|
+
skyux_list_show_secondary_actions_button: { message: 'More' },
|
|
1731
|
+
skyux_list_multiselect_clear_all: { message: 'Clear all' },
|
|
1732
|
+
skyux_list_mutliselect_select_all: { message: 'Select all' },
|
|
1733
|
+
skyux_list_mutliselect_show_selected: {
|
|
1734
|
+
message: 'Only show selected items',
|
|
1735
|
+
},
|
|
1736
|
+
skyux_list_view_switcher_dropdown_title: { message: 'Select view' },
|
|
1737
|
+
},
|
|
1667
1738
|
};
|
|
1668
|
-
|
|
1669
|
-
{ type: ListState },
|
|
1670
|
-
{ type: ListStateDispatcher }
|
|
1671
|
-
];
|
|
1672
|
-
__decorate([
|
|
1673
|
-
Input()
|
|
1674
|
-
], SkyListPagingComponent.prototype, "pageSize", void 0);
|
|
1675
|
-
__decorate([
|
|
1676
|
-
Input()
|
|
1677
|
-
], SkyListPagingComponent.prototype, "maxPages", void 0);
|
|
1678
|
-
__decorate([
|
|
1679
|
-
Input()
|
|
1680
|
-
], SkyListPagingComponent.prototype, "pageNumber", void 0);
|
|
1681
|
-
SkyListPagingComponent = SkyListPagingComponent_1 = __decorate([
|
|
1682
|
-
Component({
|
|
1683
|
-
selector: 'sky-list-paging',
|
|
1684
|
-
template: "<sky-paging\n [pageSize]=\"itemsPerPage | async\"\n [maxPages]=\"maxDisplayedPages | async\"\n [currentPage]=\"currentPageNumber | async\"\n [itemCount]=\"itemCount | async\"\n (currentPageChange)=\"pageChange($event)\"\n >\n</sky-paging>\n",
|
|
1685
|
-
providers: [
|
|
1686
|
-
/* tslint:disable */
|
|
1687
|
-
{ provide: ListPagingComponent, useExisting: forwardRef(() => SkyListPagingComponent_1) }
|
|
1688
|
-
/* tslint:enable */
|
|
1689
|
-
],
|
|
1690
|
-
changeDetection: ChangeDetectionStrategy.OnPush
|
|
1691
|
-
})
|
|
1692
|
-
], SkyListPagingComponent);
|
|
1693
|
-
|
|
1694
|
-
let SkyListPagingModule = class SkyListPagingModule {
|
|
1695
|
-
};
|
|
1696
|
-
SkyListPagingModule = __decorate([
|
|
1697
|
-
NgModule({
|
|
1698
|
-
declarations: [
|
|
1699
|
-
SkyListPagingComponent
|
|
1700
|
-
],
|
|
1701
|
-
imports: [
|
|
1702
|
-
CommonModule,
|
|
1703
|
-
SkyPagingModule
|
|
1704
|
-
],
|
|
1705
|
-
exports: [
|
|
1706
|
-
SkyListPagingComponent
|
|
1707
|
-
]
|
|
1708
|
-
})
|
|
1709
|
-
], SkyListPagingModule);
|
|
1710
|
-
|
|
1711
|
-
let SkyListBuilderResourcesProvider = class SkyListBuilderResourcesProvider {
|
|
1712
|
-
constructor() {
|
|
1713
|
-
this.resources = { "EN-US": { "skyux_list_show_secondary_actions_button": "More", "skyux_list_multiselect_clear_all": "Clear all", "skyux_list_mutliselect_select_all": "Select all", "skyux_list_mutliselect_show_selected": "Only show selected items", "skyux_list_view_switcher_dropdown_title": "Select view" } };
|
|
1714
|
-
}
|
|
1739
|
+
class SkyListBuilderResourcesProvider {
|
|
1715
1740
|
getString(localeInfo, name) {
|
|
1716
|
-
return
|
|
1741
|
+
return getLibStringForLocale(RESOURCES, localeInfo.locale, name);
|
|
1717
1742
|
}
|
|
1718
|
-
}
|
|
1719
|
-
|
|
1720
|
-
|
|
1721
|
-
|
|
1722
|
-
|
|
1723
|
-
|
|
1724
|
-
};
|
|
1725
|
-
SkyListBuilderResourcesModule =
|
|
1726
|
-
|
|
1727
|
-
|
|
1728
|
-
|
|
1729
|
-
|
|
1730
|
-
|
|
1731
|
-
|
|
1732
|
-
})
|
|
1733
|
-
|
|
1743
|
+
}
|
|
1744
|
+
/**
|
|
1745
|
+
* Import into any component library module that needs to use resource strings.
|
|
1746
|
+
*/
|
|
1747
|
+
class SkyListBuilderResourcesModule {
|
|
1748
|
+
}
|
|
1749
|
+
SkyListBuilderResourcesModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: SkyListBuilderResourcesModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
1750
|
+
SkyListBuilderResourcesModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: SkyListBuilderResourcesModule, exports: [SkyI18nModule] });
|
|
1751
|
+
SkyListBuilderResourcesModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: SkyListBuilderResourcesModule, providers: [
|
|
1752
|
+
{
|
|
1753
|
+
provide: SKY_LIB_RESOURCES_PROVIDERS,
|
|
1754
|
+
useClass: SkyListBuilderResourcesProvider,
|
|
1755
|
+
multi: true,
|
|
1756
|
+
},
|
|
1757
|
+
], imports: [SkyI18nModule] });
|
|
1758
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: SkyListBuilderResourcesModule, decorators: [{
|
|
1759
|
+
type: NgModule,
|
|
1760
|
+
args: [{
|
|
1761
|
+
exports: [SkyI18nModule],
|
|
1762
|
+
providers: [
|
|
1763
|
+
{
|
|
1764
|
+
provide: SKY_LIB_RESOURCES_PROVIDERS,
|
|
1765
|
+
useClass: SkyListBuilderResourcesProvider,
|
|
1766
|
+
multi: true,
|
|
1767
|
+
},
|
|
1768
|
+
],
|
|
1769
|
+
}]
|
|
1770
|
+
}] });
|
|
1734
1771
|
|
|
1735
1772
|
/**
|
|
1736
1773
|
* @internal
|
|
1737
1774
|
*/
|
|
1738
|
-
|
|
1775
|
+
class SkyListSecondaryActionsService {
|
|
1739
1776
|
constructor() {
|
|
1740
1777
|
this.secondaryActionsCount = 0;
|
|
1741
1778
|
this.secondaryActionsSubject = new BehaviorSubject(0);
|
|
@@ -1751,23 +1788,65 @@ let SkyListSecondaryActionsService = class SkyListSecondaryActionsService {
|
|
|
1751
1788
|
removeSecondaryAction(action) {
|
|
1752
1789
|
this.secondaryActionsCount--;
|
|
1753
1790
|
this.secondaryActionsSubject.next(this.secondaryActionsCount);
|
|
1754
|
-
this.actions = this.actions.filter(existingItem => existingItem !== action);
|
|
1791
|
+
this.actions = this.actions.filter((existingItem) => existingItem !== action);
|
|
1755
1792
|
this.actionsStream.next(this.actions);
|
|
1756
1793
|
}
|
|
1757
1794
|
ngOnDestroy() {
|
|
1758
1795
|
this.secondaryActionsSubject.complete();
|
|
1759
1796
|
this.actionsStream.complete();
|
|
1760
1797
|
}
|
|
1761
|
-
}
|
|
1762
|
-
SkyListSecondaryActionsService =
|
|
1763
|
-
|
|
1764
|
-
|
|
1798
|
+
}
|
|
1799
|
+
SkyListSecondaryActionsService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: SkyListSecondaryActionsService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1800
|
+
SkyListSecondaryActionsService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: SkyListSecondaryActionsService });
|
|
1801
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: SkyListSecondaryActionsService, decorators: [{
|
|
1802
|
+
type: Injectable
|
|
1803
|
+
}] });
|
|
1804
|
+
|
|
1805
|
+
// Note: this component is needed to ensure any reactive styles placed in the element have
|
|
1806
|
+
// their host to be based off of. Without this component the host is not written via the dispatcher.
|
|
1807
|
+
/**
|
|
1808
|
+
* @internal
|
|
1809
|
+
*/
|
|
1810
|
+
class SkyListSecondaryActionsHostComponent {
|
|
1811
|
+
constructor(changeDetector, actionService) {
|
|
1812
|
+
this.changeDetector = changeDetector;
|
|
1813
|
+
this.actionService = actionService;
|
|
1814
|
+
this.dropdownHidden = false;
|
|
1815
|
+
this.actions = [];
|
|
1816
|
+
this.ngUnsubscribe = new Subject();
|
|
1817
|
+
}
|
|
1818
|
+
ngOnInit() {
|
|
1819
|
+
this.actionService.actionsStream
|
|
1820
|
+
.pipe(takeUntil(this.ngUnsubscribe), distinctUntilChanged())
|
|
1821
|
+
.subscribe((actions) => {
|
|
1822
|
+
const hasSecondaryActions = actions.length > 0;
|
|
1823
|
+
this.dropdownHidden = !hasSecondaryActions;
|
|
1824
|
+
this.actions = actions;
|
|
1825
|
+
this.changeDetector.detectChanges();
|
|
1826
|
+
});
|
|
1827
|
+
}
|
|
1828
|
+
ngOnDestroy() {
|
|
1829
|
+
this.ngUnsubscribe.next();
|
|
1830
|
+
this.ngUnsubscribe.complete();
|
|
1831
|
+
}
|
|
1832
|
+
}
|
|
1833
|
+
SkyListSecondaryActionsHostComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: SkyListSecondaryActionsHostComponent, deps: [{ token: i0.ChangeDetectorRef }, { token: SkyListSecondaryActionsService }], target: i0.ɵɵFactoryTarget.Component });
|
|
1834
|
+
SkyListSecondaryActionsHostComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.13", type: SkyListSecondaryActionsHostComponent, selector: "sky-list-secondary-actions-host", ngImport: i0, template: "<div\n class=\"sky-list-secondary-actions\"\n [ngClass]=\"{ 'sky-list-secondary-actions-hidden': dropdownHidden }\"\n>\n <sky-dropdown\n [attr.title]=\"'skyux_list_show_secondary_actions_button' | skyLibResources\"\n [label]=\"'skyux_list_show_secondary_actions_button' | skyLibResources\"\n >\n <sky-dropdown-button>\n <sky-icon icon=\"ellipsis-h\"> </sky-icon>\n <span class=\"sky-list-secondary-actions-btn-text\">\n {{ 'skyux_list_show_secondary_actions_button' | skyLibResources }}\n </span>\n </sky-dropdown-button>\n <sky-dropdown-menu>\n <sky-dropdown-item *ngFor=\"let action of actions\">\n <ng-container *ngTemplateOutlet=\"action.template\"> </ng-container>\n </sky-dropdown-item>\n </sky-dropdown-menu>\n </sky-dropdown>\n</div>\n<ng-content> </ng-content>\n", styles: [".sky-list-secondary-actions ::ng-deep .sky-dropdown-button-type-select{padding:6px 12px}.sky-list-secondary-actions ::ng-deep .sky-dropdown-button-type-select sky-icon[icon=ellipsis-h]{font-size:1.33333em;line-height:.75em;vertical-align:-15%}.sky-list-secondary-actions-hidden{display:none}:host .sky-list-secondary-actions-btn-text{display:none}:host .sky-list-secondary-actions ::ng-deep .sky-dropdown-caret{display:none}:host-context(.sky-responsive-container-xs) .sky-list-secondary-actions-btn-text,:host-context(.sky-responsive-container-sm) .sky-list-secondary-actions-btn-text,:host-context(.sky-responsive-container-md) .sky-list-secondary-actions-btn-text,:host-context(.sky-responsive-container-lg) .sky-list-secondary-actions-btn-text{display:none}:host-context(.sky-responsive-container-xs) .sky-list-secondary-actions ::ng-deep .sky-dropdown-caret,:host-context(.sky-responsive-container-sm) .sky-list-secondary-actions ::ng-deep .sky-dropdown-caret,:host-context(.sky-responsive-container-md) .sky-list-secondary-actions ::ng-deep .sky-dropdown-caret,:host-context(.sky-responsive-container-lg) .sky-list-secondary-actions ::ng-deep .sky-dropdown-caret{display:none}@media (min-width: 768px){:host .sky-list-secondary-actions-btn-text{display:inline}:host .sky-list-secondary-actions ::ng-deep .sky-dropdown-caret{display:inline-block}}:host-context(.sky-responsive-container-sm) .sky-list-secondary-actions-btn-text,:host-context(.sky-responsive-container-md) .sky-list-secondary-actions-btn-text,:host-context(.sky-responsive-container-lg) .sky-list-secondary-actions-btn-text{display:inline}:host-context(.sky-responsive-container-sm) .sky-list-secondary-actions ::ng-deep .sky-dropdown-caret,:host-context(.sky-responsive-container-md) .sky-list-secondary-actions ::ng-deep .sky-dropdown-caret,:host-context(.sky-responsive-container-lg) .sky-list-secondary-actions ::ng-deep .sky-dropdown-caret{display:inline-block}\n"], components: [{ type: i2.λ3, selector: "sky-dropdown", inputs: ["buttonStyle", "buttonType", "disabled", "dismissOnBlur", "label", "horizontalAlignment", "messageStream", "title", "trigger"] }, { type: i2.λ2, selector: "sky-dropdown-button" }, { type: i3$1.λ4, selector: "sky-icon", inputs: ["icon", "iconType", "size", "fixedWidth", "variant"] }, { type: i2.λ4, selector: "sky-dropdown-menu", inputs: ["ariaLabelledBy", "ariaRole", "useNativeFocus"], outputs: ["menuChanges"] }, { type: i2.λ1, selector: "sky-dropdown-item", inputs: ["ariaRole"] }], directives: [{ type: i4.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i4.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i4.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }], pipes: { "skyLibResources": i5.SkyLibResourcesPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1835
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: SkyListSecondaryActionsHostComponent, decorators: [{
|
|
1836
|
+
type: Component,
|
|
1837
|
+
args: [{
|
|
1838
|
+
selector: 'sky-list-secondary-actions-host',
|
|
1839
|
+
templateUrl: './list-secondary-actions-host.component.html',
|
|
1840
|
+
styleUrls: ['./list-secondary-actions-host.component.scss'],
|
|
1841
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
1842
|
+
}]
|
|
1843
|
+
}], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }, { type: SkyListSecondaryActionsService }]; } });
|
|
1765
1844
|
|
|
1766
1845
|
/**
|
|
1767
1846
|
* Adds a dropdown to the list toolbar for secondary actions. If the dropdown does not
|
|
1768
1847
|
* include actions, the secondary actions dropdown is hidden.
|
|
1769
1848
|
*/
|
|
1770
|
-
|
|
1849
|
+
class SkyListSecondaryActionsComponent {
|
|
1771
1850
|
constructor(dispatcher) {
|
|
1772
1851
|
this.dispatcher = dispatcher;
|
|
1773
1852
|
this.actions = [];
|
|
@@ -1778,137 +1857,104 @@ let SkyListSecondaryActionsComponent = class SkyListSecondaryActionsComponent {
|
|
|
1778
1857
|
id: 'secondary-actions',
|
|
1779
1858
|
template: this.secondaryActionsTemplate,
|
|
1780
1859
|
location: 'center',
|
|
1781
|
-
index: this.secondaryActionsItemToolbarIndex
|
|
1860
|
+
index: this.secondaryActionsItemToolbarIndex,
|
|
1782
1861
|
});
|
|
1783
|
-
this.dispatcher.toolbarAddItems([
|
|
1784
|
-
secondaryActionItem
|
|
1785
|
-
]);
|
|
1862
|
+
this.dispatcher.toolbarAddItems([secondaryActionItem]);
|
|
1786
1863
|
}
|
|
1787
|
-
}
|
|
1788
|
-
SkyListSecondaryActionsComponent
|
|
1789
|
-
{ type:
|
|
1790
|
-
|
|
1791
|
-
|
|
1792
|
-
|
|
1793
|
-
|
|
1794
|
-
|
|
1795
|
-
|
|
1796
|
-
|
|
1797
|
-
|
|
1798
|
-
|
|
1799
|
-
|
|
1800
|
-
|
|
1801
|
-
|
|
1802
|
-
|
|
1803
|
-
|
|
1804
|
-
|
|
1805
|
-
})
|
|
1806
|
-
], SkyListSecondaryActionsComponent);
|
|
1864
|
+
}
|
|
1865
|
+
SkyListSecondaryActionsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: SkyListSecondaryActionsComponent, deps: [{ token: ListStateDispatcher }], target: i0.ɵɵFactoryTarget.Component });
|
|
1866
|
+
SkyListSecondaryActionsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.13", type: SkyListSecondaryActionsComponent, selector: "sky-list-secondary-actions", providers: [SkyListSecondaryActionsService], viewQueries: [{ propertyName: "secondaryActionsTemplate", first: true, predicate: ["secondaryActions"], descendants: true, read: TemplateRef, static: true }], ngImport: i0, template: "<ng-template #secondaryActions>\n <sky-list-secondary-actions-host>\n <ng-content></ng-content>\n </sky-list-secondary-actions-host>\n</ng-template>\n", components: [{ type: SkyListSecondaryActionsHostComponent, selector: "sky-list-secondary-actions-host" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1867
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: SkyListSecondaryActionsComponent, decorators: [{
|
|
1868
|
+
type: Component,
|
|
1869
|
+
args: [{
|
|
1870
|
+
selector: 'sky-list-secondary-actions',
|
|
1871
|
+
templateUrl: './list-secondary-actions.component.html',
|
|
1872
|
+
providers: [SkyListSecondaryActionsService],
|
|
1873
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
1874
|
+
}]
|
|
1875
|
+
}], ctorParameters: function () { return [{ type: ListStateDispatcher }]; }, propDecorators: { secondaryActionsTemplate: [{
|
|
1876
|
+
type: ViewChild,
|
|
1877
|
+
args: ['secondaryActions', {
|
|
1878
|
+
read: TemplateRef,
|
|
1879
|
+
static: true,
|
|
1880
|
+
}]
|
|
1881
|
+
}] } });
|
|
1807
1882
|
|
|
1808
1883
|
/**
|
|
1809
1884
|
* Adds actions to the secondary actions dropdown in the list toolbar.
|
|
1810
1885
|
*/
|
|
1811
|
-
|
|
1886
|
+
class SkyListSecondaryActionComponent {
|
|
1812
1887
|
constructor(actionService) {
|
|
1813
1888
|
this.actionService = actionService;
|
|
1814
1889
|
}
|
|
1815
1890
|
ngAfterContentInit() {
|
|
1816
1891
|
this.actionService.addSecondaryAction({
|
|
1817
|
-
template: this.templateRef
|
|
1892
|
+
template: this.templateRef,
|
|
1818
1893
|
});
|
|
1819
1894
|
}
|
|
1820
|
-
}
|
|
1821
|
-
SkyListSecondaryActionComponent
|
|
1822
|
-
|
|
1823
|
-
|
|
1824
|
-
|
|
1825
|
-
|
|
1826
|
-
|
|
1827
|
-
|
|
1828
|
-
|
|
1829
|
-
],
|
|
1830
|
-
|
|
1831
|
-
|
|
1832
|
-
|
|
1833
|
-
|
|
1834
|
-
|
|
1835
|
-
]
|
|
1836
|
-
|
|
1837
|
-
|
|
1838
|
-
|
|
1839
|
-
|
|
1840
|
-
|
|
1841
|
-
|
|
1842
|
-
|
|
1843
|
-
|
|
1844
|
-
|
|
1845
|
-
|
|
1846
|
-
|
|
1847
|
-
|
|
1848
|
-
this.ngUnsubscribe = new Subject();
|
|
1849
|
-
}
|
|
1850
|
-
ngOnInit() {
|
|
1851
|
-
this.actionService.actionsStream
|
|
1852
|
-
.pipe(takeUntil(this.ngUnsubscribe), distinctUntilChanged())
|
|
1853
|
-
.subscribe((actions) => {
|
|
1854
|
-
const hasSecondaryActions = (actions.length > 0);
|
|
1855
|
-
this.dropdownHidden = !hasSecondaryActions;
|
|
1856
|
-
this.actions = actions;
|
|
1857
|
-
this.changeDetector.detectChanges();
|
|
1858
|
-
});
|
|
1859
|
-
}
|
|
1860
|
-
ngOnDestroy() {
|
|
1861
|
-
this.ngUnsubscribe.next();
|
|
1862
|
-
this.ngUnsubscribe.complete();
|
|
1863
|
-
}
|
|
1864
|
-
};
|
|
1865
|
-
SkyListSecondaryActionsHostComponent.ctorParameters = () => [
|
|
1866
|
-
{ type: ChangeDetectorRef },
|
|
1867
|
-
{ type: SkyListSecondaryActionsService }
|
|
1868
|
-
];
|
|
1869
|
-
SkyListSecondaryActionsHostComponent = __decorate([
|
|
1870
|
-
Component({
|
|
1871
|
-
selector: 'sky-list-secondary-actions-host',
|
|
1872
|
-
template: "<div\n class=\"sky-list-secondary-actions\"\n [ngClass]=\"{ 'sky-list-secondary-actions-hidden': dropdownHidden }\"\n>\n <sky-dropdown\n [attr.title]=\"'skyux_list_show_secondary_actions_button' | skyLibResources\"\n [label]=\"'skyux_list_show_secondary_actions_button' | skyLibResources\"\n >\n <sky-dropdown-button>\n <sky-icon\n icon=\"ellipsis-h\"\n >\n </sky-icon>\n <span\n class=\"sky-list-secondary-actions-btn-text\"\n >\n {{ 'skyux_list_show_secondary_actions_button' | skyLibResources }}\n </span>\n </sky-dropdown-button>\n <sky-dropdown-menu>\n <sky-dropdown-item *ngFor=\"let action of actions\">\n <ng-container *ngTemplateOutlet=\"action.template\">\n </ng-container>\n </sky-dropdown-item>\n </sky-dropdown-menu>\n </sky-dropdown>\n</div>\n<ng-content>\n</ng-content>\n",
|
|
1873
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
1874
|
-
styles: [".sky-list-secondary-actions ::ng-deep .sky-dropdown-button-type-select{padding:6px 12px}.sky-list-secondary-actions ::ng-deep .sky-dropdown-button-type-select sky-icon[icon=ellipsis-h]{font-size:1.33333em;line-height:.75em;vertical-align:-15%}.sky-list-secondary-actions-hidden{display:none}:host .sky-list-secondary-actions-btn-text{display:none}:host .sky-list-secondary-actions ::ng-deep .sky-dropdown-caret{display:none}:host-context(.sky-responsive-container-lg) .sky-list-secondary-actions-btn-text,:host-context(.sky-responsive-container-md) .sky-list-secondary-actions-btn-text,:host-context(.sky-responsive-container-sm) .sky-list-secondary-actions-btn-text,:host-context(.sky-responsive-container-xs) .sky-list-secondary-actions-btn-text{display:none}:host-context(.sky-responsive-container-lg) .sky-list-secondary-actions ::ng-deep .sky-dropdown-caret,:host-context(.sky-responsive-container-md) .sky-list-secondary-actions ::ng-deep .sky-dropdown-caret,:host-context(.sky-responsive-container-sm) .sky-list-secondary-actions ::ng-deep .sky-dropdown-caret,:host-context(.sky-responsive-container-xs) .sky-list-secondary-actions ::ng-deep .sky-dropdown-caret{display:none}@media (min-width:768px){:host .sky-list-secondary-actions-btn-text{display:inline}:host .sky-list-secondary-actions ::ng-deep .sky-dropdown-caret{display:inline-block}}:host-context(.sky-responsive-container-lg) .sky-list-secondary-actions-btn-text,:host-context(.sky-responsive-container-md) .sky-list-secondary-actions-btn-text,:host-context(.sky-responsive-container-sm) .sky-list-secondary-actions-btn-text{display:inline}:host-context(.sky-responsive-container-lg) .sky-list-secondary-actions ::ng-deep .sky-dropdown-caret,:host-context(.sky-responsive-container-md) .sky-list-secondary-actions ::ng-deep .sky-dropdown-caret,:host-context(.sky-responsive-container-sm) .sky-list-secondary-actions ::ng-deep .sky-dropdown-caret{display:inline-block}"]
|
|
1875
|
-
})
|
|
1876
|
-
], SkyListSecondaryActionsHostComponent);
|
|
1877
|
-
|
|
1878
|
-
let SkyListSecondaryActionsModule = class SkyListSecondaryActionsModule {
|
|
1879
|
-
};
|
|
1880
|
-
SkyListSecondaryActionsModule = __decorate([
|
|
1881
|
-
NgModule({
|
|
1882
|
-
declarations: [
|
|
1883
|
-
SkyListSecondaryActionsComponent,
|
|
1884
|
-
SkyListSecondaryActionsHostComponent,
|
|
1885
|
-
SkyListSecondaryActionComponent
|
|
1886
|
-
],
|
|
1887
|
-
imports: [
|
|
1895
|
+
}
|
|
1896
|
+
SkyListSecondaryActionComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: SkyListSecondaryActionComponent, deps: [{ token: SkyListSecondaryActionsService }], target: i0.ɵɵFactoryTarget.Component });
|
|
1897
|
+
SkyListSecondaryActionComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.13", type: SkyListSecondaryActionComponent, selector: "sky-list-secondary-action", viewQueries: [{ propertyName: "templateRef", first: true, predicate: ["listSecondaryAction"], descendants: true, read: TemplateRef, static: true }], ngImport: i0, template: "<ng-template #listSecondaryAction>\n <ng-content></ng-content>\n</ng-template>\n" });
|
|
1898
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: SkyListSecondaryActionComponent, decorators: [{
|
|
1899
|
+
type: Component,
|
|
1900
|
+
args: [{
|
|
1901
|
+
selector: 'sky-list-secondary-action',
|
|
1902
|
+
templateUrl: './list-secondary-action.component.html',
|
|
1903
|
+
}]
|
|
1904
|
+
}], ctorParameters: function () { return [{ type: SkyListSecondaryActionsService }]; }, propDecorators: { templateRef: [{
|
|
1905
|
+
type: ViewChild,
|
|
1906
|
+
args: ['listSecondaryAction', {
|
|
1907
|
+
read: TemplateRef,
|
|
1908
|
+
static: true,
|
|
1909
|
+
}]
|
|
1910
|
+
}] } });
|
|
1911
|
+
|
|
1912
|
+
class SkyListSecondaryActionsModule {
|
|
1913
|
+
}
|
|
1914
|
+
SkyListSecondaryActionsModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: SkyListSecondaryActionsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
1915
|
+
SkyListSecondaryActionsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: SkyListSecondaryActionsModule, declarations: [SkyListSecondaryActionsComponent,
|
|
1916
|
+
SkyListSecondaryActionsHostComponent,
|
|
1917
|
+
SkyListSecondaryActionComponent], imports: [CommonModule,
|
|
1918
|
+
SkyDropdownModule,
|
|
1919
|
+
SkyI18nModule,
|
|
1920
|
+
SkyIconModule,
|
|
1921
|
+
SkyListBuilderResourcesModule], exports: [SkyListSecondaryActionsComponent, SkyListSecondaryActionComponent] });
|
|
1922
|
+
SkyListSecondaryActionsModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: SkyListSecondaryActionsModule, imports: [[
|
|
1888
1923
|
CommonModule,
|
|
1889
1924
|
SkyDropdownModule,
|
|
1890
1925
|
SkyI18nModule,
|
|
1891
1926
|
SkyIconModule,
|
|
1892
|
-
SkyListBuilderResourcesModule
|
|
1893
|
-
]
|
|
1894
|
-
|
|
1895
|
-
|
|
1896
|
-
|
|
1897
|
-
|
|
1898
|
-
|
|
1899
|
-
|
|
1900
|
-
|
|
1927
|
+
SkyListBuilderResourcesModule,
|
|
1928
|
+
]] });
|
|
1929
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: SkyListSecondaryActionsModule, decorators: [{
|
|
1930
|
+
type: NgModule,
|
|
1931
|
+
args: [{
|
|
1932
|
+
declarations: [
|
|
1933
|
+
SkyListSecondaryActionsComponent,
|
|
1934
|
+
SkyListSecondaryActionsHostComponent,
|
|
1935
|
+
SkyListSecondaryActionComponent,
|
|
1936
|
+
],
|
|
1937
|
+
imports: [
|
|
1938
|
+
CommonModule,
|
|
1939
|
+
SkyDropdownModule,
|
|
1940
|
+
SkyI18nModule,
|
|
1941
|
+
SkyIconModule,
|
|
1942
|
+
SkyListBuilderResourcesModule,
|
|
1943
|
+
],
|
|
1944
|
+
exports: [SkyListSecondaryActionsComponent, SkyListSecondaryActionComponent],
|
|
1945
|
+
}]
|
|
1946
|
+
}] });
|
|
1901
1947
|
|
|
1902
|
-
let idIndex
|
|
1948
|
+
let idIndex = 0;
|
|
1903
1949
|
/**
|
|
1904
1950
|
* Defines a toolbar item for the list toolbar.
|
|
1905
1951
|
*/
|
|
1906
|
-
|
|
1952
|
+
class SkyListToolbarItemComponent {
|
|
1907
1953
|
constructor() {
|
|
1908
1954
|
/**
|
|
1909
1955
|
* Specifies the ID of the item.
|
|
1910
1956
|
*/
|
|
1911
|
-
this.id = `sky-list-toolbar-item-${++idIndex
|
|
1957
|
+
this.id = `sky-list-toolbar-item-${++idIndex}`;
|
|
1912
1958
|
/**
|
|
1913
1959
|
* Specifies the index of the item at the given item location.
|
|
1914
1960
|
* @default -1
|
|
@@ -1924,49 +1970,48 @@ let SkyListToolbarItemComponent = class SkyListToolbarItemComponent {
|
|
|
1924
1970
|
get template() {
|
|
1925
1971
|
return this.templates.length > 0 ? this.templates.first : undefined;
|
|
1926
1972
|
}
|
|
1927
|
-
}
|
|
1928
|
-
|
|
1929
|
-
|
|
1930
|
-
|
|
1931
|
-
|
|
1932
|
-
|
|
1933
|
-
|
|
1934
|
-
|
|
1935
|
-
|
|
1936
|
-
],
|
|
1937
|
-
|
|
1938
|
-
|
|
1939
|
-
|
|
1940
|
-
|
|
1941
|
-
|
|
1942
|
-
|
|
1943
|
-
|
|
1944
|
-
|
|
1945
|
-
]
|
|
1973
|
+
}
|
|
1974
|
+
SkyListToolbarItemComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: SkyListToolbarItemComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1975
|
+
SkyListToolbarItemComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.13", type: SkyListToolbarItemComponent, selector: "sky-list-toolbar-item", inputs: { id: "id", index: "index", location: "location" }, queries: [{ propertyName: "templates", predicate: TemplateRef }], ngImport: i0, template: '<ng-content></ng-content>', isInline: true });
|
|
1976
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: SkyListToolbarItemComponent, decorators: [{
|
|
1977
|
+
type: Component,
|
|
1978
|
+
args: [{
|
|
1979
|
+
selector: 'sky-list-toolbar-item',
|
|
1980
|
+
template: '<ng-content></ng-content>',
|
|
1981
|
+
}]
|
|
1982
|
+
}], propDecorators: { id: [{
|
|
1983
|
+
type: Input
|
|
1984
|
+
}], index: [{
|
|
1985
|
+
type: Input
|
|
1986
|
+
}], location: [{
|
|
1987
|
+
type: Input
|
|
1988
|
+
}], templates: [{
|
|
1989
|
+
type: ContentChildren,
|
|
1990
|
+
args: [TemplateRef]
|
|
1991
|
+
}] } });
|
|
1946
1992
|
|
|
1947
1993
|
/**
|
|
1948
1994
|
* Adds a sort dropdown to the list toolbar.
|
|
1949
1995
|
*/
|
|
1950
|
-
|
|
1951
|
-
}
|
|
1952
|
-
|
|
1953
|
-
|
|
1954
|
-
|
|
1955
|
-
|
|
1956
|
-
|
|
1957
|
-
|
|
1958
|
-
|
|
1959
|
-
|
|
1960
|
-
],
|
|
1961
|
-
|
|
1962
|
-
|
|
1963
|
-
|
|
1964
|
-
|
|
1965
|
-
|
|
1966
|
-
|
|
1967
|
-
|
|
1968
|
-
|
|
1969
|
-
], SkyListToolbarSortComponent);
|
|
1996
|
+
class SkyListToolbarSortComponent {
|
|
1997
|
+
}
|
|
1998
|
+
SkyListToolbarSortComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: SkyListToolbarSortComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1999
|
+
SkyListToolbarSortComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.13", type: SkyListToolbarSortComponent, selector: "sky-list-toolbar-sort", inputs: { label: "label", field: "field", type: "type", descending: "descending" }, ngImport: i0, template: '', isInline: true });
|
|
2000
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: SkyListToolbarSortComponent, decorators: [{
|
|
2001
|
+
type: Component,
|
|
2002
|
+
args: [{
|
|
2003
|
+
selector: 'sky-list-toolbar-sort',
|
|
2004
|
+
template: '',
|
|
2005
|
+
}]
|
|
2006
|
+
}], propDecorators: { label: [{
|
|
2007
|
+
type: Input
|
|
2008
|
+
}], field: [{
|
|
2009
|
+
type: Input
|
|
2010
|
+
}], type: [{
|
|
2011
|
+
type: Input
|
|
2012
|
+
}], descending: [{
|
|
2013
|
+
type: Input
|
|
2014
|
+
}] } });
|
|
1970
2015
|
|
|
1971
2016
|
/**
|
|
1972
2017
|
* Adds a section on the right side of the toolbar for items that substantially change
|
|
@@ -1974,15 +2019,18 @@ SkyListToolbarSortComponent = __decorate([
|
|
|
1974
2019
|
* If the view section includes more than one item, simple filters appear on the left
|
|
1975
2020
|
* and view switchers appear on the right.
|
|
1976
2021
|
*/
|
|
1977
|
-
|
|
1978
|
-
}
|
|
1979
|
-
SkyListToolbarViewActionsComponent =
|
|
1980
|
-
|
|
1981
|
-
|
|
1982
|
-
|
|
1983
|
-
|
|
1984
|
-
|
|
1985
|
-
|
|
2022
|
+
class SkyListToolbarViewActionsComponent {
|
|
2023
|
+
}
|
|
2024
|
+
SkyListToolbarViewActionsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: SkyListToolbarViewActionsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2025
|
+
SkyListToolbarViewActionsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.13", type: SkyListToolbarViewActionsComponent, selector: "sky-list-toolbar-view-actions", ngImport: i0, template: "<ng-content></ng-content>\n", styles: [":host{display:flex;align-items:center}:host::ng-deep>:not(:last-child){margin-right:5px}.sky-list-toolbar-view-actions ::ng-deep>:not(:last-child){margin-right:5px}\n"] });
|
|
2026
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: SkyListToolbarViewActionsComponent, decorators: [{
|
|
2027
|
+
type: Component,
|
|
2028
|
+
args: [{
|
|
2029
|
+
selector: 'sky-list-toolbar-view-actions',
|
|
2030
|
+
templateUrl: './list-toolbar-view-actions.component.html',
|
|
2031
|
+
styleUrls: ['./list-toolbar-view-actions.component.scss'],
|
|
2032
|
+
}]
|
|
2033
|
+
}] });
|
|
1986
2034
|
|
|
1987
2035
|
/**
|
|
1988
2036
|
* @internal
|
|
@@ -2003,6 +2051,22 @@ class ListToolbarConfigSetSortSelectorEnabledAction {
|
|
|
2003
2051
|
}
|
|
2004
2052
|
}
|
|
2005
2053
|
|
|
2054
|
+
/**
|
|
2055
|
+
* @internal
|
|
2056
|
+
*/
|
|
2057
|
+
class ListToolbarStateDispatcher extends StateDispatcher {
|
|
2058
|
+
}
|
|
2059
|
+
ListToolbarStateDispatcher.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: ListToolbarStateDispatcher, deps: null, target: i0.ɵɵFactoryTarget.Injectable });
|
|
2060
|
+
ListToolbarStateDispatcher.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: ListToolbarStateDispatcher });
|
|
2061
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: ListToolbarStateDispatcher, decorators: [{
|
|
2062
|
+
type: Injectable
|
|
2063
|
+
}] });
|
|
2064
|
+
/**
|
|
2065
|
+
* @internal
|
|
2066
|
+
*/
|
|
2067
|
+
class ListToolbarStateOrchestrator extends StateOrchestrator {
|
|
2068
|
+
}
|
|
2069
|
+
|
|
2006
2070
|
/**
|
|
2007
2071
|
* @internal
|
|
2008
2072
|
*/
|
|
@@ -2020,69 +2084,215 @@ class ListToolbarConfigModel {
|
|
|
2020
2084
|
/**
|
|
2021
2085
|
* @internal
|
|
2022
2086
|
*/
|
|
2023
|
-
class
|
|
2087
|
+
class ListToolbarConfigOrchestrator extends ListToolbarStateOrchestrator {
|
|
2088
|
+
/* istanbul ignore next */
|
|
2024
2089
|
constructor() {
|
|
2025
|
-
|
|
2090
|
+
super();
|
|
2091
|
+
this.register(ListToolbarConfigSetSearchEnabledAction, this.setSearchEnabled).register(ListToolbarConfigSetSortSelectorEnabledAction, this.setSortSelectorEnabled);
|
|
2092
|
+
}
|
|
2093
|
+
setSearchEnabled(state, action) {
|
|
2094
|
+
return new ListToolbarConfigModel(Object.assign({}, state, { searchEnabled: action.enabled }));
|
|
2095
|
+
}
|
|
2096
|
+
setSortSelectorEnabled(state, action) {
|
|
2097
|
+
return new ListToolbarConfigModel(Object.assign({}, state, { sortSelectorEnabled: action.enabled }));
|
|
2026
2098
|
}
|
|
2027
2099
|
}
|
|
2028
2100
|
|
|
2029
2101
|
/**
|
|
2030
2102
|
* @internal
|
|
2031
2103
|
*/
|
|
2032
|
-
|
|
2033
|
-
|
|
2034
|
-
|
|
2035
|
-
|
|
2036
|
-
|
|
2104
|
+
class ListToolbarStateModel {
|
|
2105
|
+
constructor() {
|
|
2106
|
+
this.config = new ListToolbarConfigModel();
|
|
2107
|
+
}
|
|
2108
|
+
}
|
|
2109
|
+
|
|
2037
2110
|
/**
|
|
2038
2111
|
* @internal
|
|
2039
2112
|
*/
|
|
2040
|
-
class
|
|
2113
|
+
class ListToolbarState extends StateNode {
|
|
2114
|
+
constructor(initialState, dispatcher) {
|
|
2115
|
+
super(initialState, dispatcher);
|
|
2116
|
+
this.register('config', ListToolbarConfigOrchestrator).begin();
|
|
2117
|
+
}
|
|
2041
2118
|
}
|
|
2119
|
+
ListToolbarState.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: ListToolbarState, deps: [{ token: ListToolbarStateModel }, { token: ListToolbarStateDispatcher }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
2120
|
+
ListToolbarState.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: ListToolbarState });
|
|
2121
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: ListToolbarState, decorators: [{
|
|
2122
|
+
type: Injectable
|
|
2123
|
+
}], ctorParameters: function () { return [{ type: ListToolbarStateModel }, { type: ListToolbarStateDispatcher }]; } });
|
|
2042
2124
|
|
|
2043
2125
|
/**
|
|
2044
2126
|
* @internal
|
|
2045
2127
|
*/
|
|
2046
|
-
class
|
|
2047
|
-
|
|
2048
|
-
|
|
2049
|
-
|
|
2050
|
-
|
|
2051
|
-
.register(ListToolbarConfigSetSearchEnabledAction, this.setSearchEnabled)
|
|
2052
|
-
.register(ListToolbarConfigSetSortSelectorEnabledAction, this.setSortSelectorEnabled);
|
|
2053
|
-
}
|
|
2054
|
-
setSearchEnabled(state, action) {
|
|
2055
|
-
return new ListToolbarConfigModel(Object.assign({}, state, { searchEnabled: action.enabled }));
|
|
2056
|
-
}
|
|
2057
|
-
setSortSelectorEnabled(state, action) {
|
|
2058
|
-
return new ListToolbarConfigModel(Object.assign({}, state, { sortSelectorEnabled: action.enabled }));
|
|
2128
|
+
class SkyListToolbarItemRendererComponent {
|
|
2129
|
+
ngOnInit() {
|
|
2130
|
+
if (this.template !== undefined) {
|
|
2131
|
+
this.container.createEmbeddedView(this.template, this);
|
|
2132
|
+
}
|
|
2059
2133
|
}
|
|
2060
2134
|
}
|
|
2135
|
+
SkyListToolbarItemRendererComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: SkyListToolbarItemRendererComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2136
|
+
SkyListToolbarItemRendererComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.13", type: SkyListToolbarItemRendererComponent, selector: "sky-list-toolbar-item-renderer", inputs: { template: "template" }, viewQueries: [{ propertyName: "container", first: true, predicate: ["container"], descendants: true, read: ViewContainerRef, static: true }], ngImport: i0, template: '<ng-template #container></ng-template>', isInline: true });
|
|
2137
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: SkyListToolbarItemRendererComponent, decorators: [{
|
|
2138
|
+
type: Component,
|
|
2139
|
+
args: [{
|
|
2140
|
+
selector: 'sky-list-toolbar-item-renderer',
|
|
2141
|
+
template: '<ng-template #container></ng-template>',
|
|
2142
|
+
}]
|
|
2143
|
+
}], propDecorators: { template: [{
|
|
2144
|
+
type: Input
|
|
2145
|
+
}], container: [{
|
|
2146
|
+
type: ViewChild,
|
|
2147
|
+
args: ['container', {
|
|
2148
|
+
read: ViewContainerRef,
|
|
2149
|
+
static: true,
|
|
2150
|
+
}]
|
|
2151
|
+
}] } });
|
|
2061
2152
|
|
|
2153
|
+
let uniqueId = 0;
|
|
2062
2154
|
/**
|
|
2063
2155
|
* @internal
|
|
2064
2156
|
*/
|
|
2065
|
-
|
|
2066
|
-
constructor(
|
|
2067
|
-
|
|
2068
|
-
this
|
|
2069
|
-
|
|
2070
|
-
|
|
2157
|
+
class SkyListMultiselectToolbarComponent {
|
|
2158
|
+
constructor(state, dispatcher) {
|
|
2159
|
+
this.state = state;
|
|
2160
|
+
this.dispatcher = dispatcher;
|
|
2161
|
+
this.showOnlySelected = false;
|
|
2162
|
+
this.multiselectToolbarId = `sky-list-multiselect-toolbar-${uniqueId++}`;
|
|
2163
|
+
this.selectedIdMap = new Map();
|
|
2164
|
+
this.ngUnsubscribe = new Subject();
|
|
2071
2165
|
}
|
|
2072
|
-
|
|
2073
|
-
|
|
2074
|
-
|
|
2075
|
-
|
|
2076
|
-
|
|
2077
|
-
|
|
2078
|
-
|
|
2079
|
-
|
|
2166
|
+
ngOnInit() {
|
|
2167
|
+
this.state
|
|
2168
|
+
.pipe(map((t) => t.selected.item), takeUntil(this.ngUnsubscribe), distinctUntilChanged(this.selectedMapEqual))
|
|
2169
|
+
.subscribe((model) => {
|
|
2170
|
+
this.selectedIdMap = model.selectedIdMap;
|
|
2171
|
+
if (this.showOnlySelected) {
|
|
2172
|
+
this.reapplyFilter(true);
|
|
2173
|
+
}
|
|
2174
|
+
});
|
|
2175
|
+
// If 'show-selected' filter is programatically set from a child component (e.g. checkilst),
|
|
2176
|
+
// make sure the checked state of the 'show-selected' checkbox stays in sync.
|
|
2177
|
+
this.state
|
|
2178
|
+
.pipe(map((t) => t.filters), takeUntil(this.ngUnsubscribe), distinctUntilChanged(this.showSelectedValuesEqual))
|
|
2179
|
+
.subscribe((filters) => {
|
|
2180
|
+
const showSelectedFilter = filters.find((filter) => filter.name === 'show-selected');
|
|
2181
|
+
if (showSelectedFilter) {
|
|
2182
|
+
this.showOnlySelected = showSelectedFilter.value === 'true';
|
|
2183
|
+
}
|
|
2184
|
+
});
|
|
2185
|
+
}
|
|
2186
|
+
ngOnDestroy() {
|
|
2187
|
+
this.ngUnsubscribe.next();
|
|
2188
|
+
this.ngUnsubscribe.complete();
|
|
2189
|
+
}
|
|
2190
|
+
selectAll() {
|
|
2191
|
+
this.state
|
|
2192
|
+
.pipe(map((state) => state.items.items), take(1))
|
|
2193
|
+
.subscribe((items) => {
|
|
2194
|
+
this.dispatcher.setSelected(items.map((item) => item.id), true);
|
|
2195
|
+
if (this.showOnlySelected) {
|
|
2196
|
+
this.reapplyFilter(this.showOnlySelected);
|
|
2197
|
+
}
|
|
2198
|
+
});
|
|
2199
|
+
}
|
|
2200
|
+
clearSelections() {
|
|
2201
|
+
this.state
|
|
2202
|
+
.pipe(map((state) => state.items.items), take(1))
|
|
2203
|
+
.subscribe((items) => {
|
|
2204
|
+
this.dispatcher.setSelected(items.map((item) => item.id), false);
|
|
2205
|
+
if (this.showOnlySelected) {
|
|
2206
|
+
this.reapplyFilter(this.showOnlySelected);
|
|
2207
|
+
}
|
|
2208
|
+
});
|
|
2209
|
+
}
|
|
2210
|
+
changeVisibleItems(change) {
|
|
2211
|
+
this.showOnlySelected = change.checked;
|
|
2212
|
+
this.reapplyFilter(change.checked);
|
|
2213
|
+
}
|
|
2214
|
+
reapplyFilter(isSelected) {
|
|
2215
|
+
let self = this;
|
|
2216
|
+
this.state
|
|
2217
|
+
.pipe(map((state) => state.filters), take(1))
|
|
2218
|
+
.subscribe((filters) => {
|
|
2219
|
+
filters = filters.filter((filter) => filter.name !== 'show-selected');
|
|
2220
|
+
filters.push(self.getShowSelectedFilter(isSelected));
|
|
2221
|
+
this.dispatcher.filtersUpdate(filters);
|
|
2222
|
+
});
|
|
2223
|
+
// If "show selected" is checked and paging is enabled, go to page one.
|
|
2224
|
+
/* istanbul ignore else */
|
|
2225
|
+
if (isSelected) {
|
|
2226
|
+
this.state.pipe(take(1)).subscribe((currentState) => {
|
|
2227
|
+
if (currentState.paging.pageNumber &&
|
|
2228
|
+
currentState.paging.pageNumber !== 1) {
|
|
2229
|
+
this.dispatcher.next(new ListPagingSetPageNumberAction(Number(1)));
|
|
2230
|
+
}
|
|
2231
|
+
});
|
|
2232
|
+
}
|
|
2233
|
+
this.dispatcher.toolbarSetDisabled(isSelected);
|
|
2234
|
+
}
|
|
2235
|
+
getShowSelectedFilter(isSelected) {
|
|
2236
|
+
return new ListFilterModel({
|
|
2237
|
+
name: 'show-selected',
|
|
2238
|
+
value: isSelected.toString(),
|
|
2239
|
+
filterFunction: (model, showOnlySelected) => {
|
|
2240
|
+
/* istanbul ignore else */
|
|
2241
|
+
if (showOnlySelected.toString() !== false.toString()) {
|
|
2242
|
+
return this.selectedIdMap.get(model.id);
|
|
2243
|
+
}
|
|
2244
|
+
},
|
|
2245
|
+
defaultValue: false.toString(),
|
|
2246
|
+
});
|
|
2247
|
+
}
|
|
2248
|
+
showSelectedValuesEqual(prev, next) {
|
|
2249
|
+
const prevShowSelectedFilter = prev.find((filter) => filter.name === 'show-selected');
|
|
2250
|
+
const nextShowSelectedFilter = next.find((filter) => filter.name === 'show-selected');
|
|
2251
|
+
// Both undefined.
|
|
2252
|
+
if (!prevShowSelectedFilter && !nextShowSelectedFilter) {
|
|
2253
|
+
return true;
|
|
2254
|
+
}
|
|
2255
|
+
// Only one undefined.
|
|
2256
|
+
if ((prevShowSelectedFilter && !nextShowSelectedFilter) ||
|
|
2257
|
+
(!prevShowSelectedFilter && nextShowSelectedFilter)) {
|
|
2258
|
+
return false;
|
|
2259
|
+
}
|
|
2260
|
+
// Defined, but with different "value".
|
|
2261
|
+
return prevShowSelectedFilter.value === nextShowSelectedFilter.value;
|
|
2262
|
+
}
|
|
2263
|
+
selectedMapEqual(prev, next) {
|
|
2264
|
+
if (prev.selectedIdMap.size !== next.selectedIdMap.size) {
|
|
2265
|
+
return false;
|
|
2266
|
+
}
|
|
2267
|
+
for (let i = 0; i < next.selectedIdMap.size; i++) {
|
|
2268
|
+
const key = Array.from(next.selectedIdMap.keys())[i];
|
|
2269
|
+
const value = next.selectedIdMap.get(key);
|
|
2270
|
+
/* istanbul ignore next */
|
|
2271
|
+
if (value !== prev.selectedIdMap.get(key)) {
|
|
2272
|
+
return false;
|
|
2273
|
+
}
|
|
2274
|
+
}
|
|
2275
|
+
return true;
|
|
2276
|
+
}
|
|
2277
|
+
}
|
|
2278
|
+
SkyListMultiselectToolbarComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: SkyListMultiselectToolbarComponent, deps: [{ token: ListState }, { token: ListStateDispatcher }], target: i0.ɵɵFactoryTarget.Component });
|
|
2279
|
+
SkyListMultiselectToolbarComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.13", type: SkyListMultiselectToolbarComponent, selector: "sky-list-multiselect-toolbar", inputs: { showOnlySelected: "showOnlySelected" }, ngImport: i0, template: "<sky-toolbar class=\"sky-list-multiselect-toolbar\">\n <sky-toolbar-section>\n <sky-toolbar-item>\n <sky-list-toolbar-item-renderer [template]=\"selectAllTemplate\">\n </sky-list-toolbar-item-renderer>\n </sky-toolbar-item>\n <sky-toolbar-item>\n <sky-list-toolbar-item-renderer [template]=\"clearSelectionsTemplate\">\n </sky-list-toolbar-item-renderer>\n </sky-toolbar-item>\n <sky-toolbar-view-actions>\n <ng-container *ngTemplateOutlet=\"showSelectedTemplate\"></ng-container>\n </sky-toolbar-view-actions>\n </sky-toolbar-section>\n</sky-toolbar>\n\n<ng-template #selectAllTemplate>\n <button\n class=\"sky-btn sky-btn-link\"\n type=\"button\"\n [attr.id]=\"multiselectToolbarId + '-select-all'\"\n (click)=\"selectAll(); $event.preventDefault()\"\n >\n {{ 'skyux_list_mutliselect_select_all' | skyLibResources }}\n </button>\n</ng-template>\n\n<ng-template #clearSelectionsTemplate>\n <button\n class=\"sky-btn sky-btn-link\"\n type=\"button\"\n [attr.id]=\"multiselectToolbarId + '-clear-all'\"\n (click)=\"clearSelections(); $event.preventDefault()\"\n >\n {{ 'skyux_list_multiselect_clear_all' | skyLibResources }}\n </button>\n</ng-template>\n\n<ng-template #showSelectedTemplate>\n <sky-checkbox\n [attr.id]=\"multiselectToolbarId + '-show-selected'\"\n [checked]=\"showOnlySelected\"\n (change)=\"changeVisibleItems($event)\"\n >\n <sky-checkbox-label>\n {{ 'skyux_list_mutliselect_show_selected' | skyLibResources }}\n </sky-checkbox-label>\n </sky-checkbox>\n</ng-template>\n", styles: [":host-context(sky-toolbar +) .sky-list-multiselect-toolbar ::ng-deep .sky-toolbar-container,:host-context(.sky-list-toolbar-search +) .sky-list-multiselect-toolbar ::ng-deep .sky-toolbar-container{border-top:none}\n"], components: [{ type: i3$2.λ37, selector: "sky-toolbar" }, { type: i3$2.λ38, selector: "sky-toolbar-section" }, { type: i3$2.λ39, selector: "sky-toolbar-item" }, { type: SkyListToolbarItemRendererComponent, selector: "sky-list-toolbar-item-renderer", inputs: ["template"] }, { type: i3$2.λ40, selector: "sky-toolbar-view-actions" }, { type: i5$1.λ3, selector: "sky-checkbox", inputs: ["label", "labelledBy", "id", "disabled", "tabindex", "name", "icon", "checkboxType", "checked", "required"], outputs: ["change", "checkedChange", "disabledChange"] }, { type: i5$1.λ4, selector: "sky-checkbox-label" }], directives: [{ type: i4.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }], pipes: { "skyLibResources": i5.SkyLibResourcesPipe } });
|
|
2280
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: SkyListMultiselectToolbarComponent, decorators: [{
|
|
2281
|
+
type: Component,
|
|
2282
|
+
args: [{
|
|
2283
|
+
selector: 'sky-list-multiselect-toolbar',
|
|
2284
|
+
templateUrl: './list-multiselect-toolbar.component.html',
|
|
2285
|
+
styleUrls: ['./list-multiselect-toolbar.component.scss'],
|
|
2286
|
+
}]
|
|
2287
|
+
}], ctorParameters: function () { return [{ type: ListState }, { type: ListStateDispatcher }]; }, propDecorators: { showOnlySelected: [{
|
|
2288
|
+
type: Input
|
|
2289
|
+
}] } });
|
|
2080
2290
|
|
|
2081
2291
|
let nextId = 0;
|
|
2082
2292
|
/**
|
|
2083
2293
|
* Displays a toolbar for a SKY UX-themed list of data.
|
|
2084
2294
|
*/
|
|
2085
|
-
|
|
2295
|
+
class SkyListToolbarComponent {
|
|
2086
2296
|
constructor(changeDetector, state, dispatcher, toolbarState, toolbarDispatcher) {
|
|
2087
2297
|
this.changeDetector = changeDetector;
|
|
2088
2298
|
this.state = state;
|
|
@@ -2130,7 +2340,9 @@ let SkyListToolbarComponent = class SkyListToolbarComponent {
|
|
|
2130
2340
|
return this._inMemorySearchEnabled;
|
|
2131
2341
|
}
|
|
2132
2342
|
get isFilterBarDisplayed() {
|
|
2133
|
-
return !this.isToolbarDisabled &&
|
|
2343
|
+
return (!this.isToolbarDisabled &&
|
|
2344
|
+
this.hasInlineFilters &&
|
|
2345
|
+
this.inlineFilterBarExpanded);
|
|
2134
2346
|
}
|
|
2135
2347
|
get filterButtonAriaControls() {
|
|
2136
2348
|
return this.isFilterBarDisplayed ? this.listFilterInlineId : undefined;
|
|
@@ -2161,23 +2373,20 @@ let SkyListToolbarComponent = class SkyListToolbarComponent {
|
|
|
2161
2373
|
id: 'sort-selector',
|
|
2162
2374
|
template: this.sortSelectorTemplate,
|
|
2163
2375
|
location: 'left',
|
|
2164
|
-
index: this.sortSelectorItemToolbarIndex
|
|
2165
|
-
})
|
|
2376
|
+
index: this.sortSelectorItemToolbarIndex,
|
|
2377
|
+
}),
|
|
2166
2378
|
]);
|
|
2167
2379
|
}
|
|
2168
2380
|
else if (currentSort.length < 1 && this.hasSortSelectors) {
|
|
2169
2381
|
this.hasSortSelectors = false;
|
|
2170
|
-
this.dispatcher.toolbarRemoveItems([
|
|
2171
|
-
'sort-selector'
|
|
2172
|
-
]);
|
|
2382
|
+
this.dispatcher.toolbarRemoveItems(['sort-selector']);
|
|
2173
2383
|
}
|
|
2174
2384
|
});
|
|
2175
|
-
this.searchTextInput = this.state.pipe(takeUntil(this.ngUnsubscribe), map(s => s.search.searchText), distinctUntilChanged());
|
|
2176
|
-
this.view = this.state.pipe(takeUntil(this.ngUnsubscribe), map(s => s.views.active), distinctUntilChanged());
|
|
2385
|
+
this.searchTextInput = this.state.pipe(takeUntil(this.ngUnsubscribe), map((s) => s.search.searchText), distinctUntilChanged());
|
|
2386
|
+
this.view = this.state.pipe(takeUntil(this.ngUnsubscribe), map((s) => s.views.active), distinctUntilChanged());
|
|
2177
2387
|
this.watchTemplates();
|
|
2178
2388
|
this.type = this.state.pipe(takeUntil(this.ngUnsubscribe), map((state) => state.toolbar.type), distinctUntilChanged());
|
|
2179
|
-
this.type.pipe(takeUntil(this.ngUnsubscribe))
|
|
2180
|
-
.subscribe((toolbarType) => {
|
|
2389
|
+
this.type.pipe(takeUntil(this.ngUnsubscribe)).subscribe((toolbarType) => {
|
|
2181
2390
|
if (toolbarType === 'search') {
|
|
2182
2391
|
this.dispatcher.toolbarRemoveItems(['search']);
|
|
2183
2392
|
}
|
|
@@ -2186,80 +2395,77 @@ let SkyListToolbarComponent = class SkyListToolbarComponent {
|
|
|
2186
2395
|
new ListToolbarItemModel({
|
|
2187
2396
|
id: 'search',
|
|
2188
2397
|
template: this.searchTemplate,
|
|
2189
|
-
location: 'right'
|
|
2190
|
-
})
|
|
2398
|
+
location: 'right',
|
|
2399
|
+
}),
|
|
2191
2400
|
]);
|
|
2192
2401
|
}
|
|
2193
2402
|
});
|
|
2194
|
-
this.isSearchEnabled = this.toolbarState.pipe(takeUntil(this.ngUnsubscribe), map(s => s.config), distinctUntilChanged(), map(c => c.searchEnabled));
|
|
2195
|
-
this.state
|
|
2196
|
-
.
|
|
2197
|
-
|
|
2198
|
-
this.
|
|
2199
|
-
this.
|
|
2403
|
+
this.isSearchEnabled = this.toolbarState.pipe(takeUntil(this.ngUnsubscribe), map((s) => s.config), distinctUntilChanged(), map((c) => c.searchEnabled));
|
|
2404
|
+
this.state
|
|
2405
|
+
.pipe(map((s) => s.toolbar), takeUntil(this.ngUnsubscribe), distinctUntilChanged(), map((c) => c.disabled))
|
|
2406
|
+
.subscribe((isDisabled) => (this.isToolbarDisabled = isDisabled));
|
|
2407
|
+
this.isSortSelectorEnabled = this.toolbarState.pipe(takeUntil(this.ngUnsubscribe), map((s) => s.config), distinctUntilChanged(), map((c) => c.sortSelectorEnabled));
|
|
2408
|
+
this.isMultiselectEnabled = this.state.pipe(takeUntil(this.ngUnsubscribe), map((s) => s.toolbar), distinctUntilChanged(), map((t) => t.showMultiselectToolbar));
|
|
2409
|
+
this.hasAppliedFilters = this.state.pipe(takeUntil(this.ngUnsubscribe), map((s) => s.filters), distinctUntilChanged(), map((filters) => {
|
|
2200
2410
|
let activeFilters = filters.filter((f) => {
|
|
2201
|
-
return f.value !== '' &&
|
|
2411
|
+
return (f.value !== '' &&
|
|
2202
2412
|
f.value !== undefined &&
|
|
2203
2413
|
f.value !== false &&
|
|
2204
|
-
f.value !== f.defaultValue;
|
|
2414
|
+
f.value !== f.defaultValue);
|
|
2205
2415
|
});
|
|
2206
2416
|
return activeFilters.length > 0;
|
|
2207
2417
|
}));
|
|
2208
|
-
this.state.pipe(takeUntil(this.ngUnsubscribe))
|
|
2209
|
-
.
|
|
2210
|
-
this.hasAdditionalToolbarSection = (current.toolbar.items.length > 0);
|
|
2418
|
+
this.state.pipe(takeUntil(this.ngUnsubscribe)).subscribe((current) => {
|
|
2419
|
+
this.hasAdditionalToolbarSection = current.toolbar.items.length > 0;
|
|
2211
2420
|
this.changeDetector.detectChanges();
|
|
2212
2421
|
});
|
|
2213
2422
|
}
|
|
2214
2423
|
ngAfterContentInit() {
|
|
2215
2424
|
// Inject custom toolbar items.
|
|
2216
2425
|
this.toolbarItems.forEach((toolbarItem) => {
|
|
2217
|
-
this.dispatcher.toolbarAddItems([
|
|
2218
|
-
new ListToolbarItemModel(toolbarItem)
|
|
2219
|
-
]);
|
|
2426
|
+
this.dispatcher.toolbarAddItems([new ListToolbarItemModel(toolbarItem)]);
|
|
2220
2427
|
this.customItemIds.push(toolbarItem.id);
|
|
2221
2428
|
});
|
|
2222
|
-
this.toolbarItems.changes
|
|
2429
|
+
this.toolbarItems.changes
|
|
2430
|
+
.pipe(takeUntil(this.ngUnsubscribe))
|
|
2223
2431
|
.subscribe((newItems) => {
|
|
2224
|
-
newItems.forEach(item => {
|
|
2432
|
+
newItems.forEach((item) => {
|
|
2225
2433
|
if (this.customItemIds.indexOf(item.id) < 0) {
|
|
2226
|
-
this.dispatcher.toolbarAddItems([
|
|
2227
|
-
new ListToolbarItemModel(item)
|
|
2228
|
-
]);
|
|
2434
|
+
this.dispatcher.toolbarAddItems([new ListToolbarItemModel(item)]);
|
|
2229
2435
|
this.customItemIds.push(item.id);
|
|
2230
2436
|
}
|
|
2231
2437
|
});
|
|
2232
2438
|
const itemsToRemove = [];
|
|
2233
2439
|
this.customItemIds.forEach((itemId, index) => {
|
|
2234
|
-
if (!newItems.find(item => item.id === itemId)) {
|
|
2440
|
+
if (!newItems.find((item) => item.id === itemId)) {
|
|
2235
2441
|
itemsToRemove.push(itemId);
|
|
2236
2442
|
this.customItemIds.splice(index, 1);
|
|
2237
2443
|
}
|
|
2238
2444
|
});
|
|
2239
2445
|
this.dispatcher.toolbarRemoveItems(itemsToRemove);
|
|
2240
2446
|
});
|
|
2241
|
-
const sortModels = this.toolbarSorts.map(sort => new ListSortLabelModel({
|
|
2447
|
+
const sortModels = this.toolbarSorts.map((sort) => new ListSortLabelModel({
|
|
2242
2448
|
text: sort.label,
|
|
2243
2449
|
fieldSelector: sort.field,
|
|
2244
2450
|
fieldType: sort.type,
|
|
2245
2451
|
global: true,
|
|
2246
|
-
descending: sort.descending
|
|
2452
|
+
descending: sort.descending,
|
|
2247
2453
|
}));
|
|
2248
2454
|
this.dispatcher.sortSetGlobal(sortModels);
|
|
2249
2455
|
// Add inline filters.
|
|
2250
|
-
this.showFilterSummary =
|
|
2251
|
-
this.hasInlineFilters =
|
|
2456
|
+
this.showFilterSummary = this.filterSummary.length > 0;
|
|
2457
|
+
this.hasInlineFilters = this.inlineFilter.length > 0;
|
|
2252
2458
|
if (this.hasInlineFilters) {
|
|
2253
2459
|
this.dispatcher.toolbarAddItems([
|
|
2254
2460
|
new ListToolbarItemModel({
|
|
2255
2461
|
template: this.inlineFilterButtonTemplate,
|
|
2256
2462
|
location: 'left',
|
|
2257
|
-
index: this.inlineFiltersItemToolbarIndex
|
|
2258
|
-
})
|
|
2463
|
+
index: this.inlineFiltersItemToolbarIndex,
|
|
2464
|
+
}),
|
|
2259
2465
|
]);
|
|
2260
2466
|
}
|
|
2261
2467
|
// Check for view actions
|
|
2262
|
-
this.hasViewActions =
|
|
2468
|
+
this.hasViewActions = this.viewActions.length > 0;
|
|
2263
2469
|
}
|
|
2264
2470
|
ngOnDestroy() {
|
|
2265
2471
|
this.searchApplied.complete();
|
|
@@ -2268,10 +2474,13 @@ let SkyListToolbarComponent = class SkyListToolbarComponent {
|
|
|
2268
2474
|
}
|
|
2269
2475
|
setSort(sort) {
|
|
2270
2476
|
this.state.pipe(take(1)).subscribe((currentState) => {
|
|
2271
|
-
if (currentState.paging.pageNumber &&
|
|
2477
|
+
if (currentState.paging.pageNumber &&
|
|
2478
|
+
currentState.paging.pageNumber !== 1) {
|
|
2272
2479
|
this.dispatcher.next(new ListPagingSetPageNumberAction(Number(1)));
|
|
2273
2480
|
}
|
|
2274
|
-
this.dispatcher.sortSetFieldSelectors([
|
|
2481
|
+
this.dispatcher.sortSetFieldSelectors([
|
|
2482
|
+
{ fieldSelector: sort.fieldSelector, descending: sort.descending },
|
|
2483
|
+
]);
|
|
2275
2484
|
});
|
|
2276
2485
|
}
|
|
2277
2486
|
inlineFilterButtonClick() {
|
|
@@ -2281,7 +2490,8 @@ let SkyListToolbarComponent = class SkyListToolbarComponent {
|
|
|
2281
2490
|
this.searchApplied.next(searchText);
|
|
2282
2491
|
if (this.inMemorySearchEnabled) {
|
|
2283
2492
|
this.state.pipe(take(1)).subscribe((currentState) => {
|
|
2284
|
-
if (currentState.paging.pageNumber &&
|
|
2493
|
+
if (currentState.paging.pageNumber &&
|
|
2494
|
+
currentState.paging.pageNumber !== 1) {
|
|
2285
2495
|
this.dispatcher.next(new ListPagingSetPageNumberAction(Number(1)));
|
|
2286
2496
|
}
|
|
2287
2497
|
this.dispatcher.searchSetText(searchText);
|
|
@@ -2289,16 +2499,17 @@ let SkyListToolbarComponent = class SkyListToolbarComponent {
|
|
|
2289
2499
|
}
|
|
2290
2500
|
}
|
|
2291
2501
|
itemIsInView(itemView, activeView) {
|
|
2292
|
-
return
|
|
2502
|
+
return itemView === undefined || itemView === activeView;
|
|
2293
2503
|
}
|
|
2294
2504
|
getSortSelectors() {
|
|
2295
|
-
return combineLatest(this.state.pipe(map(s => s.sort.available), distinctUntilChanged()), this.state.pipe(map(s => s.sort.global), distinctUntilChanged()), this.state.pipe(map(s => s.sort.fieldSelectors), distinctUntilChanged()), (available, global, fieldSelectors) => {
|
|
2505
|
+
return combineLatest(this.state.pipe(map((s) => s.sort.available), distinctUntilChanged()), this.state.pipe(map((s) => s.sort.global), distinctUntilChanged()), this.state.pipe(map((s) => s.sort.fieldSelectors), distinctUntilChanged()), (available, global, fieldSelectors) => {
|
|
2296
2506
|
// Get sorts that are in the global that are not in the available
|
|
2297
|
-
let sorts = global.filter(g => available.filter(a => a.fieldSelector === g.fieldSelector)
|
|
2298
|
-
|
|
2299
|
-
|
|
2300
|
-
|
|
2301
|
-
|
|
2507
|
+
let sorts = global.filter((g) => available.filter((a) => a.fieldSelector === g.fieldSelector)
|
|
2508
|
+
.length === 0);
|
|
2509
|
+
let resultSortSelectors = [...sorts, ...available].map((sortLabels) => {
|
|
2510
|
+
let fs = fieldSelectors.filter((f) => {
|
|
2511
|
+
return (f.fieldSelector === sortLabels.fieldSelector &&
|
|
2512
|
+
f.descending === sortLabels.descending);
|
|
2302
2513
|
});
|
|
2303
2514
|
let selected = false;
|
|
2304
2515
|
if (fs.length > 0) {
|
|
@@ -2306,14 +2517,14 @@ let SkyListToolbarComponent = class SkyListToolbarComponent {
|
|
|
2306
2517
|
}
|
|
2307
2518
|
return {
|
|
2308
2519
|
sort: sortLabels,
|
|
2309
|
-
selected: selected
|
|
2520
|
+
selected: selected,
|
|
2310
2521
|
};
|
|
2311
2522
|
});
|
|
2312
2523
|
return resultSortSelectors;
|
|
2313
2524
|
}).pipe(takeUntil(this.ngUnsubscribe));
|
|
2314
2525
|
}
|
|
2315
2526
|
watchTemplates() {
|
|
2316
|
-
combineLatest(this.state.pipe(map(s => s.toolbar), distinctUntilChanged()), this.view.pipe(distinctUntilChanged()), (toolbar, view) => {
|
|
2527
|
+
combineLatest(this.state.pipe(map((s) => s.toolbar), distinctUntilChanged()), this.view.pipe(distinctUntilChanged()), (toolbar, view) => {
|
|
2317
2528
|
const items = toolbar.items.filter((i) => {
|
|
2318
2529
|
return this.itemIsInView(i.view, view);
|
|
2319
2530
|
});
|
|
@@ -2323,7 +2534,8 @@ let SkyListToolbarComponent = class SkyListToolbarComponent {
|
|
|
2323
2534
|
templates[item.location].push(item);
|
|
2324
2535
|
});
|
|
2325
2536
|
return templates;
|
|
2326
|
-
})
|
|
2537
|
+
})
|
|
2538
|
+
.pipe(takeUntil(this.ngUnsubscribe))
|
|
2327
2539
|
.subscribe((value) => {
|
|
2328
2540
|
this.leftTemplates = value.left;
|
|
2329
2541
|
this.centerTemplates = value.center;
|
|
@@ -2331,277 +2543,120 @@ let SkyListToolbarComponent = class SkyListToolbarComponent {
|
|
|
2331
2543
|
this.changeDetector.markForCheck();
|
|
2332
2544
|
});
|
|
2333
2545
|
}
|
|
2334
|
-
}
|
|
2335
|
-
SkyListToolbarComponent
|
|
2336
|
-
|
|
2337
|
-
|
|
2338
|
-
|
|
2339
|
-
|
|
2340
|
-
{ type:
|
|
2341
|
-
|
|
2342
|
-
|
|
2343
|
-
|
|
2344
|
-
|
|
2345
|
-
|
|
2346
|
-
|
|
2347
|
-
|
|
2348
|
-
|
|
2349
|
-
|
|
2350
|
-
|
|
2351
|
-
|
|
2352
|
-
|
|
2353
|
-
|
|
2354
|
-
|
|
2355
|
-
|
|
2356
|
-
],
|
|
2357
|
-
|
|
2358
|
-
|
|
2359
|
-
|
|
2360
|
-
|
|
2361
|
-
|
|
2362
|
-
|
|
2363
|
-
|
|
2364
|
-
|
|
2365
|
-
]
|
|
2366
|
-
|
|
2367
|
-
|
|
2368
|
-
],
|
|
2369
|
-
|
|
2370
|
-
|
|
2371
|
-
|
|
2372
|
-
|
|
2373
|
-
|
|
2374
|
-
]
|
|
2375
|
-
|
|
2376
|
-
|
|
2377
|
-
]
|
|
2378
|
-
|
|
2379
|
-
|
|
2380
|
-
]
|
|
2381
|
-
|
|
2382
|
-
|
|
2383
|
-
|
|
2384
|
-
|
|
2385
|
-
|
|
2386
|
-
]
|
|
2387
|
-
|
|
2388
|
-
|
|
2389
|
-
|
|
2390
|
-
|
|
2391
|
-
|
|
2392
|
-
]
|
|
2393
|
-
|
|
2394
|
-
|
|
2395
|
-
|
|
2396
|
-
|
|
2397
|
-
|
|
2398
|
-
]
|
|
2399
|
-
|
|
2400
|
-
|
|
2401
|
-
|
|
2402
|
-
|
|
2403
|
-
|
|
2404
|
-
|
|
2405
|
-
|
|
2406
|
-
ListToolbarStateModel
|
|
2407
|
-
],
|
|
2408
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
2409
|
-
styles: [".sky-list-toolbar-search-wrapper{display:flex}.sky-list-toolbar-search-wrapper ::ng-deep .sky-search-dismiss-absolute{padding:0;position:static}.sky-list-toolbar-search-wrapper ::ng-deep .sky-search-container{position:relative;height:100%}.sky-list-toolbar-search-wrapper ::ng-deep sky-search{flex:1 1 auto}.sky-list-toolbar-search-wrapper ::ng-deep sky-list-toolbar-search-actions{flex:0 0 auto;z-index:1}.sky-list-toolbar-container ::ng-deep .sky-toolbar-section-items sky-toolbar-item{flex:0 1 auto;align-self:flex-start}.sky-list-toolbar-search ::ng-deep .sky-toolbar-section{padding-top:0}.sky-list-toolbar-search ::ng-deep .sky-toolbar-section-items{display:block;width:100%}.sky-list-toolbar-search ::ng-deep .sky-toolbar-item{margin:0}.sky-list-toolbar-search ::ng-deep .sky-search-dismiss-absolute,.sky-list-toolbar-search ::ng-deep .sky-toolbar-container{background-color:#eeeeef}.sky-list-toolbar-search ::ng-deep .sky-search-btn:disabled,.sky-list-toolbar-search ::ng-deep input[type=text]:disabled{background-color:#cdcfd2;opacity:1}.sky-list-toolbar-container ::ng-deep sky-toolbar-item[sky-toolbar-id=sort-selector] .sky-toolbar-item{margin-right:0}.sky-list-toolbar-container ::ng-deep sky-checkbox{position:relative;top:-2px}"]
|
|
2410
|
-
})
|
|
2411
|
-
], SkyListToolbarComponent);
|
|
2412
|
-
|
|
2413
|
-
/**
|
|
2414
|
-
* @internal
|
|
2415
|
-
*/
|
|
2416
|
-
let SkyListToolbarItemRendererComponent = class SkyListToolbarItemRendererComponent {
|
|
2417
|
-
ngOnInit() {
|
|
2418
|
-
if (this.template !== undefined) {
|
|
2419
|
-
this.container.createEmbeddedView(this.template, this);
|
|
2420
|
-
}
|
|
2421
|
-
}
|
|
2422
|
-
};
|
|
2423
|
-
__decorate([
|
|
2424
|
-
Input()
|
|
2425
|
-
], SkyListToolbarItemRendererComponent.prototype, "template", void 0);
|
|
2426
|
-
__decorate([
|
|
2427
|
-
ViewChild('container', {
|
|
2428
|
-
read: ViewContainerRef,
|
|
2429
|
-
static: true
|
|
2430
|
-
})
|
|
2431
|
-
], SkyListToolbarItemRendererComponent.prototype, "container", void 0);
|
|
2432
|
-
SkyListToolbarItemRendererComponent = __decorate([
|
|
2433
|
-
Component({
|
|
2434
|
-
selector: 'sky-list-toolbar-item-renderer',
|
|
2435
|
-
template: '<ng-template #container></ng-template>'
|
|
2436
|
-
})
|
|
2437
|
-
], SkyListToolbarItemRendererComponent);
|
|
2438
|
-
|
|
2439
|
-
let uniqueId = 0;
|
|
2440
|
-
/**
|
|
2441
|
-
* @internal
|
|
2442
|
-
*/
|
|
2443
|
-
let SkyListMultiselectToolbarComponent = class SkyListMultiselectToolbarComponent {
|
|
2444
|
-
constructor(state, dispatcher) {
|
|
2445
|
-
this.state = state;
|
|
2446
|
-
this.dispatcher = dispatcher;
|
|
2447
|
-
this.showOnlySelected = false;
|
|
2448
|
-
this.multiselectToolbarId = `sky-list-multiselect-toolbar-${uniqueId++}`;
|
|
2449
|
-
this.selectedIdMap = new Map();
|
|
2450
|
-
this.ngUnsubscribe = new Subject();
|
|
2451
|
-
}
|
|
2452
|
-
ngOnInit() {
|
|
2453
|
-
this.state
|
|
2454
|
-
.pipe(map(t => t.selected.item), takeUntil(this.ngUnsubscribe), distinctUntilChanged(this.selectedMapEqual))
|
|
2455
|
-
.subscribe((model) => {
|
|
2456
|
-
this.selectedIdMap = model.selectedIdMap;
|
|
2457
|
-
if (this.showOnlySelected) {
|
|
2458
|
-
this.reapplyFilter(true);
|
|
2459
|
-
}
|
|
2460
|
-
});
|
|
2461
|
-
// If 'show-selected' filter is programatically set from a child component (e.g. checkilst),
|
|
2462
|
-
// make sure the checked state of the 'show-selected' checkbox stays in sync.
|
|
2463
|
-
this.state
|
|
2464
|
-
.pipe(map(t => t.filters), takeUntil(this.ngUnsubscribe), distinctUntilChanged(this.showSelectedValuesEqual))
|
|
2465
|
-
.subscribe((filters) => {
|
|
2466
|
-
const showSelectedFilter = filters.find(filter => filter.name === 'show-selected');
|
|
2467
|
-
if (showSelectedFilter) {
|
|
2468
|
-
this.showOnlySelected = (showSelectedFilter.value === 'true');
|
|
2469
|
-
}
|
|
2470
|
-
});
|
|
2471
|
-
}
|
|
2472
|
-
ngOnDestroy() {
|
|
2473
|
-
this.ngUnsubscribe.next();
|
|
2474
|
-
this.ngUnsubscribe.complete();
|
|
2475
|
-
}
|
|
2476
|
-
selectAll() {
|
|
2477
|
-
this.state
|
|
2478
|
-
.pipe(map(state => state.items.items), take(1))
|
|
2479
|
-
.subscribe(items => {
|
|
2480
|
-
this.dispatcher.setSelected(items.map(item => item.id), true);
|
|
2481
|
-
if (this.showOnlySelected) {
|
|
2482
|
-
this.reapplyFilter(this.showOnlySelected);
|
|
2483
|
-
}
|
|
2484
|
-
});
|
|
2485
|
-
}
|
|
2486
|
-
clearSelections() {
|
|
2487
|
-
this.state
|
|
2488
|
-
.pipe(map(state => state.items.items), take(1))
|
|
2489
|
-
.subscribe(items => {
|
|
2490
|
-
this.dispatcher.setSelected(items.map(item => item.id), false);
|
|
2491
|
-
if (this.showOnlySelected) {
|
|
2492
|
-
this.reapplyFilter(this.showOnlySelected);
|
|
2493
|
-
}
|
|
2494
|
-
});
|
|
2495
|
-
}
|
|
2496
|
-
changeVisibleItems(change) {
|
|
2497
|
-
this.showOnlySelected = change.checked;
|
|
2498
|
-
this.reapplyFilter(change.checked);
|
|
2499
|
-
}
|
|
2500
|
-
reapplyFilter(isSelected) {
|
|
2501
|
-
let self = this;
|
|
2502
|
-
this.state
|
|
2503
|
-
.pipe(map(state => state.filters), take(1))
|
|
2504
|
-
.subscribe((filters) => {
|
|
2505
|
-
filters = filters.filter(filter => filter.name !== 'show-selected');
|
|
2506
|
-
filters.push(self.getShowSelectedFilter(isSelected));
|
|
2507
|
-
this.dispatcher.filtersUpdate(filters);
|
|
2508
|
-
});
|
|
2509
|
-
// If "show selected" is checked and paging is enabled, go to page one.
|
|
2510
|
-
/* istanbul ignore else */
|
|
2511
|
-
if (isSelected) {
|
|
2512
|
-
this.state.pipe(take(1))
|
|
2513
|
-
.subscribe((currentState) => {
|
|
2514
|
-
if (currentState.paging.pageNumber && currentState.paging.pageNumber !== 1) {
|
|
2515
|
-
this.dispatcher.next(new ListPagingSetPageNumberAction(Number(1)));
|
|
2516
|
-
}
|
|
2517
|
-
});
|
|
2518
|
-
}
|
|
2519
|
-
this.dispatcher.toolbarSetDisabled(isSelected);
|
|
2520
|
-
}
|
|
2521
|
-
getShowSelectedFilter(isSelected) {
|
|
2522
|
-
return new ListFilterModel({
|
|
2523
|
-
name: 'show-selected',
|
|
2524
|
-
value: isSelected.toString(),
|
|
2525
|
-
filterFunction: (model, showOnlySelected) => {
|
|
2526
|
-
/* istanbul ignore else */
|
|
2527
|
-
if (showOnlySelected.toString() !== false.toString()) {
|
|
2528
|
-
return this.selectedIdMap.get(model.id);
|
|
2529
|
-
}
|
|
2530
|
-
},
|
|
2531
|
-
defaultValue: false.toString()
|
|
2532
|
-
});
|
|
2533
|
-
}
|
|
2534
|
-
showSelectedValuesEqual(prev, next) {
|
|
2535
|
-
const prevShowSelectedFilter = prev.find(filter => filter.name === 'show-selected');
|
|
2536
|
-
const nextShowSelectedFilter = next.find(filter => filter.name === 'show-selected');
|
|
2537
|
-
// Both undefined.
|
|
2538
|
-
if (!prevShowSelectedFilter && !nextShowSelectedFilter) {
|
|
2539
|
-
return true;
|
|
2540
|
-
}
|
|
2541
|
-
// Only one undefined.
|
|
2542
|
-
if ((prevShowSelectedFilter && !nextShowSelectedFilter) || (!prevShowSelectedFilter && nextShowSelectedFilter)) {
|
|
2543
|
-
return false;
|
|
2544
|
-
}
|
|
2545
|
-
// Defined, but with different "value".
|
|
2546
|
-
return prevShowSelectedFilter.value === nextShowSelectedFilter.value;
|
|
2547
|
-
}
|
|
2548
|
-
selectedMapEqual(prev, next) {
|
|
2549
|
-
if (prev.selectedIdMap.size !== next.selectedIdMap.size) {
|
|
2550
|
-
return false;
|
|
2551
|
-
}
|
|
2552
|
-
for (let i = 0; i < next.selectedIdMap.size; i++) {
|
|
2553
|
-
const key = Array.from(next.selectedIdMap.keys())[i];
|
|
2554
|
-
const value = next.selectedIdMap.get(key);
|
|
2555
|
-
if (value !== prev.selectedIdMap.get(key)) {
|
|
2556
|
-
return false;
|
|
2557
|
-
}
|
|
2558
|
-
}
|
|
2559
|
-
return true;
|
|
2560
|
-
}
|
|
2561
|
-
};
|
|
2562
|
-
SkyListMultiselectToolbarComponent.ctorParameters = () => [
|
|
2563
|
-
{ type: ListState },
|
|
2564
|
-
{ type: ListStateDispatcher }
|
|
2565
|
-
];
|
|
2566
|
-
__decorate([
|
|
2567
|
-
Input()
|
|
2568
|
-
], SkyListMultiselectToolbarComponent.prototype, "showOnlySelected", void 0);
|
|
2569
|
-
SkyListMultiselectToolbarComponent = __decorate([
|
|
2570
|
-
Component({
|
|
2571
|
-
selector: 'sky-list-multiselect-toolbar',
|
|
2572
|
-
template: "<sky-toolbar\n class=\"sky-list-multiselect-toolbar\"\n>\n <sky-toolbar-section>\n <sky-toolbar-item>\n <sky-list-toolbar-item-renderer\n [template]=\"selectAllTemplate\"\n >\n </sky-list-toolbar-item-renderer>\n </sky-toolbar-item>\n <sky-toolbar-item>\n <sky-list-toolbar-item-renderer\n [template]=\"clearSelectionsTemplate\"\n >\n </sky-list-toolbar-item-renderer>\n </sky-toolbar-item>\n <sky-toolbar-view-actions>\n <ng-container *ngTemplateOutlet=\"showSelectedTemplate\"></ng-container>\n </sky-toolbar-view-actions>\n </sky-toolbar-section>\n</sky-toolbar>\n\n<ng-template #selectAllTemplate>\n <button\n class=\"sky-btn sky-btn-link\"\n type=\"button\"\n [attr.id]=\"multiselectToolbarId + '-select-all'\"\n (click)=\"selectAll();$event.preventDefault();\"\n >\n {{ 'skyux_list_mutliselect_select_all' | skyLibResources }}\n </button>\n</ng-template>\n\n<ng-template #clearSelectionsTemplate>\n <button\n class=\"sky-btn sky-btn-link\"\n type=\"button\"\n [attr.id]=\"multiselectToolbarId + '-clear-all'\"\n (click)=\"clearSelections();$event.preventDefault();\"\n >\n {{ 'skyux_list_multiselect_clear_all' | skyLibResources }}\n </button>\n</ng-template>\n\n<ng-template #showSelectedTemplate>\n <sky-checkbox\n [attr.id]=\"multiselectToolbarId + '-show-selected'\"\n [checked]=\"showOnlySelected\"\n (change)=\"changeVisibleItems($event)\"\n >\n <sky-checkbox-label>\n {{ 'skyux_list_mutliselect_show_selected' | skyLibResources }}\n </sky-checkbox-label>\n </sky-checkbox>\n</ng-template>\n",
|
|
2573
|
-
styles: [":host-context(.sky-list-toolbar-search+) .sky-list-multiselect-toolbar ::ng-deep .sky-toolbar-container,:host-context(sky-toolbar+) .sky-list-multiselect-toolbar ::ng-deep .sky-toolbar-container{border-top:none}"]
|
|
2574
|
-
})
|
|
2575
|
-
], SkyListMultiselectToolbarComponent);
|
|
2546
|
+
}
|
|
2547
|
+
SkyListToolbarComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: SkyListToolbarComponent, deps: [{ token: i0.ChangeDetectorRef }, { token: ListState }, { token: ListStateDispatcher }, { token: ListToolbarState }, { token: ListToolbarStateDispatcher }], target: i0.ɵɵFactoryTarget.Component });
|
|
2548
|
+
SkyListToolbarComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.13", type: SkyListToolbarComponent, selector: "sky-list-toolbar", inputs: { inMemorySearchEnabled: "inMemorySearchEnabled", placeholder: "placeholder", searchEnabled: "searchEnabled", sortSelectorEnabled: "sortSelectorEnabled", toolbarType: "toolbarType", searchText: "searchText" }, providers: [
|
|
2549
|
+
ListToolbarState,
|
|
2550
|
+
ListToolbarStateDispatcher,
|
|
2551
|
+
ListToolbarStateModel,
|
|
2552
|
+
], queries: [{ propertyName: "toolbarItems", predicate: SkyListToolbarItemComponent }, { propertyName: "toolbarSorts", predicate: SkyListToolbarSortComponent }, { propertyName: "filterSummary", predicate: SkyListFilterSummaryComponent }, { propertyName: "inlineFilter", predicate: SkyListFilterInlineComponent }, { propertyName: "viewActions", predicate: SkyListToolbarViewActionsComponent }], viewQueries: [{ propertyName: "searchComponent", first: true, predicate: SkySearchComponent, descendants: true, read: SkySearchComponent }, { propertyName: "searchTemplate", first: true, predicate: ["search"], descendants: true, read: TemplateRef, static: true }, { propertyName: "sortSelectorTemplate", first: true, predicate: ["sortSelector"], descendants: true, read: TemplateRef, static: true }, { propertyName: "inlineFilterButtonTemplate", first: true, predicate: ["inlineFilterButton"], descendants: true, read: TemplateRef, static: true }], ngImport: i0, template: "<div class=\"sky-list-toolbar-container\">\n <sky-toolbar *ngIf=\"(type | async) !== 'search'\">\n <sky-toolbar-section>\n <sky-toolbar-item *ngFor=\"let item of leftTemplates\">\n <sky-list-toolbar-item-renderer\n [attr.sky-cmp-id]=\"item.id\"\n [template]=\"item.template\"\n >\n </sky-list-toolbar-item-renderer>\n </sky-toolbar-item>\n <sky-toolbar-item *ngFor=\"let item of centerTemplates\">\n <sky-list-toolbar-item-renderer\n [attr.sky-cmp-id]=\"item.id\"\n [template]=\"item.template\"\n >\n </sky-list-toolbar-item-renderer>\n </sky-toolbar-item>\n <sky-toolbar-item\n *ngFor=\"let item of rightTemplates\"\n [attr.sky-toolbar-id]=\"item.id\"\n >\n <sky-list-toolbar-item-renderer\n [attr.sky-cmp-id]=\"item.id\"\n [template]=\"item.template\"\n >\n </sky-list-toolbar-item-renderer>\n </sky-toolbar-item>\n\n <ng-content></ng-content>\n\n <sky-toolbar-view-actions *ngIf=\"hasViewActions\">\n <ng-content select=\"sky-list-toolbar-view-actions\"> </ng-content>\n </sky-toolbar-view-actions>\n </sky-toolbar-section>\n\n <sky-toolbar-section\n *ngIf=\"showFilterSummary && (hasAppliedFilters | async)\"\n >\n <ng-content select=\"sky-list-filter-summary\"> </ng-content>\n </sky-toolbar-section>\n </sky-toolbar>\n\n <div\n *ngIf=\"\n (type | async) === 'search' &&\n ((isSearchEnabled | async) || hasAdditionalToolbarSection)\n \"\n class=\"sky-list-toolbar-search\"\n >\n <sky-toolbar>\n <sky-toolbar-section *ngIf=\"isSearchEnabled | async\">\n <sky-toolbar-item>\n <sky-list-toolbar-item-renderer\n sky-cmp-id=\"search\"\n [template]=\"search\"\n >\n </sky-list-toolbar-item-renderer>\n </sky-toolbar-item>\n </sky-toolbar-section>\n <sky-toolbar-section [hidden]=\"!hasAdditionalToolbarSection\">\n <sky-toolbar-item *ngFor=\"let item of leftTemplates\">\n <sky-list-toolbar-item-renderer\n [attr.sky-cmp-id]=\"item.id\"\n [template]=\"item.template\"\n >\n </sky-list-toolbar-item-renderer>\n </sky-toolbar-item>\n <sky-toolbar-item *ngFor=\"let item of centerTemplates\">\n <sky-list-toolbar-item-renderer\n [attr.sky-cmp-id]=\"item.id\"\n [template]=\"item.template\"\n >\n </sky-list-toolbar-item-renderer>\n </sky-toolbar-item>\n <sky-toolbar-item\n *ngFor=\"let item of rightTemplates\"\n [attr.sky-toolbar-id]=\"item.id\"\n >\n <sky-list-toolbar-item-renderer\n *ngIf=\"item.id !== 'search'\"\n [attr.sky-cmp-id]=\"item.id\"\n [template]=\"item.template\"\n >\n </sky-list-toolbar-item-renderer>\n </sky-toolbar-item>\n <ng-content></ng-content>\n\n <sky-toolbar-view-actions *ngIf=\"hasViewActions\">\n <ng-content select=\"sky-list-toolbar-view-actions\"> </ng-content>\n </sky-toolbar-view-actions>\n </sky-toolbar-section>\n </sky-toolbar>\n </div>\n <div\n *ngIf=\"isFilterBarDisplayed\"\n [attr.aria-labelledby]=\"filterButtonId\"\n [id]=\"listFilterInlineId\"\n >\n <ng-content select=\"sky-list-filter-inline\"> </ng-content>\n </div>\n <sky-list-multiselect-toolbar *ngIf=\"isMultiselectEnabled | async\">\n </sky-list-multiselect-toolbar>\n</div>\n\n<ng-template #search>\n <div *ngIf=\"isSearchEnabled | async\" class=\"sky-list-toolbar-search-wrapper\">\n <sky-search\n [disabled]=\"isToolbarDisabled\"\n [expandMode]=\"(type | async) === 'search' ? 'fit' : 'responsive'\"\n [placeholderText]=\"placeholder\"\n [searchText]=\"searchTextInput | async\"\n (searchApply)=\"updateSearchText($event)\"\n >\n </sky-search>\n <ng-content select=\"sky-list-toolbar-search-actions\"></ng-content>\n </div>\n</ng-template>\n\n<ng-template #sortSelector>\n <div\n *ngIf=\"\n (isSortSelectorEnabled | async) && (sortSelectors | async).length > 0\n \"\n class=\"sky-toolbar-item-sort-container\"\n >\n <sky-sort [showButtonText]=\"true\">\n <sky-sort-item\n *ngFor=\"let item of sortSelectors | async\"\n [active]=\"item.selected\"\n (itemSelect)=\"setSort(item.sort)\"\n >\n {{ item.sort.text }}\n </sky-sort-item>\n </sky-sort>\n </div>\n</ng-template>\n\n<ng-template #inlineFilterButton>\n <sky-filter-button\n [active]=\"hasAppliedFilters | async\"\n [ariaControls]=\"filterButtonAriaControls\"\n [ariaExpanded]=\"inlineFilterBarExpanded\"\n [disabled]=\"isToolbarDisabled\"\n [filterButtonId]=\"filterButtonId\"\n [showButtonText]=\"true\"\n (filterButtonClick)=\"inlineFilterButtonClick()\"\n >\n </sky-filter-button>\n</ng-template>\n", styles: [".sky-list-toolbar-search-wrapper{display:flex}.sky-list-toolbar-search-wrapper ::ng-deep .sky-search-dismiss-absolute{padding:0;position:static}.sky-list-toolbar-search-wrapper ::ng-deep .sky-search-container{position:relative;height:100%}.sky-list-toolbar-search-wrapper ::ng-deep sky-search{flex:1 1 auto}.sky-list-toolbar-search-wrapper ::ng-deep sky-list-toolbar-search-actions{flex:0 0 auto;z-index:1}.sky-list-toolbar-container ::ng-deep .sky-toolbar-section-items sky-toolbar-item{flex:0 1 auto;align-self:flex-start}.sky-list-toolbar-search ::ng-deep .sky-toolbar-section{padding-top:0}.sky-list-toolbar-search ::ng-deep .sky-toolbar-section-items{display:block;width:100%}.sky-list-toolbar-search ::ng-deep .sky-toolbar-item{margin:0}.sky-list-toolbar-search ::ng-deep .sky-toolbar-container,.sky-list-toolbar-search ::ng-deep .sky-search-dismiss-absolute{background-color:#eeeeef}.sky-list-toolbar-search ::ng-deep input[type=text]:disabled,.sky-list-toolbar-search ::ng-deep .sky-search-btn:disabled{background-color:#cdcfd2;opacity:1}.sky-list-toolbar-container ::ng-deep sky-toolbar-item[sky-toolbar-id=sort-selector] .sky-toolbar-item{margin-right:0}.sky-list-toolbar-container ::ng-deep sky-checkbox{position:relative;top:-2px}\n"], components: [{ type: i3$2.λ37, selector: "sky-toolbar" }, { type: i3$2.λ38, selector: "sky-toolbar-section" }, { type: i3$2.λ39, selector: "sky-toolbar-item" }, { type: SkyListToolbarItemRendererComponent, selector: "sky-list-toolbar-item-renderer", inputs: ["template"] }, { type: i3$2.λ40, selector: "sky-toolbar-view-actions" }, { type: SkyListMultiselectToolbarComponent, selector: "sky-list-multiselect-toolbar", inputs: ["showOnlySelected"] }, { type: i8.SkySearchComponent, selector: "sky-search", inputs: ["searchText", "expandMode", "debounceTime", "disabled", "placeholderText"], outputs: ["searchApply", "searchChange", "searchClear"] }, { type: i3.λ14, selector: "sky-sort", inputs: ["showButtonText"] }, { type: i3.λ13, selector: "sky-sort-item", inputs: ["active"], outputs: ["itemSelect"] }, { type: i3.λ1, selector: "sky-filter-button", inputs: ["filterButtonId", "ariaControls", "ariaExpanded", "active", "disabled", "showButtonText"], outputs: ["filterButtonClick"] }], directives: [{ type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i4.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }], pipes: { "async": i4.AsyncPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
2553
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: SkyListToolbarComponent, decorators: [{
|
|
2554
|
+
type: Component,
|
|
2555
|
+
args: [{
|
|
2556
|
+
selector: 'sky-list-toolbar',
|
|
2557
|
+
templateUrl: './list-toolbar.component.html',
|
|
2558
|
+
styleUrls: ['./list-toolbar.component.scss'],
|
|
2559
|
+
providers: [
|
|
2560
|
+
ListToolbarState,
|
|
2561
|
+
ListToolbarStateDispatcher,
|
|
2562
|
+
ListToolbarStateModel,
|
|
2563
|
+
],
|
|
2564
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
2565
|
+
}]
|
|
2566
|
+
}], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }, { type: ListState }, { type: ListStateDispatcher }, { type: ListToolbarState }, { type: ListToolbarStateDispatcher }]; }, propDecorators: { inMemorySearchEnabled: [{
|
|
2567
|
+
type: Input
|
|
2568
|
+
}], placeholder: [{
|
|
2569
|
+
type: Input
|
|
2570
|
+
}], searchEnabled: [{
|
|
2571
|
+
type: Input
|
|
2572
|
+
}], searchComponent: [{
|
|
2573
|
+
type: ViewChild,
|
|
2574
|
+
args: [SkySearchComponent, {
|
|
2575
|
+
read: SkySearchComponent,
|
|
2576
|
+
static: false,
|
|
2577
|
+
}]
|
|
2578
|
+
}], sortSelectorEnabled: [{
|
|
2579
|
+
type: Input
|
|
2580
|
+
}], toolbarType: [{
|
|
2581
|
+
type: Input
|
|
2582
|
+
}], searchText: [{
|
|
2583
|
+
type: Input
|
|
2584
|
+
}], toolbarItems: [{
|
|
2585
|
+
type: ContentChildren,
|
|
2586
|
+
args: [SkyListToolbarItemComponent]
|
|
2587
|
+
}], toolbarSorts: [{
|
|
2588
|
+
type: ContentChildren,
|
|
2589
|
+
args: [SkyListToolbarSortComponent]
|
|
2590
|
+
}], filterSummary: [{
|
|
2591
|
+
type: ContentChildren,
|
|
2592
|
+
args: [SkyListFilterSummaryComponent]
|
|
2593
|
+
}], inlineFilter: [{
|
|
2594
|
+
type: ContentChildren,
|
|
2595
|
+
args: [SkyListFilterInlineComponent]
|
|
2596
|
+
}], viewActions: [{
|
|
2597
|
+
type: ContentChildren,
|
|
2598
|
+
args: [SkyListToolbarViewActionsComponent]
|
|
2599
|
+
}], searchTemplate: [{
|
|
2600
|
+
type: ViewChild,
|
|
2601
|
+
args: ['search', {
|
|
2602
|
+
read: TemplateRef,
|
|
2603
|
+
static: true,
|
|
2604
|
+
}]
|
|
2605
|
+
}], sortSelectorTemplate: [{
|
|
2606
|
+
type: ViewChild,
|
|
2607
|
+
args: ['sortSelector', {
|
|
2608
|
+
read: TemplateRef,
|
|
2609
|
+
static: true,
|
|
2610
|
+
}]
|
|
2611
|
+
}], inlineFilterButtonTemplate: [{
|
|
2612
|
+
type: ViewChild,
|
|
2613
|
+
args: ['inlineFilterButton', {
|
|
2614
|
+
read: TemplateRef,
|
|
2615
|
+
static: true,
|
|
2616
|
+
}]
|
|
2617
|
+
}] } });
|
|
2576
2618
|
|
|
2577
2619
|
/**
|
|
2578
2620
|
* Displays custom actions in the toolbar beside to the search bar.
|
|
2579
2621
|
*/
|
|
2580
|
-
|
|
2581
|
-
}
|
|
2582
|
-
SkyListToolbarSearchActionsComponent =
|
|
2583
|
-
|
|
2584
|
-
|
|
2585
|
-
|
|
2586
|
-
|
|
2587
|
-
|
|
2588
|
-
|
|
2589
|
-
],
|
|
2590
|
-
|
|
2591
|
-
|
|
2592
|
-
};
|
|
2593
|
-
|
|
2594
|
-
|
|
2595
|
-
|
|
2596
|
-
|
|
2597
|
-
|
|
2598
|
-
|
|
2599
|
-
|
|
2600
|
-
|
|
2601
|
-
|
|
2602
|
-
|
|
2603
|
-
],
|
|
2604
|
-
|
|
2622
|
+
class SkyListToolbarSearchActionsComponent {
|
|
2623
|
+
}
|
|
2624
|
+
SkyListToolbarSearchActionsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: SkyListToolbarSearchActionsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2625
|
+
SkyListToolbarSearchActionsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.13", type: SkyListToolbarSearchActionsComponent, selector: "sky-list-toolbar-search-actions", ngImport: i0, template: "<div class=\"sky-list-toolbar-search-actions\">\n <ng-content></ng-content>\n</div>\n", styles: [".sky-list-toolbar-search-actions{margin-left:10px}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
2626
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: SkyListToolbarSearchActionsComponent, decorators: [{
|
|
2627
|
+
type: Component,
|
|
2628
|
+
args: [{
|
|
2629
|
+
selector: 'sky-list-toolbar-search-actions',
|
|
2630
|
+
templateUrl: './list-toolbar-search-actions.component.html',
|
|
2631
|
+
styleUrls: ['./list-toolbar-search-actions.component.scss'],
|
|
2632
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
2633
|
+
}]
|
|
2634
|
+
}] });
|
|
2635
|
+
|
|
2636
|
+
class SkyListToolbarModule {
|
|
2637
|
+
}
|
|
2638
|
+
SkyListToolbarModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: SkyListToolbarModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
2639
|
+
SkyListToolbarModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: SkyListToolbarModule, declarations: [SkyListToolbarComponent,
|
|
2640
|
+
SkyListToolbarItemComponent,
|
|
2641
|
+
SkyListToolbarItemRendererComponent,
|
|
2642
|
+
SkyListMultiselectToolbarComponent,
|
|
2643
|
+
SkyListToolbarSearchActionsComponent,
|
|
2644
|
+
SkyListToolbarSortComponent,
|
|
2645
|
+
SkyListToolbarViewActionsComponent], imports: [CommonModule,
|
|
2646
|
+
SkyCheckboxModule,
|
|
2647
|
+
SkyI18nModule,
|
|
2648
|
+
SkyToolbarModule,
|
|
2649
|
+
SkySearchModule,
|
|
2650
|
+
SkySortModule,
|
|
2651
|
+
SkyFilterModule,
|
|
2652
|
+
SkyListFiltersModule,
|
|
2653
|
+
SkyIconModule,
|
|
2654
|
+
SkyListBuilderResourcesModule], exports: [SkyListToolbarComponent,
|
|
2655
|
+
SkyListToolbarItemComponent,
|
|
2656
|
+
SkyListToolbarSearchActionsComponent,
|
|
2657
|
+
SkyListToolbarSortComponent,
|
|
2658
|
+
SkyListToolbarViewActionsComponent] });
|
|
2659
|
+
SkyListToolbarModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: SkyListToolbarModule, imports: [[
|
|
2605
2660
|
CommonModule,
|
|
2606
2661
|
SkyCheckboxModule,
|
|
2607
2662
|
SkyI18nModule,
|
|
@@ -2611,23 +2666,45 @@ SkyListToolbarModule = __decorate([
|
|
|
2611
2666
|
SkyFilterModule,
|
|
2612
2667
|
SkyListFiltersModule,
|
|
2613
2668
|
SkyIconModule,
|
|
2614
|
-
SkyListBuilderResourcesModule
|
|
2615
|
-
]
|
|
2616
|
-
|
|
2617
|
-
|
|
2618
|
-
|
|
2619
|
-
|
|
2620
|
-
|
|
2621
|
-
|
|
2622
|
-
|
|
2623
|
-
|
|
2624
|
-
|
|
2625
|
-
|
|
2626
|
-
|
|
2669
|
+
SkyListBuilderResourcesModule,
|
|
2670
|
+
]] });
|
|
2671
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: SkyListToolbarModule, decorators: [{
|
|
2672
|
+
type: NgModule,
|
|
2673
|
+
args: [{
|
|
2674
|
+
declarations: [
|
|
2675
|
+
SkyListToolbarComponent,
|
|
2676
|
+
SkyListToolbarItemComponent,
|
|
2677
|
+
SkyListToolbarItemRendererComponent,
|
|
2678
|
+
SkyListMultiselectToolbarComponent,
|
|
2679
|
+
SkyListToolbarSearchActionsComponent,
|
|
2680
|
+
SkyListToolbarSortComponent,
|
|
2681
|
+
SkyListToolbarViewActionsComponent,
|
|
2682
|
+
],
|
|
2683
|
+
imports: [
|
|
2684
|
+
CommonModule,
|
|
2685
|
+
SkyCheckboxModule,
|
|
2686
|
+
SkyI18nModule,
|
|
2687
|
+
SkyToolbarModule,
|
|
2688
|
+
SkySearchModule,
|
|
2689
|
+
SkySortModule,
|
|
2690
|
+
SkyFilterModule,
|
|
2691
|
+
SkyListFiltersModule,
|
|
2692
|
+
SkyIconModule,
|
|
2693
|
+
SkyListBuilderResourcesModule,
|
|
2694
|
+
],
|
|
2695
|
+
exports: [
|
|
2696
|
+
SkyListToolbarComponent,
|
|
2697
|
+
SkyListToolbarItemComponent,
|
|
2698
|
+
SkyListToolbarSearchActionsComponent,
|
|
2699
|
+
SkyListToolbarSortComponent,
|
|
2700
|
+
SkyListToolbarViewActionsComponent,
|
|
2701
|
+
],
|
|
2702
|
+
}]
|
|
2703
|
+
}] });
|
|
2627
2704
|
|
|
2628
2705
|
/**
|
|
2629
2706
|
* Generated bundle index. Do not edit.
|
|
2630
2707
|
*/
|
|
2631
2708
|
|
|
2632
|
-
export { ListDataProvider, ListDataRequestModel, ListDataResponseModel, ListFilterModel, ListFiltersOrchestrator, ListFiltersUpdateAction, ListItemsLoadAction, ListItemsOrchestrator, ListItemsSetLoadingAction, ListItemsSetSelectedAction, ListPagingModel, ListPagingOrchestrator, ListPagingSetItemsPerPageAction, ListPagingSetMaxPagesAction, ListPagingSetPageNumberAction, ListSearchModel, ListSearchOrchestrator, ListSearchSetFieldSelectorsAction, ListSearchSetFunctionsAction, ListSearchSetOptionsAction, ListSearchSetSearchTextAction, ListSelectedLoadAction, ListSelectedModel, ListSelectedOrchestrator, ListSelectedSetItemSelectedAction, ListSelectedSetItemsSelectedAction, ListSelectedSetLoadingAction, ListSortLabelModel, ListSortModel, ListSortOrchestrator, ListSortSetAvailableAction, ListSortSetFieldSelectorsAction, ListSortSetGlobalAction, ListState, ListStateDispatcher, ListStateModel, ListStateOrchestrator, ListToolbarItemModel, ListToolbarItemsDisableAction, ListToolbarItemsLoadAction, ListToolbarItemsRemoveAction, ListToolbarModel, ListToolbarOrchestrator, ListToolbarSetExistsAction, ListToolbarSetTypeAction, ListToolbarShowMultiselectToolbarAction, ListViewComponent, ListViewModel, ListViewsLoadAction, ListViewsModel, ListViewsOrchestrator, ListViewsSetActiveAction, SkyListComponent, SkyListFilterInlineModel, SkyListFiltersModule, SkyListInMemoryDataProvider, SkyListModule, SkyListPagingModule, SkyListSecondaryActionsComponent, SkyListSecondaryActionsModule, SkyListToolbarComponent, SkyListToolbarModule, SkyListFilterButtonComponent as
|
|
2709
|
+
export { ListDataProvider, ListDataRequestModel, ListDataResponseModel, ListFilterModel, ListFiltersOrchestrator, ListFiltersUpdateAction, ListItemsLoadAction, ListItemsOrchestrator, ListItemsSetLoadingAction, ListItemsSetSelectedAction, ListPagingModel, ListPagingOrchestrator, ListPagingSetItemsPerPageAction, ListPagingSetMaxPagesAction, ListPagingSetPageNumberAction, ListSearchModel, ListSearchOrchestrator, ListSearchSetFieldSelectorsAction, ListSearchSetFunctionsAction, ListSearchSetOptionsAction, ListSearchSetSearchTextAction, ListSelectedLoadAction, ListSelectedModel, ListSelectedOrchestrator, ListSelectedSetItemSelectedAction, ListSelectedSetItemsSelectedAction, ListSelectedSetLoadingAction, ListSortLabelModel, ListSortModel, ListSortOrchestrator, ListSortSetAvailableAction, ListSortSetFieldSelectorsAction, ListSortSetGlobalAction, ListState, ListStateDispatcher, ListStateModel, ListStateOrchestrator, ListToolbarItemModel, ListToolbarItemsDisableAction, ListToolbarItemsLoadAction, ListToolbarItemsRemoveAction, ListToolbarModel, ListToolbarOrchestrator, ListToolbarSetExistsAction, ListToolbarSetTypeAction, ListToolbarShowMultiselectToolbarAction, ListViewComponent, ListViewModel, ListViewsLoadAction, ListViewsModel, ListViewsOrchestrator, ListViewsSetActiveAction, SkyListComponent, SkyListFilterInlineModel, SkyListFiltersModule, SkyListInMemoryDataProvider, SkyListModule, SkyListPagingModule, SkyListSecondaryActionsComponent, SkyListSecondaryActionsModule, SkyListToolbarComponent, SkyListToolbarModule, SkyListFilterButtonComponent as λ1, SkyListToolbarViewActionsComponent as λ10, SkyListToolbarSearchActionsComponent as λ11, SkyListFilterSummaryComponent as λ2, SkyListFilterInlineItemComponent as λ3, SkyListFilterInlineComponent as λ4, SkyListPagingComponent as λ5, SkyListSecondaryActionComponent as λ6, SkyListSecondaryActionsComponent as λ7, SkyListToolbarItemComponent as λ8, SkyListToolbarSortComponent as λ9 };
|
|
2633
2710
|
//# sourceMappingURL=skyux-list-builder.js.map
|