@skyux/data-manager 8.6.0 → 9.0.0-alpha.0

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