@skyux/data-manager 5.6.2 → 6.0.0-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (99) hide show
  1. package/documentation.json +3 -3
  2. package/esm2020/index.mjs +26 -0
  3. package/esm2020/lib/modules/data-manager/data-manager-column-picker/data-manager-column-picker-context.mjs +9 -0
  4. package/esm2020/lib/modules/data-manager/data-manager-column-picker/data-manager-column-picker-impl.service.mjs +14 -0
  5. package/esm2020/lib/modules/data-manager/data-manager-column-picker/data-manager-column-picker.component.mjs +157 -0
  6. package/esm2020/lib/modules/data-manager/data-manager-column-picker/data-manager-column-picker.service.mjs +16 -0
  7. package/esm2020/lib/modules/data-manager/data-manager-filter-context.mjs +3 -0
  8. package/esm2020/lib/modules/data-manager/data-manager-toolbar/data-manager-toolbar-left-item.component.mjs +17 -0
  9. package/esm2020/lib/modules/data-manager/data-manager-toolbar/data-manager-toolbar-primary-item.component.mjs +17 -0
  10. package/esm2020/lib/modules/data-manager/data-manager-toolbar/data-manager-toolbar-right-item.component.mjs +17 -0
  11. package/esm2020/lib/modules/data-manager/data-manager-toolbar/data-manager-toolbar-section.component.mjs +17 -0
  12. package/esm2020/lib/modules/data-manager/data-manager-toolbar/data-manager-toolbar.component.mjs +180 -0
  13. package/esm2020/lib/modules/data-manager/data-manager.component.mjs +80 -0
  14. package/esm2020/lib/modules/data-manager/data-manager.module.mjs +122 -0
  15. package/esm2020/lib/modules/data-manager/data-manager.service.mjs +277 -0
  16. package/esm2020/lib/modules/data-manager/data-view.component.mjs +48 -0
  17. package/esm2020/lib/modules/data-manager/models/data-manager-column-picker-option.mjs +2 -0
  18. package/esm2020/lib/modules/data-manager/models/data-manager-column-picker-sort-strategy.mjs +6 -0
  19. package/esm2020/lib/modules/data-manager/models/data-manager-config.mjs +2 -0
  20. package/esm2020/lib/modules/data-manager/models/data-manager-filter-data.mjs +2 -0
  21. package/esm2020/lib/modules/data-manager/models/data-manager-init-args.mjs +2 -0
  22. package/esm2020/lib/modules/data-manager/models/data-manager-sort-option.mjs +2 -0
  23. package/esm2020/lib/modules/data-manager/models/data-manager-state-change.mjs +11 -0
  24. package/esm2020/lib/modules/data-manager/models/data-manager-state-options.mjs +2 -0
  25. package/esm2020/lib/modules/data-manager/models/data-manager-state-update-filter-args.mjs +2 -0
  26. package/esm2020/lib/modules/data-manager/models/data-manager-state.mjs +49 -0
  27. package/esm2020/lib/modules/data-manager/models/data-view-config.mjs +2 -0
  28. package/esm2020/lib/modules/data-manager/models/data-view-state-options.mjs +2 -0
  29. package/esm2020/lib/modules/data-manager/models/data-view-state.mjs +19 -0
  30. package/esm2020/lib/modules/shared/sky-data-manager-resources.module.mjs +57 -0
  31. package/esm2020/skyux-data-manager.mjs +5 -0
  32. package/fesm2015/{skyux-data-manager.js → skyux-data-manager.mjs} +54 -86
  33. package/fesm2015/skyux-data-manager.mjs.map +1 -0
  34. package/fesm2020/skyux-data-manager.mjs +1038 -0
  35. package/fesm2020/skyux-data-manager.mjs.map +1 -0
  36. package/lib/modules/shared/sky-data-manager-resources.module.d.ts +1 -1
  37. package/package.json +30 -17
  38. package/bundles/skyux-data-manager.umd.js +0 -1524
  39. package/esm2015/index.js +0 -26
  40. package/esm2015/index.js.map +0 -1
  41. package/esm2015/lib/modules/data-manager/data-manager-column-picker/data-manager-column-picker-context.js +0 -9
  42. package/esm2015/lib/modules/data-manager/data-manager-column-picker/data-manager-column-picker-context.js.map +0 -1
  43. package/esm2015/lib/modules/data-manager/data-manager-column-picker/data-manager-column-picker-impl.service.js +0 -14
  44. package/esm2015/lib/modules/data-manager/data-manager-column-picker/data-manager-column-picker-impl.service.js.map +0 -1
  45. package/esm2015/lib/modules/data-manager/data-manager-column-picker/data-manager-column-picker.component.js +0 -164
  46. package/esm2015/lib/modules/data-manager/data-manager-column-picker/data-manager-column-picker.component.js.map +0 -1
  47. package/esm2015/lib/modules/data-manager/data-manager-column-picker/data-manager-column-picker.service.js +0 -16
  48. package/esm2015/lib/modules/data-manager/data-manager-column-picker/data-manager-column-picker.service.js.map +0 -1
  49. package/esm2015/lib/modules/data-manager/data-manager-filter-context.js +0 -3
  50. package/esm2015/lib/modules/data-manager/data-manager-filter-context.js.map +0 -1
  51. package/esm2015/lib/modules/data-manager/data-manager-toolbar/data-manager-toolbar-left-item.component.js +0 -20
  52. package/esm2015/lib/modules/data-manager/data-manager-toolbar/data-manager-toolbar-left-item.component.js.map +0 -1
  53. package/esm2015/lib/modules/data-manager/data-manager-toolbar/data-manager-toolbar-primary-item.component.js +0 -20
  54. package/esm2015/lib/modules/data-manager/data-manager-toolbar/data-manager-toolbar-primary-item.component.js.map +0 -1
  55. package/esm2015/lib/modules/data-manager/data-manager-toolbar/data-manager-toolbar-right-item.component.js +0 -20
  56. package/esm2015/lib/modules/data-manager/data-manager-toolbar/data-manager-toolbar-right-item.component.js.map +0 -1
  57. package/esm2015/lib/modules/data-manager/data-manager-toolbar/data-manager-toolbar-section.component.js +0 -20
  58. package/esm2015/lib/modules/data-manager/data-manager-toolbar/data-manager-toolbar-section.component.js.map +0 -1
  59. package/esm2015/lib/modules/data-manager/data-manager-toolbar/data-manager-toolbar.component.js +0 -185
  60. package/esm2015/lib/modules/data-manager/data-manager-toolbar/data-manager-toolbar.component.js.map +0 -1
  61. package/esm2015/lib/modules/data-manager/data-manager.component.js +0 -84
  62. package/esm2015/lib/modules/data-manager/data-manager.component.js.map +0 -1
  63. package/esm2015/lib/modules/data-manager/data-manager.module.js +0 -123
  64. package/esm2015/lib/modules/data-manager/data-manager.module.js.map +0 -1
  65. package/esm2015/lib/modules/data-manager/data-manager.service.js +0 -278
  66. package/esm2015/lib/modules/data-manager/data-manager.service.js.map +0 -1
  67. package/esm2015/lib/modules/data-manager/data-view.component.js +0 -52
  68. package/esm2015/lib/modules/data-manager/data-view.component.js.map +0 -1
  69. package/esm2015/lib/modules/data-manager/models/data-manager-column-picker-option.js +0 -2
  70. package/esm2015/lib/modules/data-manager/models/data-manager-column-picker-option.js.map +0 -1
  71. package/esm2015/lib/modules/data-manager/models/data-manager-column-picker-sort-strategy.js +0 -6
  72. package/esm2015/lib/modules/data-manager/models/data-manager-column-picker-sort-strategy.js.map +0 -1
  73. package/esm2015/lib/modules/data-manager/models/data-manager-config.js +0 -2
  74. package/esm2015/lib/modules/data-manager/models/data-manager-config.js.map +0 -1
  75. package/esm2015/lib/modules/data-manager/models/data-manager-filter-data.js +0 -2
  76. package/esm2015/lib/modules/data-manager/models/data-manager-filter-data.js.map +0 -1
  77. package/esm2015/lib/modules/data-manager/models/data-manager-init-args.js +0 -2
  78. package/esm2015/lib/modules/data-manager/models/data-manager-init-args.js.map +0 -1
  79. package/esm2015/lib/modules/data-manager/models/data-manager-sort-option.js +0 -2
  80. package/esm2015/lib/modules/data-manager/models/data-manager-sort-option.js.map +0 -1
  81. package/esm2015/lib/modules/data-manager/models/data-manager-state-change.js +0 -11
  82. package/esm2015/lib/modules/data-manager/models/data-manager-state-change.js.map +0 -1
  83. package/esm2015/lib/modules/data-manager/models/data-manager-state-options.js +0 -2
  84. package/esm2015/lib/modules/data-manager/models/data-manager-state-options.js.map +0 -1
  85. package/esm2015/lib/modules/data-manager/models/data-manager-state-update-filter-args.js +0 -2
  86. package/esm2015/lib/modules/data-manager/models/data-manager-state-update-filter-args.js.map +0 -1
  87. package/esm2015/lib/modules/data-manager/models/data-manager-state.js +0 -49
  88. package/esm2015/lib/modules/data-manager/models/data-manager-state.js.map +0 -1
  89. package/esm2015/lib/modules/data-manager/models/data-view-config.js +0 -2
  90. package/esm2015/lib/modules/data-manager/models/data-view-config.js.map +0 -1
  91. package/esm2015/lib/modules/data-manager/models/data-view-state-options.js +0 -2
  92. package/esm2015/lib/modules/data-manager/models/data-view-state-options.js.map +0 -1
  93. package/esm2015/lib/modules/data-manager/models/data-view-state.js +0 -19
  94. package/esm2015/lib/modules/data-manager/models/data-view-state.js.map +0 -1
  95. package/esm2015/lib/modules/shared/sky-data-manager-resources.module.js +0 -57
  96. package/esm2015/lib/modules/shared/sky-data-manager-resources.module.js.map +0 -1
  97. package/esm2015/skyux-data-manager.js +0 -5
  98. package/esm2015/skyux-data-manager.js.map +0 -1
  99. package/fesm2015/skyux-data-manager.js.map +0 -1
@@ -0,0 +1,1038 @@
1
+ import * as i9 from '@angular/common';
2
+ import { CommonModule } from '@angular/common';
3
+ import * as i0 from '@angular/core';
4
+ import { NgModule, Injectable, Component, ChangeDetectionStrategy, Input } from '@angular/core';
5
+ import * as i10 from '@angular/forms';
6
+ import { FormsModule } from '@angular/forms';
7
+ import * as i1 from '@skyux/core';
8
+ import { SkyViewkeeperModule } from '@skyux/core';
9
+ import * as i8$1 from '@skyux/forms';
10
+ import { SkyCheckboxModule, SkyRadioModule } from '@skyux/forms';
11
+ import * as i6 from '@skyux/indicators';
12
+ import { SkyIconModule } from '@skyux/indicators';
13
+ import * as i4 from '@skyux/layout';
14
+ import { SkyBackToTopMessageType, SkyBackToTopModule, SkyToolbarModule } from '@skyux/layout';
15
+ import * as i8 from '@skyux/lists';
16
+ import { SkyFilterModule, SkyRepeaterModule, SkySortModule } from '@skyux/lists';
17
+ import * as i7 from '@skyux/lookup';
18
+ import { SkySearchModule } from '@skyux/lookup';
19
+ import * as i3 from '@skyux/modals';
20
+ import { SkyModalModule } from '@skyux/modals';
21
+ import * as i4$1 from '@skyux/i18n';
22
+ import { getLibStringForLocale, SkyI18nModule, SKY_LIB_RESOURCES_PROVIDERS } from '@skyux/i18n';
23
+ import { BehaviorSubject, ReplaySubject, Subject } from 'rxjs';
24
+ import { take, takeUntil, filter, map, distinctUntilChanged } from 'rxjs/operators';
25
+
26
+ /**
27
+ * NOTICE: DO NOT MODIFY THIS FILE!
28
+ * The contents of this file were automatically generated by
29
+ * the 'ng generate @skyux/i18n:lib-resources-module lib/modules/shared/sky-data-manager' schematic.
30
+ * To update this file, simply rerun the command.
31
+ */
32
+ const RESOURCES = {
33
+ 'EN-US': {
34
+ skyux_data_manager_column_picker_title: {
35
+ message: 'Choose columns to show in the list',
36
+ },
37
+ skyux_data_manager_apply_changes_button_title: { message: 'Apply changes' },
38
+ skyux_data_manager_cancel_button_title: { message: 'Cancel' },
39
+ skyux_data_manager_select_all_button_title: { message: 'Select all' },
40
+ skyux_data_manager_clear_all_button_title: { message: 'Clear all' },
41
+ skyux_data_manager_show_selected_option_title: {
42
+ message: 'Show only selected items',
43
+ },
44
+ skyux_data_manager_columns_button_title: { message: 'Columns' },
45
+ },
46
+ };
47
+ class SkyDataManagerResourcesProvider {
48
+ getString(localeInfo, name) {
49
+ return getLibStringForLocale(RESOURCES, localeInfo.locale, name);
50
+ }
51
+ }
52
+ /**
53
+ * Import into any component library module that needs to use resource strings.
54
+ */
55
+ class SkyDataManagerResourcesModule {
56
+ }
57
+ SkyDataManagerResourcesModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: SkyDataManagerResourcesModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
58
+ SkyDataManagerResourcesModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: SkyDataManagerResourcesModule, exports: [SkyI18nModule] });
59
+ SkyDataManagerResourcesModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: SkyDataManagerResourcesModule, providers: [
60
+ {
61
+ provide: SKY_LIB_RESOURCES_PROVIDERS,
62
+ useClass: SkyDataManagerResourcesProvider,
63
+ multi: true,
64
+ },
65
+ ], imports: [SkyI18nModule] });
66
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: SkyDataManagerResourcesModule, decorators: [{
67
+ type: NgModule,
68
+ args: [{
69
+ exports: [SkyI18nModule],
70
+ providers: [
71
+ {
72
+ provide: SKY_LIB_RESOURCES_PROVIDERS,
73
+ useClass: SkyDataManagerResourcesProvider,
74
+ multi: true,
75
+ },
76
+ ],
77
+ }]
78
+ }] });
79
+
80
+ class SkyDataViewState {
81
+ constructor(data) {
82
+ this.columnIds = [];
83
+ this.displayedColumnIds = [];
84
+ this.viewId = data.viewId;
85
+ this.columnIds = data.columnIds || [];
86
+ this.displayedColumnIds = data.displayedColumnIds || [];
87
+ this.additionalData = data.additionalData;
88
+ }
89
+ getViewStateOptions() {
90
+ return {
91
+ viewId: this.viewId,
92
+ columnIds: this.columnIds,
93
+ displayedColumnIds: this.displayedColumnIds,
94
+ additionalData: this.additionalData,
95
+ };
96
+ }
97
+ }
98
+
99
+ class SkyDataManagerState {
100
+ constructor(data) {
101
+ this.views = [];
102
+ const views = data.views && data.views.map((view) => new SkyDataViewState(view));
103
+ this.activeSortOption = data.activeSortOption;
104
+ this.additionalData = data.additionalData;
105
+ this.filterData = data.filterData;
106
+ this.onlyShowSelected = data.onlyShowSelected;
107
+ this.selectedIds = data.selectedIds;
108
+ this.searchText = data.searchText;
109
+ this.views = views || [];
110
+ }
111
+ getStateOptions() {
112
+ const viewStates = this.views.map((view) => {
113
+ return view.getViewStateOptions();
114
+ });
115
+ return {
116
+ activeSortOption: this.activeSortOption,
117
+ additionalData: this.additionalData,
118
+ filterData: this.filterData,
119
+ onlyShowSelected: this.onlyShowSelected,
120
+ searchText: this.searchText,
121
+ selectedIds: this.selectedIds,
122
+ views: viewStates,
123
+ };
124
+ }
125
+ getViewStateById(viewId) {
126
+ return this.views.find((view) => view.viewId === viewId);
127
+ }
128
+ addOrUpdateView(viewId, view) {
129
+ const existingViewIndex = this.views.findIndex((v) => v.viewId === viewId);
130
+ if (existingViewIndex !== -1) {
131
+ this.views[existingViewIndex] = view;
132
+ }
133
+ else {
134
+ this.views.push(view);
135
+ }
136
+ return new SkyDataManagerState({
137
+ activeSortOption: this.activeSortOption,
138
+ additionalData: this.additionalData,
139
+ filterData: this.filterData,
140
+ searchText: this.searchText,
141
+ selectedIds: this.selectedIds,
142
+ views: this.views,
143
+ });
144
+ }
145
+ }
146
+
147
+ /**
148
+ * @internal
149
+ */
150
+ class SkyDataManagerStateChange {
151
+ constructor(dataState, source) {
152
+ this.dataState = new SkyDataManagerState(dataState.getStateOptions());
153
+ this.source = source;
154
+ }
155
+ }
156
+
157
+ /**
158
+ * The data manager service provides ways for data views, toolbar items, and more to stay up to date
159
+ * with the active view ID, data manager config, registered views and their configs, and data state.
160
+ * There are methods to get current values, update values, and get subscriptions to the changing values.<br/> <br/>
161
+ * Provide this service at the component level for each instance of a data manager. Do not
162
+ * provide it at the module level or in `app-extras`. This allows multiple data
163
+ * managers to be used and self-contained.
164
+ */
165
+ class SkyDataManagerService {
166
+ constructor(uiConfigService) {
167
+ this.uiConfigService = uiConfigService;
168
+ this.viewkeeperClasses = new BehaviorSubject({});
169
+ this.activeViewId = new ReplaySubject(1);
170
+ this.dataManagerConfig = new BehaviorSubject(undefined);
171
+ this.views = new BehaviorSubject([]);
172
+ this.dataStateChange = new ReplaySubject(1);
173
+ this._ngUnsubscribe = new Subject();
174
+ this.initSource = 'dataManagerServiceInit';
175
+ this.isInitialized = false;
176
+ }
177
+ ngOnDestroy() {
178
+ this.activeViewId.complete();
179
+ this.dataManagerConfig.complete();
180
+ this.views.complete();
181
+ this.dataStateChange.complete();
182
+ this._ngUnsubscribe.next();
183
+ this._ngUnsubscribe.complete();
184
+ }
185
+ /**
186
+ * Initializes the data manager with the given settings and sets `isInitialized` to `true`.
187
+ * This must be called for the data manager to render.
188
+ * @param args The initial active view ID, data manager config, and state to use for the data manager.
189
+ * If a settings key is provided, it checks for a saved data state in the SKY UI config service before using the default data state
190
+ * and saves any state changes to the service.
191
+ */
192
+ initDataManager(args) {
193
+ if (this.isInitialized) {
194
+ console.warn('This data manager instance has already been initialized.');
195
+ return;
196
+ }
197
+ const defaultDataState = args.defaultDataState;
198
+ const settingsKey = args.settingsKey;
199
+ this.updateActiveViewId(args.activeViewId);
200
+ this.updateDataManagerConfig(args.dataManagerConfig);
201
+ if (settingsKey) {
202
+ this.uiConfigService
203
+ .getConfig(settingsKey, defaultDataState.getStateOptions())
204
+ .pipe(take(1))
205
+ .subscribe((config) => {
206
+ this.updateDataState(new SkyDataManagerState(config), this.initSource);
207
+ });
208
+ }
209
+ else {
210
+ this.updateDataState(defaultDataState, this.initSource);
211
+ }
212
+ if (settingsKey) {
213
+ this.getDataStateUpdates(this.initSource)
214
+ .pipe(takeUntil(this._ngUnsubscribe))
215
+ .subscribe((state) => {
216
+ this.uiConfigService
217
+ .setConfig(settingsKey, state.getStateOptions())
218
+ .pipe(takeUntil(this._ngUnsubscribe))
219
+ .subscribe(
220
+ // eslint-disable-next-line @typescript-eslint/no-empty-function
221
+ () => { }, (err) => {
222
+ console.warn('Could not save data manager settings.');
223
+ console.warn(err);
224
+ });
225
+ });
226
+ }
227
+ }
228
+ /**
229
+ * Initializes a view within the data manager. This must be called for each view for the views to appear within the data manager.
230
+ * @param viewConfig The SkyDataViewConfig settings for the view being registered.
231
+ */
232
+ initDataView(viewConfig) {
233
+ const currentViews = this.views.value;
234
+ if (this.getViewById(viewConfig.id)) {
235
+ console.warn(`A data manager view with the id ${viewConfig.id} has already been initialized.`);
236
+ return;
237
+ }
238
+ currentViews.push(viewConfig);
239
+ this.views.next(currentViews);
240
+ // When the initial activeViewId is set there are no views registered. We have to re-emit
241
+ // the activeId so the newly registered view is notified that it is active.
242
+ this.activeViewId.pipe(take(1)).subscribe((id) => {
243
+ this.activeViewId.next(id);
244
+ });
245
+ this.dataStateChange
246
+ .pipe(take(1))
247
+ .subscribe((change) => {
248
+ const dataState = change.dataState;
249
+ const currentViewState = dataState.getViewStateById(viewConfig.id);
250
+ if (!currentViewState) {
251
+ const newViewState = new SkyDataViewState({ viewId: viewConfig.id });
252
+ // Ensure that the view state's available columns match with the view config. Also,
253
+ // add columns to the `displayedColumnIds` as long as they are not `initialHide`
254
+ if (viewConfig.columnOptions) {
255
+ const columnIds = viewConfig.columnOptions.map((columnOptions) => {
256
+ return columnOptions.id;
257
+ });
258
+ const displayedColumnIds = viewConfig.columnOptions
259
+ .filter((columnOption) => {
260
+ return !columnOption.initialHide;
261
+ })
262
+ .map((columnOption) => {
263
+ return columnOption.id;
264
+ });
265
+ newViewState.columnIds = columnIds;
266
+ newViewState.displayedColumnIds = displayedColumnIds;
267
+ }
268
+ const newDataState = dataState.addOrUpdateView(viewConfig.id, newViewState);
269
+ this.updateDataState(newDataState, this.initSource);
270
+ }
271
+ else {
272
+ const currentAvailableColumnIds = viewConfig.columnOptions?.map((columnOptions) => {
273
+ return columnOptions.id;
274
+ });
275
+ // Ensure that the view state's available columns match with the view config. Also,
276
+ // add new columns to the `displayedColumnIds` as long as they are not `initialHide`.
277
+ // We only add columns to `displayedColumnsIds` if we had previously tracked
278
+ // `columnIds` to avoid breaking changes.
279
+ if (currentViewState.columnIds.length > 0) {
280
+ let newColumnIds = currentAvailableColumnIds.filter((id) => currentViewState.columnIds.indexOf(id) < 0);
281
+ newColumnIds = newColumnIds.filter((columnId) => {
282
+ return viewConfig.columnOptions.find((columnOption) => columnOption.id === columnId && !columnOption.initialHide);
283
+ });
284
+ // Add the column IDs that now exist to the data manager state both as available
285
+ // and as shown.
286
+ currentViewState.displayedColumnIds =
287
+ currentViewState.displayedColumnIds.concat(newColumnIds);
288
+ }
289
+ // Add the column IDs that now exist to the data manager state both as available
290
+ // and as shown.
291
+ currentViewState.columnIds = currentAvailableColumnIds;
292
+ const newDataState = dataState.addOrUpdateView(viewConfig.id, currentViewState);
293
+ this.updateDataState(newDataState, this.initSource);
294
+ }
295
+ })
296
+ .unsubscribe();
297
+ }
298
+ /**
299
+ * Returns an observable of data state changes that views and other data manager entities can subscribe to.
300
+ * It excludes updates originating from the provided source. This allows subscribers to only respond to
301
+ * changes they did not create and helps prevent infinite loops of updates and responses.
302
+ * @param sourceId The ID of the entity subscribing to data state updates. This can be any value you choose
303
+ * but should be unique within the data manager instance and should also be used when that entity updates the state.
304
+ */
305
+ getDataStateUpdates(sourceId, updateFilter) {
306
+ // filter out events from the provided source and emit just the dataState
307
+ if (updateFilter) {
308
+ return this.dataStateChange.pipe(filter((stateChange) => sourceId !== stateChange.source), map((stateChange) => stateChange.dataState), updateFilter.comparator
309
+ ? distinctUntilChanged(updateFilter.comparator)
310
+ : distinctUntilChanged(this.getDefaultStateComparator(updateFilter.properties)));
311
+ }
312
+ else {
313
+ return this.dataStateChange.pipe(filter((stateChange) => sourceId !== stateChange.source), map((stateChange) => stateChange.dataState));
314
+ }
315
+ }
316
+ /**
317
+ * Updates the data state and emits a new value to entities subscribed to data state changes.
318
+ * @param state The new `SkyDataManagerState` value.
319
+ * @param sourceId The ID of the entity updating the state. This can be any value you choose,
320
+ * but should be unique within the data manager instance and should also be used when that entity
321
+ * subscribes to state changes from `getDataStateUpdates`.
322
+ */
323
+ updateDataState(state, sourceId) {
324
+ const newState = new SkyDataManagerState(state.getStateOptions());
325
+ const newStateChange = new SkyDataManagerStateChange(newState, sourceId);
326
+ this.dataStateChange.next(newStateChange);
327
+ }
328
+ /**
329
+ * Returns the current `SkyDataManagerConfig`.
330
+ */
331
+ getCurrentDataManagerConfig() {
332
+ return this.dataManagerConfig.value;
333
+ }
334
+ /**
335
+ * Returns an observable of data manager config changes that views and other data manager entities can subscribe to.
336
+ */
337
+ getDataManagerConfigUpdates() {
338
+ return this.dataManagerConfig;
339
+ }
340
+ /**
341
+ * Updates the data manager config and emits a new value to entities subscribed to data config changes.
342
+ * @param value The new `SkyDataManagerConfig` value.
343
+ */
344
+ updateDataManagerConfig(value) {
345
+ this.dataManagerConfig.next(value);
346
+ }
347
+ /**
348
+ * Returns an observable of data view config changes that views and other data manager entities can subscribe to.
349
+ */
350
+ getDataViewsUpdates() {
351
+ return this.views;
352
+ }
353
+ /**
354
+ * Returns an observable of the active view ID that views and other data manager entities can subscribe to.
355
+ */
356
+ getActiveViewIdUpdates() {
357
+ return this.activeViewId;
358
+ }
359
+ /**
360
+ * Updates the active view ID. The data manager changes the displayed view.
361
+ * @param id The new active view ID.
362
+ */
363
+ updateActiveViewId(id) {
364
+ this.activeViewId.next(id);
365
+ }
366
+ /**
367
+ * Returns the `SkyDataViewConfig` for the given view ID.
368
+ * @param viewId The ID of the view config to get.
369
+ */
370
+ getViewById(viewId) {
371
+ const currentViews = this.views.value;
372
+ const viewConfig = currentViews.find((view) => view.id === viewId);
373
+ return viewConfig;
374
+ }
375
+ /**
376
+ * Updates the given view config. The registered view with the same ID is updated to the
377
+ * provided config, so include all properties regardless of whether they changed. If the
378
+ * view was not initialized already, no update happens.
379
+ * @param view The new `SkyDataViewConfig` containing all properties.
380
+ */
381
+ updateViewConfig(view) {
382
+ const currentViews = this.views.value;
383
+ const existingViewIndex = currentViews.findIndex((currentView) => currentView.id === view.id);
384
+ if (existingViewIndex === -1) {
385
+ console.error('A view with the id {id} does not exist.', view.id);
386
+ }
387
+ else {
388
+ currentViews[existingViewIndex] = view;
389
+ this.views.next(currentViews);
390
+ }
391
+ }
392
+ /**
393
+ * @internal
394
+ */
395
+ setViewkeeperClasses(viewId, classes) {
396
+ const viewkeeperClasses = this.viewkeeperClasses.value;
397
+ viewkeeperClasses[viewId] = classes;
398
+ this.viewkeeperClasses.next(viewkeeperClasses);
399
+ }
400
+ filterDataStateProperties(state, properties) {
401
+ const stateProperties = state.getStateOptions();
402
+ const filteredStateProperties = {};
403
+ for (const property of properties) {
404
+ /* istanbul ignore else */
405
+ if (Object.prototype.hasOwnProperty.call(stateProperties, property)) {
406
+ filteredStateProperties[property] = stateProperties[property];
407
+ }
408
+ }
409
+ return filteredStateProperties;
410
+ }
411
+ getDefaultStateComparator(properties) {
412
+ return (state1, state2) => {
413
+ const filteredState1 = this.filterDataStateProperties(state1, properties);
414
+ const filteredState2 = this.filterDataStateProperties(state2, properties);
415
+ return JSON.stringify(filteredState1) === JSON.stringify(filteredState2);
416
+ };
417
+ }
418
+ }
419
+ SkyDataManagerService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: SkyDataManagerService, deps: [{ token: i1.SkyUIConfigService }], target: i0.ɵɵFactoryTarget.Injectable });
420
+ SkyDataManagerService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: SkyDataManagerService });
421
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: SkyDataManagerService, decorators: [{
422
+ type: Injectable
423
+ }], ctorParameters: function () { return [{ type: i1.SkyUIConfigService }]; } });
424
+
425
+ var SkyDataManagerColumnPickerSortStrategy;
426
+ (function (SkyDataManagerColumnPickerSortStrategy) {
427
+ SkyDataManagerColumnPickerSortStrategy["None"] = "none";
428
+ SkyDataManagerColumnPickerSortStrategy["SelectedThenAlphabetical"] = "selectedThenAlphabetical";
429
+ })(SkyDataManagerColumnPickerSortStrategy || (SkyDataManagerColumnPickerSortStrategy = {}));
430
+
431
+ class SkyDataManagerColumnPickerContext {
432
+ constructor(columnOptions, displayedColumnIds, columnPickerSortStrategy = SkyDataManagerColumnPickerSortStrategy.SelectedThenAlphabetical) {
433
+ this.columnOptions = columnOptions;
434
+ this.displayedColumnIds = displayedColumnIds;
435
+ this.columnPickerSortStrategy = columnPickerSortStrategy;
436
+ }
437
+ }
438
+
439
+ /**
440
+ * The top-level data manager component. Provide `SkyDataManagerService` at this level.
441
+ */
442
+ class SkyDataManagerComponent {
443
+ constructor(changeDetection, dataManagerService) {
444
+ this.changeDetection = changeDetection;
445
+ this.dataManagerService = dataManagerService;
446
+ this.backToTopController = new Subject();
447
+ this.backToTopOptions = {
448
+ buttonHidden: true,
449
+ };
450
+ this._isInitialized = false;
451
+ this.allViewkeeperClasses = {};
452
+ this.ngUnsubscribe = new Subject();
453
+ this.sourceId = 'dataManagerComponent';
454
+ }
455
+ get currentViewkeeperClasses() {
456
+ const dataManagerClasses = ['.sky-data-manager-toolbar'];
457
+ let allClasses = dataManagerClasses;
458
+ if (this._currentViewkeeperClasses) {
459
+ allClasses = dataManagerClasses.concat(this._currentViewkeeperClasses);
460
+ }
461
+ return allClasses;
462
+ }
463
+ set currentViewkeeperClasses(value) {
464
+ this._currentViewkeeperClasses = value;
465
+ this.changeDetection.markForCheck();
466
+ }
467
+ get isInitialized() {
468
+ return this._isInitialized;
469
+ }
470
+ set isInitialized(value) {
471
+ this._isInitialized = value;
472
+ this.changeDetection.markForCheck();
473
+ }
474
+ ngOnInit() {
475
+ this.dataManagerService
476
+ .getDataStateUpdates(this.sourceId)
477
+ .pipe(takeUntil(this.ngUnsubscribe))
478
+ .subscribe(() => (this.isInitialized = true));
479
+ this.dataManagerService.viewkeeperClasses
480
+ .pipe(takeUntil(this.ngUnsubscribe))
481
+ .subscribe((classes) => {
482
+ this.allViewkeeperClasses = classes;
483
+ this.currentViewkeeperClasses = classes[this.activeViewId];
484
+ });
485
+ this.dataManagerService
486
+ .getActiveViewIdUpdates()
487
+ .pipe(takeUntil(this.ngUnsubscribe))
488
+ .subscribe((activeViewId) => {
489
+ this.activeViewId = activeViewId;
490
+ this.backToTopController.next({
491
+ type: SkyBackToTopMessageType.BackToTop,
492
+ });
493
+ this.currentViewkeeperClasses =
494
+ this.allViewkeeperClasses[this.activeViewId];
495
+ });
496
+ }
497
+ ngOnDestroy() {
498
+ this.ngUnsubscribe.next();
499
+ this.ngUnsubscribe.complete();
500
+ }
501
+ }
502
+ SkyDataManagerComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: SkyDataManagerComponent, deps: [{ token: i0.ChangeDetectorRef }, { token: SkyDataManagerService }], target: i0.ɵɵFactoryTarget.Component });
503
+ SkyDataManagerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.7", type: SkyDataManagerComponent, selector: "sky-data-manager", ngImport: i0, template: "<div\n *ngIf=\"isInitialized\"\n class=\"sky-data-manager\"\n [skyBackToTop]=\"backToTopOptions\"\n [skyBackToTopMessageStream]=\"backToTopController\"\n [skyViewkeeper]=\"currentViewkeeperClasses\"\n #dataManager\n>\n <ng-content></ng-content>\n</div>\n", directives: [{ type: i9.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i4.λ7, selector: "[skyBackToTop]", inputs: ["skyBackToTop", "skyBackToTopMessageStream"] }, { type: i1.λ3, selector: "[skyViewkeeper]", inputs: ["skyViewkeeper"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
504
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: SkyDataManagerComponent, decorators: [{
505
+ type: Component,
506
+ args: [{ selector: 'sky-data-manager', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div\n *ngIf=\"isInitialized\"\n class=\"sky-data-manager\"\n [skyBackToTop]=\"backToTopOptions\"\n [skyBackToTopMessageStream]=\"backToTopController\"\n [skyViewkeeper]=\"currentViewkeeperClasses\"\n #dataManager\n>\n <ng-content></ng-content>\n</div>\n" }]
507
+ }], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }, { type: SkyDataManagerService }]; } });
508
+
509
+ /**
510
+ * Service that provides the column picker component type so it can be dynamically
511
+ * created in the toolbar component. This avoids a circular reference between column
512
+ * picker and toolbar.
513
+ * https://angular.io/errors/NG3003
514
+ */
515
+ class SkyDataManagerColumnPickerService {
516
+ }
517
+ SkyDataManagerColumnPickerService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: SkyDataManagerColumnPickerService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
518
+ SkyDataManagerColumnPickerService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: SkyDataManagerColumnPickerService });
519
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: SkyDataManagerColumnPickerService, decorators: [{
520
+ type: Injectable
521
+ }] });
522
+
523
+ class SkyDataManagerFilterModalContext {
524
+ }
525
+
526
+ /**
527
+ * Renders a `sky-toolbar` with the contents specified by the active view's `SkyDataViewConfig`
528
+ * and the `SkyDataManagerToolbarLeftItemsComponent`, `SkyDataManagerToolbarRightItemsComponent`,
529
+ * and `SkyDataManagerToolbarSectionComponent` wrappers.
530
+ */
531
+ class SkyDataManagerToolbarComponent {
532
+ constructor(changeDetector, dataManagerService, modalService, columnPickerService) {
533
+ this.changeDetector = changeDetector;
534
+ this.dataManagerService = dataManagerService;
535
+ this.modalService = modalService;
536
+ this.columnPickerService = columnPickerService;
537
+ // the source to provide for data state changes
538
+ this._source = 'toolbar';
539
+ this._ngUnsubscribe = new Subject();
540
+ this._views = [];
541
+ }
542
+ get activeSortOptionId() {
543
+ const activeSortOption = this.dataState && this.dataState.activeSortOption;
544
+ return activeSortOption && activeSortOption.id;
545
+ }
546
+ get activeView() {
547
+ return this._activeView;
548
+ }
549
+ set activeView(value) {
550
+ this._activeView = value;
551
+ this.changeDetector.markForCheck();
552
+ }
553
+ get dataManagerConfig() {
554
+ return this._dataManagerConfig;
555
+ }
556
+ set dataManagerConfig(value) {
557
+ this._dataManagerConfig = value;
558
+ this.changeDetector.markForCheck();
559
+ }
560
+ get dataState() {
561
+ return this._dataState;
562
+ }
563
+ set dataState(value) {
564
+ this._dataState = value;
565
+ this.dataManagerService.updateDataState(value, this._source);
566
+ }
567
+ get views() {
568
+ return this._views;
569
+ }
570
+ set views(value) {
571
+ this._views = value;
572
+ this.changeDetector.markForCheck();
573
+ }
574
+ ngOnInit() {
575
+ this.dataManagerService
576
+ .getActiveViewIdUpdates()
577
+ .pipe(takeUntil(this._ngUnsubscribe))
578
+ .subscribe((activeViewId) => {
579
+ /* istanbul ignore else */
580
+ if (activeViewId) {
581
+ this.activeView = this.dataManagerService.getViewById(activeViewId);
582
+ this.changeDetector.markForCheck();
583
+ }
584
+ });
585
+ this.dataManagerService
586
+ .getDataViewsUpdates()
587
+ .pipe(takeUntil(this._ngUnsubscribe))
588
+ .subscribe((views) => {
589
+ this.views = views;
590
+ });
591
+ this.dataManagerService
592
+ .getDataStateUpdates(this._source)
593
+ .pipe(takeUntil(this._ngUnsubscribe))
594
+ .subscribe((dataState) => {
595
+ this._dataState = dataState;
596
+ this.onlyShowSelected = dataState.onlyShowSelected;
597
+ this.changeDetector.markForCheck();
598
+ });
599
+ this.dataManagerService
600
+ .getDataManagerConfigUpdates()
601
+ .pipe(takeUntil(this._ngUnsubscribe))
602
+ .subscribe((config) => {
603
+ this.dataManagerConfig = config;
604
+ });
605
+ }
606
+ ngOnDestroy() {
607
+ this._ngUnsubscribe.next();
608
+ this._ngUnsubscribe.complete();
609
+ }
610
+ sortSelected(sortOption) {
611
+ this.dataState.activeSortOption = sortOption;
612
+ this.dataManagerService.updateDataState(this.dataState, this._source);
613
+ }
614
+ onViewChange(viewId) {
615
+ this.dataManagerService.updateActiveViewId(viewId);
616
+ }
617
+ searchApplied(text) {
618
+ this.dataState.searchText = text;
619
+ this.dataManagerService.updateDataState(this.dataState, this._source);
620
+ }
621
+ filterButtonClicked() {
622
+ const context = new SkyDataManagerFilterModalContext();
623
+ const filterModal = this.dataManagerConfig && this.dataManagerConfig.filterModalComponent;
624
+ context.filterData = this.dataState && this.dataState.filterData;
625
+ const options = {
626
+ providers: [
627
+ { provide: SkyDataManagerFilterModalContext, useValue: context },
628
+ ],
629
+ };
630
+ if (filterModal) {
631
+ const modalInstance = this.modalService.open(filterModal, options);
632
+ modalInstance.closed.subscribe((result) => {
633
+ if (result.reason === 'save') {
634
+ this.dataState.filterData = result.data;
635
+ this.dataManagerService.updateDataState(this.dataState, this._source);
636
+ }
637
+ });
638
+ }
639
+ }
640
+ openColumnPicker() {
641
+ const columnOptions = this.activeView && this.activeView.columnOptions;
642
+ const viewState = this.dataState.getViewStateById(this.activeView.id);
643
+ const context = new SkyDataManagerColumnPickerContext(columnOptions, viewState.displayedColumnIds);
644
+ if (this.activeView.columnPickerSortStrategy) {
645
+ context.columnPickerSortStrategy =
646
+ this.activeView.columnPickerSortStrategy;
647
+ }
648
+ const options = {
649
+ providers: [
650
+ { provide: SkyDataManagerColumnPickerContext, useValue: context },
651
+ ],
652
+ };
653
+ const modalInstance = this.modalService.open(this.columnPickerService.getComponentType(), options);
654
+ modalInstance.closed.subscribe((result) => {
655
+ if (result.reason === 'save') {
656
+ const displayedColumnIds = result.data.map((col) => col.id);
657
+ viewState.displayedColumnIds = displayedColumnIds;
658
+ this.dataState = this.dataState.addOrUpdateView(this.activeView.id, viewState);
659
+ }
660
+ });
661
+ }
662
+ selectAll() {
663
+ /* istanbul ignore else */
664
+ if (this.activeView.onSelectAllClick) {
665
+ this.activeView.onSelectAllClick();
666
+ }
667
+ }
668
+ clearAll() {
669
+ /* istanbul ignore else */
670
+ if (this.activeView.onClearAllClick) {
671
+ this.activeView.onClearAllClick();
672
+ }
673
+ }
674
+ onOnlyShowSelected(event) {
675
+ this.dataState.onlyShowSelected = event.checked;
676
+ this.dataManagerService.updateDataState(this.dataState, this._source);
677
+ }
678
+ }
679
+ SkyDataManagerToolbarComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: SkyDataManagerToolbarComponent, deps: [{ token: i0.ChangeDetectorRef }, { token: SkyDataManagerService }, { token: i3.SkyModalService }, { token: SkyDataManagerColumnPickerService }], target: i0.ɵɵFactoryTarget.Component });
680
+ SkyDataManagerToolbarComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.7", type: SkyDataManagerToolbarComponent, selector: "sky-data-manager-toolbar", ngImport: i0, template: "<div class=\"sky-data-manager-toolbar\">\n <sky-toolbar>\n <sky-toolbar-section>\n <ng-content select=\"sky-data-manager-toolbar-primary-item\"></ng-content>\n\n <sky-toolbar-item *ngIf=\"activeView?.filterButtonEnabled\">\n <sky-filter-button\n [showButtonText]=\"activeView?.showFilterButtonText\"\n (filterButtonClick)=\"filterButtonClicked()\"\n >\n </sky-filter-button>\n </sky-toolbar-item>\n\n <sky-toolbar-item *ngIf=\"activeView?.sortEnabled\">\n <sky-sort [showButtonText]=\"activeView?.showSortButtonText\">\n <sky-sort-item\n *ngFor=\"let item of dataManagerConfig?.sortOptions\"\n [active]=\"activeSortOptionId && activeSortOptionId === item.id\"\n (itemSelect)=\"sortSelected(item)\"\n >\n {{ item.label }}\n </sky-sort-item>\n </sky-sort>\n </sky-toolbar-item>\n\n <sky-toolbar-item *ngIf=\"activeView?.columnPickerEnabled\">\n <button\n class=\"sky-btn sky-btn-default sky-col-picker-btn\"\n type=\"button\"\n [attr.aria-label]=\"\n 'skyux_data_manager_columns_button_title' | skyLibResources\n \"\n [attr.title]=\"\n 'skyux_data_manager_columns_button_title' | skyLibResources\n \"\n (click)=\"openColumnPicker()\"\n >\n <sky-icon icon=\"columns\"></sky-icon>\n <span class=\"sky-column-selector-action-btn-text\">\n {{ 'skyux_data_manager_columns_button_title' | skyLibResources }}\n </span>\n </button>\n </sky-toolbar-item>\n\n <ng-content select=\"sky-data-manager-toolbar-left-item\"></ng-content>\n\n <sky-toolbar-item *ngIf=\"activeView?.searchEnabled\">\n <sky-search\n [expandMode]=\"activeView?.searchExpandMode\"\n [placeholderText]=\"activeView?.searchPlaceholderText\"\n [searchText]=\"dataState?.searchText\"\n (searchApply)=\"searchApplied($event)\"\n >\n </sky-search>\n </sky-toolbar-item>\n\n <sky-toolbar-view-actions>\n <ng-content select=\"sky-data-manager-toolbar-right-item\"></ng-content>\n <sky-radio-group\n *ngIf=\"activeView && views && views.length > 1\"\n [ariaLabel]=\"'data view switcher'\"\n class=\"sky-switch-icon-group\"\n >\n <sky-radio\n *ngFor=\"let view of views\"\n [attr.name]=\"view.name\"\n [attr.aria-label]=\"view.name\"\n [icon]=\"view.icon\"\n [value]=\"view.id\"\n [label]=\"view.name\"\n [(ngModel)]=\"activeView.id\"\n (change)=\"onViewChange(view.id)\"\n >\n </sky-radio>\n </sky-radio-group>\n </sky-toolbar-view-actions>\n </sky-toolbar-section>\n <ng-content select=\"sky-data-manager-toolbar-section\"></ng-content>\n </sky-toolbar>\n\n <sky-toolbar\n *ngIf=\"activeView?.multiselectToolbarEnabled\"\n class=\"sky-data-manager-multiselect-toolbar\"\n >\n <sky-toolbar-section>\n <sky-toolbar-item>\n <button\n class=\"sky-btn sky-btn-link sky-data-manager-select-all-btn\"\n type=\"button\"\n (click)=\"selectAll()\"\n >\n {{ 'skyux_data_manager_select_all_button_title' | skyLibResources }}\n </button>\n </sky-toolbar-item>\n <sky-toolbar-item>\n <button\n class=\"sky-btn sky-btn-link sky-data-manager-clear-all-btn\"\n type=\"button\"\n (click)=\"clearAll()\"\n >\n {{ 'skyux_data_manager_clear_all_button_title' | skyLibResources }}\n </button>\n </sky-toolbar-item>\n <sky-toolbar-view-actions>\n <sky-checkbox\n [checked]=\"onlyShowSelected\"\n (change)=\"onOnlyShowSelected($event)\"\n >\n <sky-checkbox-label>\n {{\n 'skyux_data_manager_show_selected_option_title' | skyLibResources\n }}\n </sky-checkbox-label>\n </sky-checkbox>\n </sky-toolbar-view-actions>\n </sky-toolbar-section>\n </sky-toolbar>\n</div>\n", styles: [":host .sky-col-picker-btn .sky-column-selector-action-btn-text{display:none}:host-context(.sky-responsive-container-xs) .sky-col-picker-btn .sky-column-selector-action-btn-text,:host-context(.sky-responsive-container-sm) .sky-col-picker-btn .sky-column-selector-action-btn-text,:host-context(.sky-responsive-container-md) .sky-col-picker-btn .sky-column-selector-action-btn-text,:host-context(.sky-responsive-container-lg) .sky-col-picker-btn .sky-column-selector-action-btn-text{display:none}@media (min-width: 768px){:host .sky-col-picker-btn .sky-column-selector-action-btn-text{display:inline}}:host-context(.sky-responsive-container-sm) .sky-col-picker-btn .sky-column-selector-action-btn-text,:host-context(.sky-responsive-container-md) .sky-col-picker-btn .sky-column-selector-action-btn-text,:host-context(.sky-responsive-container-lg) .sky-col-picker-btn .sky-column-selector-action-btn-text{display:inline}\n"], components: [{ type: i4.λ37, selector: "sky-toolbar" }, { type: i4.λ38, selector: "sky-toolbar-section" }, { type: i4.λ39, selector: "sky-toolbar-item" }, { type: i8.λ1, selector: "sky-filter-button", inputs: ["filterButtonId", "ariaControls", "ariaExpanded", "active", "disabled", "showButtonText"], outputs: ["filterButtonClick"] }, { type: i8.λ14, selector: "sky-sort", inputs: ["showButtonText"] }, { type: i8.λ13, selector: "sky-sort-item", inputs: ["active"], outputs: ["itemSelect"] }, { type: i6.λ4, selector: "sky-icon", inputs: ["icon", "iconType", "size", "fixedWidth", "variant"] }, { type: i7.SkySearchComponent, selector: "sky-search", inputs: ["searchText", "expandMode", "debounceTime", "disabled", "placeholderText"], outputs: ["searchApply", "searchChange", "searchClear"] }, { type: i4.λ40, selector: "sky-toolbar-view-actions" }, { type: i8$1.λ11, selector: "sky-radio-group", inputs: ["ariaLabelledBy", "ariaLabel", "disabled", "name", "required", "value", "tabIndex"] }, { type: i8$1.λ13, selector: "sky-radio", inputs: ["checked", "disabled", "id", "label", "labelledBy", "name", "tabindex", "value", "icon", "radioType"], outputs: ["change", "checkedChange", "disabledChange"] }, { type: i8$1.λ3, selector: "sky-checkbox", inputs: ["label", "labelledBy", "id", "disabled", "tabindex", "name", "icon", "checkboxType", "checked", "required"], outputs: ["change", "checkedChange", "disabledChange"] }, { type: i8$1.λ4, selector: "sky-checkbox-label" }], directives: [{ type: i9.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i9.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i10.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i10.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }], pipes: { "skyLibResources": i4$1.SkyLibResourcesPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
681
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: SkyDataManagerToolbarComponent, decorators: [{
682
+ type: Component,
683
+ args: [{ selector: 'sky-data-manager-toolbar', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"sky-data-manager-toolbar\">\n <sky-toolbar>\n <sky-toolbar-section>\n <ng-content select=\"sky-data-manager-toolbar-primary-item\"></ng-content>\n\n <sky-toolbar-item *ngIf=\"activeView?.filterButtonEnabled\">\n <sky-filter-button\n [showButtonText]=\"activeView?.showFilterButtonText\"\n (filterButtonClick)=\"filterButtonClicked()\"\n >\n </sky-filter-button>\n </sky-toolbar-item>\n\n <sky-toolbar-item *ngIf=\"activeView?.sortEnabled\">\n <sky-sort [showButtonText]=\"activeView?.showSortButtonText\">\n <sky-sort-item\n *ngFor=\"let item of dataManagerConfig?.sortOptions\"\n [active]=\"activeSortOptionId && activeSortOptionId === item.id\"\n (itemSelect)=\"sortSelected(item)\"\n >\n {{ item.label }}\n </sky-sort-item>\n </sky-sort>\n </sky-toolbar-item>\n\n <sky-toolbar-item *ngIf=\"activeView?.columnPickerEnabled\">\n <button\n class=\"sky-btn sky-btn-default sky-col-picker-btn\"\n type=\"button\"\n [attr.aria-label]=\"\n 'skyux_data_manager_columns_button_title' | skyLibResources\n \"\n [attr.title]=\"\n 'skyux_data_manager_columns_button_title' | skyLibResources\n \"\n (click)=\"openColumnPicker()\"\n >\n <sky-icon icon=\"columns\"></sky-icon>\n <span class=\"sky-column-selector-action-btn-text\">\n {{ 'skyux_data_manager_columns_button_title' | skyLibResources }}\n </span>\n </button>\n </sky-toolbar-item>\n\n <ng-content select=\"sky-data-manager-toolbar-left-item\"></ng-content>\n\n <sky-toolbar-item *ngIf=\"activeView?.searchEnabled\">\n <sky-search\n [expandMode]=\"activeView?.searchExpandMode\"\n [placeholderText]=\"activeView?.searchPlaceholderText\"\n [searchText]=\"dataState?.searchText\"\n (searchApply)=\"searchApplied($event)\"\n >\n </sky-search>\n </sky-toolbar-item>\n\n <sky-toolbar-view-actions>\n <ng-content select=\"sky-data-manager-toolbar-right-item\"></ng-content>\n <sky-radio-group\n *ngIf=\"activeView && views && views.length > 1\"\n [ariaLabel]=\"'data view switcher'\"\n class=\"sky-switch-icon-group\"\n >\n <sky-radio\n *ngFor=\"let view of views\"\n [attr.name]=\"view.name\"\n [attr.aria-label]=\"view.name\"\n [icon]=\"view.icon\"\n [value]=\"view.id\"\n [label]=\"view.name\"\n [(ngModel)]=\"activeView.id\"\n (change)=\"onViewChange(view.id)\"\n >\n </sky-radio>\n </sky-radio-group>\n </sky-toolbar-view-actions>\n </sky-toolbar-section>\n <ng-content select=\"sky-data-manager-toolbar-section\"></ng-content>\n </sky-toolbar>\n\n <sky-toolbar\n *ngIf=\"activeView?.multiselectToolbarEnabled\"\n class=\"sky-data-manager-multiselect-toolbar\"\n >\n <sky-toolbar-section>\n <sky-toolbar-item>\n <button\n class=\"sky-btn sky-btn-link sky-data-manager-select-all-btn\"\n type=\"button\"\n (click)=\"selectAll()\"\n >\n {{ 'skyux_data_manager_select_all_button_title' | skyLibResources }}\n </button>\n </sky-toolbar-item>\n <sky-toolbar-item>\n <button\n class=\"sky-btn sky-btn-link sky-data-manager-clear-all-btn\"\n type=\"button\"\n (click)=\"clearAll()\"\n >\n {{ 'skyux_data_manager_clear_all_button_title' | skyLibResources }}\n </button>\n </sky-toolbar-item>\n <sky-toolbar-view-actions>\n <sky-checkbox\n [checked]=\"onlyShowSelected\"\n (change)=\"onOnlyShowSelected($event)\"\n >\n <sky-checkbox-label>\n {{\n 'skyux_data_manager_show_selected_option_title' | skyLibResources\n }}\n </sky-checkbox-label>\n </sky-checkbox>\n </sky-toolbar-view-actions>\n </sky-toolbar-section>\n </sky-toolbar>\n</div>\n", styles: [":host .sky-col-picker-btn .sky-column-selector-action-btn-text{display:none}:host-context(.sky-responsive-container-xs) .sky-col-picker-btn .sky-column-selector-action-btn-text,:host-context(.sky-responsive-container-sm) .sky-col-picker-btn .sky-column-selector-action-btn-text,:host-context(.sky-responsive-container-md) .sky-col-picker-btn .sky-column-selector-action-btn-text,:host-context(.sky-responsive-container-lg) .sky-col-picker-btn .sky-column-selector-action-btn-text{display:none}@media (min-width: 768px){:host .sky-col-picker-btn .sky-column-selector-action-btn-text{display:inline}}:host-context(.sky-responsive-container-sm) .sky-col-picker-btn .sky-column-selector-action-btn-text,:host-context(.sky-responsive-container-md) .sky-col-picker-btn .sky-column-selector-action-btn-text,:host-context(.sky-responsive-container-lg) .sky-col-picker-btn .sky-column-selector-action-btn-text{display:inline}\n"] }]
684
+ }], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }, { type: SkyDataManagerService }, { type: i3.SkyModalService }, { type: SkyDataManagerColumnPickerService }]; } });
685
+
686
+ /**
687
+ * A data view is rendered within a data manager component.
688
+ * It can subscribe to data state changes from `SkyDataManagerService` and apply the filters,
689
+ * search text, and more to the data it displays.
690
+ */
691
+ class SkyDataViewComponent {
692
+ constructor(changeDetector, dataManagerService) {
693
+ this.changeDetector = changeDetector;
694
+ this.dataManagerService = dataManagerService;
695
+ this._isActive = false;
696
+ this._ngUnsubscribe = new Subject();
697
+ }
698
+ get isActive() {
699
+ return this._isActive;
700
+ }
701
+ set isActive(value) {
702
+ this._isActive = value;
703
+ this.changeDetector.markForCheck();
704
+ }
705
+ ngOnInit() {
706
+ this.dataManagerService
707
+ .getActiveViewIdUpdates()
708
+ .pipe(takeUntil(this._ngUnsubscribe))
709
+ .subscribe((activeViewId) => {
710
+ this.isActive = this.viewId === activeViewId;
711
+ });
712
+ }
713
+ ngOnDestroy() {
714
+ this._ngUnsubscribe.next();
715
+ this._ngUnsubscribe.complete();
716
+ }
717
+ }
718
+ SkyDataViewComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: SkyDataViewComponent, deps: [{ token: i0.ChangeDetectorRef }, { token: SkyDataManagerService }], target: i0.ɵɵFactoryTarget.Component });
719
+ SkyDataViewComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.7", type: SkyDataViewComponent, selector: "sky-data-view", inputs: { viewId: "viewId" }, ngImport: i0, template: "<ng-container *ngIf=\"isActive\">\n <ng-content></ng-content>\n</ng-container>\n", directives: [{ type: i9.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
720
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: SkyDataViewComponent, decorators: [{
721
+ type: Component,
722
+ args: [{ selector: 'sky-data-view', changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-container *ngIf=\"isActive\">\n <ng-content></ng-content>\n</ng-container>\n" }]
723
+ }], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }, { type: SkyDataManagerService }]; }, propDecorators: { viewId: [{
724
+ type: Input
725
+ }] } });
726
+
727
+ /**
728
+ * @internal
729
+ */
730
+ class SkyDataManagerColumnPickerComponent {
731
+ constructor(context, dataManagerService, instance, libResources) {
732
+ this.context = context;
733
+ this.dataManagerService = dataManagerService;
734
+ this.instance = instance;
735
+ this.libResources = libResources;
736
+ this.title = 'Choose columns to show in the list';
737
+ this.viewConfig = {
738
+ id: 'columnPicker',
739
+ name: 'Column Picker',
740
+ searchEnabled: true,
741
+ searchExpandMode: 'fit',
742
+ multiselectToolbarEnabled: true,
743
+ onSelectAllClick: this.selectAll.bind(this),
744
+ onClearAllClick: this.clearAll.bind(this),
745
+ };
746
+ this._dataState = new SkyDataManagerState({});
747
+ this._ngUnsubscribe = new Subject();
748
+ }
749
+ get dataState() {
750
+ return this._dataState;
751
+ }
752
+ set dataState(value) {
753
+ this._dataState = value;
754
+ this.displayedColumnData = this.searchColumns(this.columnData.filter((col) => !col.alwaysDisplayed));
755
+ if (value.onlyShowSelected) {
756
+ this.displayedColumnData = this.displayedColumnData.filter((col) => col.isSelected);
757
+ }
758
+ }
759
+ ngOnInit() {
760
+ this.libResources
761
+ .getString('skyux_data_manager_column_picker_title')
762
+ .subscribe((value) => {
763
+ console.log(value);
764
+ });
765
+ this.dataManagerService.initDataManager({
766
+ activeViewId: this.viewConfig.id,
767
+ dataManagerConfig: {},
768
+ defaultDataState: this.dataState,
769
+ });
770
+ this.dataManagerService.initDataView(this.viewConfig);
771
+ this.columnData = this.formatColumnOptions();
772
+ this.dataManagerService
773
+ .getDataStateUpdates('columnPicker')
774
+ .pipe(takeUntil(this._ngUnsubscribe))
775
+ .subscribe((state) => {
776
+ this.dataState = state;
777
+ });
778
+ }
779
+ ngOnDestroy() {
780
+ this._ngUnsubscribe.next();
781
+ this._ngUnsubscribe.complete();
782
+ }
783
+ searchColumns(columns) {
784
+ let searchedColumns = columns;
785
+ const searchText = this.dataState && this.dataState.searchText?.toUpperCase();
786
+ if (searchText) {
787
+ searchedColumns = columns.filter(function (item) {
788
+ let property;
789
+ for (property in item) {
790
+ if (Object.prototype.hasOwnProperty.call(item, property) &&
791
+ (property === 'label' || property === 'description')) {
792
+ const propertyText = item[property] && item[property].toUpperCase();
793
+ if (propertyText && propertyText.indexOf(searchText) > -1) {
794
+ return true;
795
+ }
796
+ }
797
+ }
798
+ return false;
799
+ });
800
+ }
801
+ return searchedColumns;
802
+ }
803
+ selectAll() {
804
+ this.displayedColumnData.forEach((column) => (column.isSelected = true));
805
+ }
806
+ clearAll() {
807
+ this.displayedColumnData.forEach((column) => (column.isSelected = false));
808
+ }
809
+ cancelChanges() {
810
+ this.instance.cancel();
811
+ }
812
+ isSelected(id) {
813
+ return (this.context.displayedColumnIds.findIndex((colId) => colId === id) !== -1);
814
+ }
815
+ applyChanges() {
816
+ this.instance.save(this.columnData.filter((col) => col.isSelected || col.alwaysDisplayed));
817
+ }
818
+ formatColumnOptions() {
819
+ const allColumnOptions = this.context.columnOptions;
820
+ const visibleColumnIds = this.context.displayedColumnIds;
821
+ let formattedColumnOptions = [];
822
+ const unselectedColumnOptions = [];
823
+ for (const columnOption of allColumnOptions) {
824
+ // format the column with the properties the column picker needs
825
+ const colIndex = visibleColumnIds.indexOf(columnOption.id);
826
+ const formattedColumn = {
827
+ alwaysDisplayed: columnOption.alwaysDisplayed,
828
+ id: columnOption.id,
829
+ label: columnOption.label,
830
+ description: columnOption.description,
831
+ isSelected: colIndex !== -1,
832
+ };
833
+ // if column picker sorting is currently enabled sort columns by order displayed then alphabetical
834
+ // else display column in order they were specified in the columnOptions
835
+ if (this.context.columnPickerSortStrategy ===
836
+ SkyDataManagerColumnPickerSortStrategy.SelectedThenAlphabetical) {
837
+ if (formattedColumn.isSelected) {
838
+ formattedColumnOptions[colIndex] = formattedColumn;
839
+ }
840
+ else {
841
+ unselectedColumnOptions.push(formattedColumn);
842
+ }
843
+ }
844
+ else {
845
+ formattedColumnOptions.push(formattedColumn);
846
+ }
847
+ }
848
+ // if column picker sorting is enabled, sort the columns that are not currently displayed
849
+ // and add them after the currently displayed options
850
+ if (this.context.columnPickerSortStrategy ===
851
+ SkyDataManagerColumnPickerSortStrategy.SelectedThenAlphabetical) {
852
+ unselectedColumnOptions.sort((col1, col2) => col1.label.localeCompare(col2.label));
853
+ formattedColumnOptions = formattedColumnOptions.concat(unselectedColumnOptions);
854
+ }
855
+ return formattedColumnOptions;
856
+ }
857
+ }
858
+ SkyDataManagerColumnPickerComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: SkyDataManagerColumnPickerComponent, deps: [{ token: SkyDataManagerColumnPickerContext }, { token: SkyDataManagerService }, { token: i3.SkyModalInstance }, { token: i4$1.SkyLibResourcesService }], target: i0.ɵɵFactoryTarget.Component });
859
+ SkyDataManagerColumnPickerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.7", type: SkyDataManagerColumnPickerComponent, selector: "sky-data-manager-column-picker", providers: [SkyDataManagerService], ngImport: i0, template: "<sky-modal>\n <sky-modal-header>\n {{ 'skyux_data_manager_column_picker_title' | skyLibResources }}\n </sky-modal-header>\n <sky-modal-content class=\"sky-data-manager-column-picker-content\">\n <sky-data-manager>\n <sky-data-manager-toolbar> </sky-data-manager-toolbar>\n\n <sky-data-view [viewId]=\"viewConfig.id\">\n <sky-repeater expandMode=\"none\">\n <sky-repeater-item\n *ngFor=\"let column of displayedColumnData\"\n [selectable]=\"true\"\n [(isSelected)]=\"column.isSelected\"\n >\n <sky-repeater-item-title>\n {{ column.label }}\n </sky-repeater-item-title>\n <sky-repeater-item-content>\n {{ column.description }}\n </sky-repeater-item-content>\n </sky-repeater-item>\n </sky-repeater>\n </sky-data-view>\n </sky-data-manager>\n </sky-modal-content>\n <sky-modal-footer>\n <button\n sky-cmp-id=\"apply-changes\"\n class=\"sky-btn sky-btn-primary\"\n (click)=\"applyChanges()\"\n >\n {{ 'skyux_data_manager_apply_changes_button_title' | skyLibResources }}\n </button>\n <button\n sky-cmp-id=\"cancel\"\n class=\"sky-btn sky-btn-link\"\n (click)=\"cancelChanges()\"\n >\n {{ 'skyux_data_manager_cancel_button_title' | skyLibResources }}\n </button>\n </sky-modal-footer>\n</sky-modal>\n", styles: [".sky-data-manager-column-picker-content sky-repeater-item-content{margin-top:5px}\n"], components: [{ type: i3.λ5, selector: "sky-modal", inputs: ["ariaRole", "tiledBody"] }, { type: i3.λ4, selector: "sky-modal-header" }, { type: i3.λ2, selector: "sky-modal-content" }, { type: SkyDataManagerComponent, selector: "sky-data-manager" }, { type: SkyDataManagerToolbarComponent, selector: "sky-data-manager-toolbar" }, { type: SkyDataViewComponent, selector: "sky-data-view", inputs: ["viewId"] }, { type: i8.λ11, selector: "sky-repeater", inputs: ["activeIndex", "ariaLabel", "reorderable", "expandMode"], outputs: ["activeIndexChange", "orderChange"] }, { type: i8.λ10, selector: "sky-repeater-item", inputs: ["itemName", "inlineFormConfig", "inlineFormTemplate", "isExpanded", "isSelected", "reorderable", "selectable", "showInlineForm", "tag"], outputs: ["collapse", "expand", "inlineFormClose", "isSelectedChange"] }, { type: i8.λ12, selector: "sky-repeater-item-title" }, { type: i8.λ8, selector: "sky-repeater-item-content" }, { type: i3.λ3, selector: "sky-modal-footer" }], directives: [{ type: i9.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }], pipes: { "skyLibResources": i4$1.SkyLibResourcesPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
860
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: SkyDataManagerColumnPickerComponent, decorators: [{
861
+ type: Component,
862
+ args: [{ selector: 'sky-data-manager-column-picker', providers: [SkyDataManagerService], changeDetection: ChangeDetectionStrategy.OnPush, template: "<sky-modal>\n <sky-modal-header>\n {{ 'skyux_data_manager_column_picker_title' | skyLibResources }}\n </sky-modal-header>\n <sky-modal-content class=\"sky-data-manager-column-picker-content\">\n <sky-data-manager>\n <sky-data-manager-toolbar> </sky-data-manager-toolbar>\n\n <sky-data-view [viewId]=\"viewConfig.id\">\n <sky-repeater expandMode=\"none\">\n <sky-repeater-item\n *ngFor=\"let column of displayedColumnData\"\n [selectable]=\"true\"\n [(isSelected)]=\"column.isSelected\"\n >\n <sky-repeater-item-title>\n {{ column.label }}\n </sky-repeater-item-title>\n <sky-repeater-item-content>\n {{ column.description }}\n </sky-repeater-item-content>\n </sky-repeater-item>\n </sky-repeater>\n </sky-data-view>\n </sky-data-manager>\n </sky-modal-content>\n <sky-modal-footer>\n <button\n sky-cmp-id=\"apply-changes\"\n class=\"sky-btn sky-btn-primary\"\n (click)=\"applyChanges()\"\n >\n {{ 'skyux_data_manager_apply_changes_button_title' | skyLibResources }}\n </button>\n <button\n sky-cmp-id=\"cancel\"\n class=\"sky-btn sky-btn-link\"\n (click)=\"cancelChanges()\"\n >\n {{ 'skyux_data_manager_cancel_button_title' | skyLibResources }}\n </button>\n </sky-modal-footer>\n</sky-modal>\n", styles: [".sky-data-manager-column-picker-content sky-repeater-item-content{margin-top:5px}\n"] }]
863
+ }], ctorParameters: function () { return [{ type: SkyDataManagerColumnPickerContext }, { type: SkyDataManagerService }, { type: i3.SkyModalInstance }, { type: i4$1.SkyLibResourcesService }]; } });
864
+
865
+ class SkyDataManagerColumnPickerImplService {
866
+ getComponentType() {
867
+ return SkyDataManagerColumnPickerComponent;
868
+ }
869
+ }
870
+ SkyDataManagerColumnPickerImplService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: SkyDataManagerColumnPickerImplService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
871
+ SkyDataManagerColumnPickerImplService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: SkyDataManagerColumnPickerImplService });
872
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: SkyDataManagerColumnPickerImplService, decorators: [{
873
+ type: Injectable
874
+ }] });
875
+
876
+ /**
877
+ * A wrapper for an item to be rendered in `SkyDataManagerToolbarComponent`. The contents are
878
+ * rendered after the standard toolbar actions and before the search box. Each item should be
879
+ * wrapped in its own `sky-data-manager-toolbar-left-item`. The items render in the order they are in in the template.
880
+ */
881
+ class SkyDataManagerToolbarLeftItemComponent {
882
+ }
883
+ SkyDataManagerToolbarLeftItemComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: SkyDataManagerToolbarLeftItemComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
884
+ SkyDataManagerToolbarLeftItemComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.7", type: SkyDataManagerToolbarLeftItemComponent, selector: "sky-data-manager-toolbar-left-item", ngImport: i0, template: "<sky-toolbar-item>\n <ng-content></ng-content>\n</sky-toolbar-item>\n", components: [{ type: i4.λ39, selector: "sky-toolbar-item" }] });
885
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: SkyDataManagerToolbarLeftItemComponent, decorators: [{
886
+ type: Component,
887
+ args: [{ selector: 'sky-data-manager-toolbar-left-item', template: "<sky-toolbar-item>\n <ng-content></ng-content>\n</sky-toolbar-item>\n" }]
888
+ }] });
889
+
890
+ /**
891
+ * A wrapper for an item to be rendered in `SkyDataManagerToolbarComponent`. The contents are
892
+ * rendered as the first items in the toolbar and should be standard actions. Each item should be
893
+ * wrapped in its own `sky-data-manager-toolbar-primary-item`. The items render in the order they are in in the template.
894
+ */
895
+ class SkyDataManagerToolbarPrimaryItemComponent {
896
+ }
897
+ SkyDataManagerToolbarPrimaryItemComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: SkyDataManagerToolbarPrimaryItemComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
898
+ SkyDataManagerToolbarPrimaryItemComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.7", type: SkyDataManagerToolbarPrimaryItemComponent, selector: "sky-data-manager-toolbar-primary-item", ngImport: i0, template: "<sky-toolbar-item>\n <ng-content></ng-content>\n</sky-toolbar-item>\n", components: [{ type: i4.λ39, selector: "sky-toolbar-item" }] });
899
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: SkyDataManagerToolbarPrimaryItemComponent, decorators: [{
900
+ type: Component,
901
+ args: [{ selector: 'sky-data-manager-toolbar-primary-item', template: "<sky-toolbar-item>\n <ng-content></ng-content>\n</sky-toolbar-item>\n" }]
902
+ }] });
903
+
904
+ /**
905
+ * A wrapper for an item to be rendered in `SkyDataManagerToolbarComponent`. The contents are
906
+ * rendered in `sky-toolbar-view-actions` on the right side of the toolbar and before the view
907
+ * switcher icons (if present). Each item should be wrapped in its own
908
+ * `sky-data-manager-toolbar-right-item`. The items render in the order they are in in the template.
909
+ */
910
+ class SkyDataManagerToolbarRightItemComponent {
911
+ }
912
+ SkyDataManagerToolbarRightItemComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: SkyDataManagerToolbarRightItemComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
913
+ SkyDataManagerToolbarRightItemComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.7", type: SkyDataManagerToolbarRightItemComponent, selector: "sky-data-manager-toolbar-right-item", ngImport: i0, template: "<ng-content></ng-content>\n" });
914
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: SkyDataManagerToolbarRightItemComponent, decorators: [{
915
+ type: Component,
916
+ args: [{ selector: 'sky-data-manager-toolbar-right-item', template: "<ng-content></ng-content>\n" }]
917
+ }] });
918
+
919
+ /**
920
+ * A wrapper for items to be rendered in `SkyDataManagerToolbarComponent`. The contents are
921
+ * rendered in an additional toolbar row beneath the primary toolbar and above the multiselect
922
+ * toolbar (if present).
923
+ */
924
+ class SkyDataManagerToolbarSectionComponent {
925
+ }
926
+ SkyDataManagerToolbarSectionComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: SkyDataManagerToolbarSectionComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
927
+ SkyDataManagerToolbarSectionComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.7", type: SkyDataManagerToolbarSectionComponent, selector: "sky-data-manager-toolbar-section", ngImport: i0, template: "<sky-toolbar-section>\n <ng-content></ng-content>\n</sky-toolbar-section>\n", components: [{ type: i4.λ38, selector: "sky-toolbar-section" }] });
928
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: SkyDataManagerToolbarSectionComponent, decorators: [{
929
+ type: Component,
930
+ args: [{ selector: 'sky-data-manager-toolbar-section', template: "<sky-toolbar-section>\n <ng-content></ng-content>\n</sky-toolbar-section>\n" }]
931
+ }] });
932
+
933
+ class SkyDataManagerModule {
934
+ }
935
+ SkyDataManagerModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: SkyDataManagerModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
936
+ SkyDataManagerModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: SkyDataManagerModule, declarations: [SkyDataManagerColumnPickerComponent,
937
+ SkyDataManagerComponent,
938
+ SkyDataManagerToolbarLeftItemComponent,
939
+ SkyDataManagerToolbarPrimaryItemComponent,
940
+ SkyDataManagerToolbarRightItemComponent,
941
+ SkyDataManagerToolbarSectionComponent,
942
+ SkyDataManagerToolbarComponent,
943
+ SkyDataViewComponent], imports: [CommonModule,
944
+ FormsModule,
945
+ SkyBackToTopModule,
946
+ SkyCheckboxModule,
947
+ SkyDataManagerResourcesModule,
948
+ SkyFilterModule,
949
+ SkyIconModule,
950
+ SkyModalModule,
951
+ SkyRadioModule,
952
+ SkyRepeaterModule,
953
+ SkySearchModule,
954
+ SkySortModule,
955
+ SkyToolbarModule,
956
+ SkyViewkeeperModule], exports: [SkyDataManagerColumnPickerComponent,
957
+ SkyDataManagerComponent,
958
+ SkyDataManagerToolbarLeftItemComponent,
959
+ SkyDataManagerToolbarPrimaryItemComponent,
960
+ SkyDataManagerToolbarRightItemComponent,
961
+ SkyDataManagerToolbarSectionComponent,
962
+ SkyDataManagerToolbarComponent,
963
+ SkyDataViewComponent] });
964
+ SkyDataManagerModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: SkyDataManagerModule, providers: [
965
+ {
966
+ provide: SkyDataManagerColumnPickerService,
967
+ useClass: SkyDataManagerColumnPickerImplService,
968
+ },
969
+ ], imports: [[
970
+ CommonModule,
971
+ FormsModule,
972
+ SkyBackToTopModule,
973
+ SkyCheckboxModule,
974
+ SkyDataManagerResourcesModule,
975
+ SkyFilterModule,
976
+ SkyIconModule,
977
+ SkyModalModule,
978
+ SkyRadioModule,
979
+ SkyRepeaterModule,
980
+ SkySearchModule,
981
+ SkySortModule,
982
+ SkyToolbarModule,
983
+ SkyViewkeeperModule,
984
+ ]] });
985
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.7", ngImport: i0, type: SkyDataManagerModule, decorators: [{
986
+ type: NgModule,
987
+ args: [{
988
+ declarations: [
989
+ SkyDataManagerColumnPickerComponent,
990
+ SkyDataManagerComponent,
991
+ SkyDataManagerToolbarLeftItemComponent,
992
+ SkyDataManagerToolbarPrimaryItemComponent,
993
+ SkyDataManagerToolbarRightItemComponent,
994
+ SkyDataManagerToolbarSectionComponent,
995
+ SkyDataManagerToolbarComponent,
996
+ SkyDataViewComponent,
997
+ ],
998
+ imports: [
999
+ CommonModule,
1000
+ FormsModule,
1001
+ SkyBackToTopModule,
1002
+ SkyCheckboxModule,
1003
+ SkyDataManagerResourcesModule,
1004
+ SkyFilterModule,
1005
+ SkyIconModule,
1006
+ SkyModalModule,
1007
+ SkyRadioModule,
1008
+ SkyRepeaterModule,
1009
+ SkySearchModule,
1010
+ SkySortModule,
1011
+ SkyToolbarModule,
1012
+ SkyViewkeeperModule,
1013
+ ],
1014
+ exports: [
1015
+ SkyDataManagerColumnPickerComponent,
1016
+ SkyDataManagerComponent,
1017
+ SkyDataManagerToolbarLeftItemComponent,
1018
+ SkyDataManagerToolbarPrimaryItemComponent,
1019
+ SkyDataManagerToolbarRightItemComponent,
1020
+ SkyDataManagerToolbarSectionComponent,
1021
+ SkyDataManagerToolbarComponent,
1022
+ SkyDataViewComponent,
1023
+ ],
1024
+ providers: [
1025
+ {
1026
+ provide: SkyDataManagerColumnPickerService,
1027
+ useClass: SkyDataManagerColumnPickerImplService,
1028
+ },
1029
+ ],
1030
+ }]
1031
+ }] });
1032
+
1033
+ /**
1034
+ * Generated bundle index. Do not edit.
1035
+ */
1036
+
1037
+ export { SkyDataManagerColumnPickerSortStrategy, SkyDataManagerFilterModalContext, SkyDataManagerModule, SkyDataManagerService, SkyDataManagerState, SkyDataViewState, SkyDataManagerColumnPickerComponent as λ1, SkyDataManagerComponent as λ2, SkyDataManagerToolbarLeftItemComponent as λ3, SkyDataManagerToolbarPrimaryItemComponent as λ4, SkyDataManagerToolbarRightItemComponent as λ5, SkyDataManagerToolbarSectionComponent as λ6, SkyDataManagerToolbarComponent as λ7, SkyDataViewComponent as λ8 };
1038
+ //# sourceMappingURL=skyux-data-manager.mjs.map