@skyux/data-manager 7.0.0-beta.11 → 7.0.0-beta.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/documentation.json +473 -584
- package/esm2020/lib/modules/data-manager/data-manager-column-picker/data-manager-column-picker.component.mjs +51 -45
- package/esm2020/lib/modules/data-manager/data-manager-filter-context.mjs +2 -1
- package/esm2020/lib/modules/data-manager/data-manager-toolbar/data-manager-toolbar.component.mjs +95 -76
- package/esm2020/lib/modules/data-manager/data-manager.component.mjs +39 -31
- package/esm2020/lib/modules/data-manager/data-manager.service.mjs +66 -61
- package/esm2020/lib/modules/data-manager/data-view.component.mjs +18 -21
- package/esm2020/lib/modules/data-manager/models/data-manager-config.mjs +1 -1
- package/esm2020/lib/modules/data-manager/models/data-manager-filter-data.mjs +1 -1
- package/esm2020/lib/modules/data-manager/models/data-manager-state-options.mjs +1 -1
- package/esm2020/lib/modules/data-manager/models/data-manager-state.mjs +1 -1
- package/esm2020/lib/modules/data-manager/models/data-view-state-options.mjs +1 -1
- package/esm2020/lib/modules/data-manager/models/data-view-state.mjs +1 -1
- package/fesm2015/skyux-data-manager.mjs +265 -228
- package/fesm2015/skyux-data-manager.mjs.map +1 -1
- package/fesm2020/skyux-data-manager.mjs +259 -227
- package/fesm2020/skyux-data-manager.mjs.map +1 -1
- package/lib/modules/data-manager/data-manager-column-picker/data-manager-column-picker.component.d.ts +1 -3
- package/lib/modules/data-manager/data-manager-filter-context.d.ts +1 -1
- package/lib/modules/data-manager/data-manager-toolbar/data-manager-toolbar.component.d.ts +8 -18
- package/lib/modules/data-manager/data-manager.component.d.ts +2 -9
- package/lib/modules/data-manager/data-manager.service.d.ts +3 -14
- package/lib/modules/data-manager/data-view.component.d.ts +6 -10
- package/lib/modules/data-manager/models/data-manager-state.d.ts +6 -6
- package/package.json +9 -9
@@ -20,6 +20,7 @@ import * as i3 from '@skyux/modals';
|
|
20
20
|
import { SkyModalModule } from '@skyux/modals';
|
21
21
|
import * as i11 from '@skyux/i18n';
|
22
22
|
import { getLibStringForLocale, SkyI18nModule, SKY_LIB_RESOURCES_PROVIDERS } from '@skyux/i18n';
|
23
|
+
import { __classPrivateFieldSet, __classPrivateFieldGet } from 'tslib';
|
23
24
|
import { BehaviorSubject, ReplaySubject, Subject } from 'rxjs';
|
24
25
|
import { take, takeUntil, filter, map, distinctUntilChanged } from 'rxjs/operators';
|
25
26
|
|
@@ -191,6 +192,7 @@ class SkyDataManagerStateChange {
|
|
191
192
|
}
|
192
193
|
}
|
193
194
|
|
195
|
+
var _SkyDataManagerService_instances, _SkyDataManagerService_activeViewId, _SkyDataManagerService_dataManagerConfig, _SkyDataManagerService_views, _SkyDataManagerService_dataStateChange, _SkyDataManagerService_isInitialized, _SkyDataManagerService_ngUnsubscribe, _SkyDataManagerService_initSource, _SkyDataManagerService_uiConfigService, _SkyDataManagerService_filterDataStateProperties, _SkyDataManagerService_getDefaultStateComparator;
|
194
196
|
/**
|
195
197
|
* The data manager service provides ways for data views, toolbar items, and more to stay up to date
|
196
198
|
* with the active view ID, data manager config, registered views and their configs, and data state.
|
@@ -201,23 +203,25 @@ class SkyDataManagerStateChange {
|
|
201
203
|
*/
|
202
204
|
class SkyDataManagerService {
|
203
205
|
constructor(uiConfigService) {
|
204
|
-
this
|
206
|
+
_SkyDataManagerService_instances.add(this);
|
205
207
|
this.viewkeeperClasses = new BehaviorSubject({});
|
206
|
-
this
|
207
|
-
this
|
208
|
-
this
|
209
|
-
this
|
210
|
-
this
|
211
|
-
this
|
212
|
-
this
|
208
|
+
_SkyDataManagerService_activeViewId.set(this, new ReplaySubject(1));
|
209
|
+
_SkyDataManagerService_dataManagerConfig.set(this, new BehaviorSubject({}));
|
210
|
+
_SkyDataManagerService_views.set(this, new BehaviorSubject([]));
|
211
|
+
_SkyDataManagerService_dataStateChange.set(this, new ReplaySubject(1));
|
212
|
+
_SkyDataManagerService_isInitialized.set(this, void 0);
|
213
|
+
_SkyDataManagerService_ngUnsubscribe.set(this, new Subject());
|
214
|
+
_SkyDataManagerService_initSource.set(this, 'dataManagerServiceInit');
|
215
|
+
_SkyDataManagerService_uiConfigService.set(this, void 0);
|
216
|
+
__classPrivateFieldSet(this, _SkyDataManagerService_uiConfigService, uiConfigService, "f");
|
213
217
|
}
|
214
218
|
ngOnDestroy() {
|
215
|
-
this.
|
216
|
-
this.
|
217
|
-
this.
|
218
|
-
this.
|
219
|
-
this.
|
220
|
-
this.
|
219
|
+
__classPrivateFieldGet(this, _SkyDataManagerService_activeViewId, "f").complete();
|
220
|
+
__classPrivateFieldGet(this, _SkyDataManagerService_dataManagerConfig, "f").complete();
|
221
|
+
__classPrivateFieldGet(this, _SkyDataManagerService_views, "f").complete();
|
222
|
+
__classPrivateFieldGet(this, _SkyDataManagerService_dataStateChange, "f").complete();
|
223
|
+
__classPrivateFieldGet(this, _SkyDataManagerService_ngUnsubscribe, "f").next();
|
224
|
+
__classPrivateFieldGet(this, _SkyDataManagerService_ngUnsubscribe, "f").complete();
|
221
225
|
}
|
222
226
|
/**
|
223
227
|
* Initializes the data manager with the given settings and sets `isInitialized` to `true`.
|
@@ -227,32 +231,33 @@ class SkyDataManagerService {
|
|
227
231
|
* and saves any state changes to the service.
|
228
232
|
*/
|
229
233
|
initDataManager(args) {
|
230
|
-
if (this
|
234
|
+
if (__classPrivateFieldGet(this, _SkyDataManagerService_isInitialized, "f")) {
|
231
235
|
console.warn('This data manager instance has already been initialized.');
|
232
236
|
return;
|
233
237
|
}
|
238
|
+
__classPrivateFieldSet(this, _SkyDataManagerService_isInitialized, true, "f");
|
234
239
|
const defaultDataState = args.defaultDataState;
|
235
240
|
const settingsKey = args.settingsKey;
|
236
241
|
this.updateActiveViewId(args.activeViewId);
|
237
242
|
this.updateDataManagerConfig(args.dataManagerConfig);
|
238
243
|
if (settingsKey) {
|
239
|
-
this
|
244
|
+
__classPrivateFieldGet(this, _SkyDataManagerService_uiConfigService, "f")
|
240
245
|
.getConfig(settingsKey, defaultDataState.getStateOptions())
|
241
246
|
.pipe(take(1))
|
242
247
|
.subscribe((config) => {
|
243
|
-
this.updateDataState(new SkyDataManagerState(config), this
|
248
|
+
this.updateDataState(new SkyDataManagerState(config), __classPrivateFieldGet(this, _SkyDataManagerService_initSource, "f"));
|
244
249
|
});
|
245
250
|
}
|
246
251
|
else {
|
247
|
-
this.updateDataState(defaultDataState, this
|
252
|
+
this.updateDataState(defaultDataState, __classPrivateFieldGet(this, _SkyDataManagerService_initSource, "f"));
|
248
253
|
}
|
249
254
|
if (settingsKey) {
|
250
|
-
this.getDataStateUpdates(this
|
251
|
-
.pipe(takeUntil(this
|
255
|
+
this.getDataStateUpdates(__classPrivateFieldGet(this, _SkyDataManagerService_initSource, "f"))
|
256
|
+
.pipe(takeUntil(__classPrivateFieldGet(this, _SkyDataManagerService_ngUnsubscribe, "f")))
|
252
257
|
.subscribe((state) => {
|
253
|
-
this
|
258
|
+
__classPrivateFieldGet(this, _SkyDataManagerService_uiConfigService, "f")
|
254
259
|
.setConfig(settingsKey, state.getStateOptions())
|
255
|
-
.pipe(takeUntil(this
|
260
|
+
.pipe(takeUntil(__classPrivateFieldGet(this, _SkyDataManagerService_ngUnsubscribe, "f")))
|
256
261
|
.subscribe(
|
257
262
|
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
258
263
|
() => { }, (err) => {
|
@@ -267,19 +272,19 @@ class SkyDataManagerService {
|
|
267
272
|
* @param viewConfig The SkyDataViewConfig settings for the view being registered.
|
268
273
|
*/
|
269
274
|
initDataView(viewConfig) {
|
270
|
-
const currentViews = this.
|
275
|
+
const currentViews = __classPrivateFieldGet(this, _SkyDataManagerService_views, "f").value;
|
271
276
|
if (this.getViewById(viewConfig.id)) {
|
272
277
|
console.warn(`A data manager view with the id ${viewConfig.id} has already been initialized.`);
|
273
278
|
return;
|
274
279
|
}
|
275
280
|
currentViews.push(viewConfig);
|
276
|
-
this.
|
281
|
+
__classPrivateFieldGet(this, _SkyDataManagerService_views, "f").next(currentViews);
|
277
282
|
// When the initial activeViewId is set there are no views registered. We have to re-emit
|
278
283
|
// the activeId so the newly registered view is notified that it is active.
|
279
|
-
this.
|
280
|
-
this.
|
284
|
+
__classPrivateFieldGet(this, _SkyDataManagerService_activeViewId, "f").pipe(take(1)).subscribe((id) => {
|
285
|
+
__classPrivateFieldGet(this, _SkyDataManagerService_activeViewId, "f").next(id);
|
281
286
|
});
|
282
|
-
this
|
287
|
+
__classPrivateFieldGet(this, _SkyDataManagerService_dataStateChange, "f")
|
283
288
|
.pipe(take(1))
|
284
289
|
.subscribe((change) => {
|
285
290
|
var _a;
|
@@ -304,20 +309,21 @@ class SkyDataManagerService {
|
|
304
309
|
newViewState.displayedColumnIds = displayedColumnIds;
|
305
310
|
}
|
306
311
|
const newDataState = dataState.addOrUpdateView(viewConfig.id, newViewState);
|
307
|
-
this.updateDataState(newDataState, this
|
312
|
+
this.updateDataState(newDataState, __classPrivateFieldGet(this, _SkyDataManagerService_initSource, "f"));
|
308
313
|
}
|
309
314
|
else {
|
310
|
-
const currentAvailableColumnIds = (_a = viewConfig.columnOptions) === null || _a === void 0 ? void 0 : _a.map((columnOptions) => {
|
315
|
+
const currentAvailableColumnIds = ((_a = viewConfig.columnOptions) === null || _a === void 0 ? void 0 : _a.map((columnOptions) => {
|
311
316
|
return columnOptions.id;
|
312
|
-
});
|
317
|
+
})) || [];
|
313
318
|
// Ensure that the view state's available columns match with the view config. Also,
|
314
319
|
// add new columns to the `displayedColumnIds` as long as they are not `initialHide`.
|
315
320
|
// We only add columns to `displayedColumnsIds` if we had previously tracked
|
316
321
|
// `columnIds` to avoid breaking changes.
|
317
322
|
if (currentViewState.columnIds.length > 0) {
|
318
|
-
let newColumnIds = currentAvailableColumnIds.filter((id) => currentViewState.columnIds.indexOf(id) < 0);
|
319
|
-
newColumnIds = newColumnIds.filter((columnId) => {
|
320
|
-
|
323
|
+
let newColumnIds = currentAvailableColumnIds === null || currentAvailableColumnIds === void 0 ? void 0 : currentAvailableColumnIds.filter((id) => currentViewState.columnIds.indexOf(id) < 0);
|
324
|
+
newColumnIds = newColumnIds === null || newColumnIds === void 0 ? void 0 : newColumnIds.filter((columnId) => {
|
325
|
+
var _a;
|
326
|
+
return (_a = viewConfig.columnOptions) === null || _a === void 0 ? void 0 : _a.find((columnOption) => columnOption.id === columnId && !columnOption.initialHide);
|
321
327
|
});
|
322
328
|
// Add the column IDs that now exist to the data manager state both as available
|
323
329
|
// and as shown.
|
@@ -328,7 +334,7 @@ class SkyDataManagerService {
|
|
328
334
|
// and as shown.
|
329
335
|
currentViewState.columnIds = currentAvailableColumnIds;
|
330
336
|
const newDataState = dataState.addOrUpdateView(viewConfig.id, currentViewState);
|
331
|
-
this.updateDataState(newDataState, this
|
337
|
+
this.updateDataState(newDataState, __classPrivateFieldGet(this, _SkyDataManagerService_initSource, "f"));
|
332
338
|
}
|
333
339
|
})
|
334
340
|
.unsubscribe();
|
@@ -343,12 +349,12 @@ class SkyDataManagerService {
|
|
343
349
|
getDataStateUpdates(sourceId, updateFilter) {
|
344
350
|
// filter out events from the provided source and emit just the dataState
|
345
351
|
if (updateFilter) {
|
346
|
-
return this.
|
352
|
+
return __classPrivateFieldGet(this, _SkyDataManagerService_dataStateChange, "f").pipe(filter((stateChange) => sourceId !== stateChange.source), map((stateChange) => stateChange.dataState), updateFilter.comparator
|
347
353
|
? distinctUntilChanged(updateFilter.comparator)
|
348
|
-
: distinctUntilChanged(this.
|
354
|
+
: distinctUntilChanged(__classPrivateFieldGet(this, _SkyDataManagerService_instances, "m", _SkyDataManagerService_getDefaultStateComparator).call(this, updateFilter.properties)));
|
349
355
|
}
|
350
356
|
else {
|
351
|
-
return this.
|
357
|
+
return __classPrivateFieldGet(this, _SkyDataManagerService_dataStateChange, "f").pipe(filter((stateChange) => sourceId !== stateChange.source), map((stateChange) => stateChange.dataState));
|
352
358
|
}
|
353
359
|
}
|
354
360
|
/**
|
@@ -361,52 +367,52 @@ class SkyDataManagerService {
|
|
361
367
|
updateDataState(state, sourceId) {
|
362
368
|
const newState = new SkyDataManagerState(state.getStateOptions());
|
363
369
|
const newStateChange = new SkyDataManagerStateChange(newState, sourceId);
|
364
|
-
this.
|
370
|
+
__classPrivateFieldGet(this, _SkyDataManagerService_dataStateChange, "f").next(newStateChange);
|
365
371
|
}
|
366
372
|
/**
|
367
373
|
* Returns the current `SkyDataManagerConfig`.
|
368
374
|
*/
|
369
375
|
getCurrentDataManagerConfig() {
|
370
|
-
return this.
|
376
|
+
return __classPrivateFieldGet(this, _SkyDataManagerService_dataManagerConfig, "f").value;
|
371
377
|
}
|
372
378
|
/**
|
373
379
|
* Returns an observable of data manager config changes that views and other data manager entities can subscribe to.
|
374
380
|
*/
|
375
381
|
getDataManagerConfigUpdates() {
|
376
|
-
return this
|
382
|
+
return __classPrivateFieldGet(this, _SkyDataManagerService_dataManagerConfig, "f");
|
377
383
|
}
|
378
384
|
/**
|
379
385
|
* Updates the data manager config and emits a new value to entities subscribed to data config changes.
|
380
386
|
* @param value The new `SkyDataManagerConfig` value.
|
381
387
|
*/
|
382
388
|
updateDataManagerConfig(value) {
|
383
|
-
this.
|
389
|
+
__classPrivateFieldGet(this, _SkyDataManagerService_dataManagerConfig, "f").next(value);
|
384
390
|
}
|
385
391
|
/**
|
386
392
|
* Returns an observable of data view config changes that views and other data manager entities can subscribe to.
|
387
393
|
*/
|
388
394
|
getDataViewsUpdates() {
|
389
|
-
return this
|
395
|
+
return __classPrivateFieldGet(this, _SkyDataManagerService_views, "f");
|
390
396
|
}
|
391
397
|
/**
|
392
398
|
* Returns an observable of the active view ID that views and other data manager entities can subscribe to.
|
393
399
|
*/
|
394
400
|
getActiveViewIdUpdates() {
|
395
|
-
return this
|
401
|
+
return __classPrivateFieldGet(this, _SkyDataManagerService_activeViewId, "f");
|
396
402
|
}
|
397
403
|
/**
|
398
404
|
* Updates the active view ID. The data manager changes the displayed view.
|
399
405
|
* @param id The new active view ID.
|
400
406
|
*/
|
401
407
|
updateActiveViewId(id) {
|
402
|
-
this.
|
408
|
+
__classPrivateFieldGet(this, _SkyDataManagerService_activeViewId, "f").next(id);
|
403
409
|
}
|
404
410
|
/**
|
405
411
|
* Returns the `SkyDataViewConfig` for the given view ID.
|
406
412
|
* @param viewId The ID of the view config to get.
|
407
413
|
*/
|
408
414
|
getViewById(viewId) {
|
409
|
-
const currentViews = this.
|
415
|
+
const currentViews = __classPrivateFieldGet(this, _SkyDataManagerService_views, "f").value;
|
410
416
|
const viewConfig = currentViews.find((view) => view.id === viewId);
|
411
417
|
return viewConfig;
|
412
418
|
}
|
@@ -417,14 +423,14 @@ class SkyDataManagerService {
|
|
417
423
|
* @param view The new `SkyDataViewConfig` containing all properties.
|
418
424
|
*/
|
419
425
|
updateViewConfig(view) {
|
420
|
-
const currentViews = this.
|
426
|
+
const currentViews = __classPrivateFieldGet(this, _SkyDataManagerService_views, "f").value;
|
421
427
|
const existingViewIndex = currentViews.findIndex((currentView) => currentView.id === view.id);
|
422
428
|
if (existingViewIndex === -1) {
|
423
429
|
console.error('A view with the id {id} does not exist.', view.id);
|
424
430
|
}
|
425
431
|
else {
|
426
432
|
currentViews[existingViewIndex] = view;
|
427
|
-
this.
|
433
|
+
__classPrivateFieldGet(this, _SkyDataManagerService_views, "f").next(currentViews);
|
428
434
|
}
|
429
435
|
}
|
430
436
|
/**
|
@@ -435,25 +441,25 @@ class SkyDataManagerService {
|
|
435
441
|
viewkeeperClasses[viewId] = classes;
|
436
442
|
this.viewkeeperClasses.next(viewkeeperClasses);
|
437
443
|
}
|
438
|
-
|
439
|
-
|
440
|
-
|
444
|
+
}
|
445
|
+
_SkyDataManagerService_activeViewId = new WeakMap(), _SkyDataManagerService_dataManagerConfig = new WeakMap(), _SkyDataManagerService_views = new WeakMap(), _SkyDataManagerService_dataStateChange = new WeakMap(), _SkyDataManagerService_isInitialized = new WeakMap(), _SkyDataManagerService_ngUnsubscribe = new WeakMap(), _SkyDataManagerService_initSource = new WeakMap(), _SkyDataManagerService_uiConfigService = new WeakMap(), _SkyDataManagerService_instances = new WeakSet(), _SkyDataManagerService_filterDataStateProperties = function _SkyDataManagerService_filterDataStateProperties(state, properties) {
|
446
|
+
const stateProperties = state.getStateOptions();
|
447
|
+
const filteredStateProperties = {};
|
448
|
+
if (properties) {
|
441
449
|
for (const property of properties) {
|
442
|
-
|
443
|
-
if (Object.prototype.hasOwnProperty.call(stateProperties, property)) {
|
450
|
+
if (property in stateProperties) {
|
444
451
|
filteredStateProperties[property] = stateProperties[property];
|
445
452
|
}
|
446
453
|
}
|
447
|
-
return filteredStateProperties;
|
448
454
|
}
|
449
|
-
|
450
|
-
|
451
|
-
|
452
|
-
|
453
|
-
|
454
|
-
|
455
|
-
}
|
456
|
-
}
|
455
|
+
return filteredStateProperties;
|
456
|
+
}, _SkyDataManagerService_getDefaultStateComparator = function _SkyDataManagerService_getDefaultStateComparator(properties) {
|
457
|
+
return (state1, state2) => {
|
458
|
+
const filteredState1 = __classPrivateFieldGet(this, _SkyDataManagerService_instances, "m", _SkyDataManagerService_filterDataStateProperties).call(this, state1, properties);
|
459
|
+
const filteredState2 = __classPrivateFieldGet(this, _SkyDataManagerService_instances, "m", _SkyDataManagerService_filterDataStateProperties).call(this, state2, properties);
|
460
|
+
return JSON.stringify(filteredState1) === JSON.stringify(filteredState2);
|
461
|
+
};
|
462
|
+
};
|
457
463
|
SkyDataManagerService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: SkyDataManagerService, deps: [{ token: i1.SkyUIConfigService }], target: i0.ɵɵFactoryTarget.Injectable });
|
458
464
|
SkyDataManagerService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: SkyDataManagerService });
|
459
465
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: SkyDataManagerService, decorators: [{
|
@@ -484,69 +490,76 @@ class SkyDataManagerColumnPickerContext {
|
|
484
490
|
}
|
485
491
|
}
|
486
492
|
|
493
|
+
var _SkyDataManagerComponent_activeViewId, _SkyDataManagerComponent_allViewkeeperClasses, _SkyDataManagerComponent_ngUnsubscribe, _SkyDataManagerComponent_sourceId, _SkyDataManagerComponent_changeDetection, _SkyDataManagerComponent_dataManagerService, _SkyDataManagerComponent__isInitialized, _SkyDataManagerComponent__currentViewkeeperClasses;
|
494
|
+
const VIEWKEEPER_CLASSES_DEFAULT = ['.sky-data-manager-toolbar'];
|
487
495
|
/**
|
488
496
|
* The top-level data manager component. Provide `SkyDataManagerService` at this level.
|
489
497
|
*/
|
490
498
|
class SkyDataManagerComponent {
|
491
499
|
constructor(changeDetection, dataManagerService) {
|
492
|
-
this.changeDetection = changeDetection;
|
493
|
-
this.dataManagerService = dataManagerService;
|
494
500
|
this.backToTopController = new Subject();
|
495
501
|
this.backToTopOptions = {
|
496
502
|
buttonHidden: true,
|
497
503
|
};
|
498
|
-
this
|
499
|
-
this
|
500
|
-
this
|
501
|
-
this
|
504
|
+
_SkyDataManagerComponent_activeViewId.set(this, void 0);
|
505
|
+
_SkyDataManagerComponent_allViewkeeperClasses.set(this, {});
|
506
|
+
_SkyDataManagerComponent_ngUnsubscribe.set(this, new Subject());
|
507
|
+
_SkyDataManagerComponent_sourceId.set(this, 'dataManagerComponent');
|
508
|
+
_SkyDataManagerComponent_changeDetection.set(this, void 0);
|
509
|
+
_SkyDataManagerComponent_dataManagerService.set(this, void 0);
|
510
|
+
_SkyDataManagerComponent__isInitialized.set(this, false);
|
511
|
+
_SkyDataManagerComponent__currentViewkeeperClasses.set(this, VIEWKEEPER_CLASSES_DEFAULT);
|
512
|
+
__classPrivateFieldSet(this, _SkyDataManagerComponent_changeDetection, changeDetection, "f");
|
513
|
+
__classPrivateFieldSet(this, _SkyDataManagerComponent_dataManagerService, dataManagerService, "f");
|
502
514
|
}
|
503
515
|
get currentViewkeeperClasses() {
|
504
|
-
|
505
|
-
let allClasses = dataManagerClasses;
|
506
|
-
if (this._currentViewkeeperClasses) {
|
507
|
-
allClasses = dataManagerClasses.concat(this._currentViewkeeperClasses);
|
508
|
-
}
|
509
|
-
return allClasses;
|
516
|
+
return __classPrivateFieldGet(this, _SkyDataManagerComponent__currentViewkeeperClasses, "f");
|
510
517
|
}
|
511
518
|
set currentViewkeeperClasses(value) {
|
512
|
-
this
|
513
|
-
|
519
|
+
__classPrivateFieldSet(this, _SkyDataManagerComponent__currentViewkeeperClasses, [
|
520
|
+
...VIEWKEEPER_CLASSES_DEFAULT,
|
521
|
+
...(value || []),
|
522
|
+
], "f");
|
523
|
+
__classPrivateFieldGet(this, _SkyDataManagerComponent_changeDetection, "f").markForCheck();
|
514
524
|
}
|
515
525
|
get isInitialized() {
|
516
|
-
return this
|
526
|
+
return __classPrivateFieldGet(this, _SkyDataManagerComponent__isInitialized, "f");
|
517
527
|
}
|
518
528
|
set isInitialized(value) {
|
519
|
-
this
|
520
|
-
this.
|
529
|
+
__classPrivateFieldSet(this, _SkyDataManagerComponent__isInitialized, value, "f");
|
530
|
+
__classPrivateFieldGet(this, _SkyDataManagerComponent_changeDetection, "f").markForCheck();
|
521
531
|
}
|
522
532
|
ngOnInit() {
|
523
|
-
this
|
524
|
-
.getDataStateUpdates(this
|
525
|
-
.pipe(takeUntil(this
|
533
|
+
__classPrivateFieldGet(this, _SkyDataManagerComponent_dataManagerService, "f")
|
534
|
+
.getDataStateUpdates(__classPrivateFieldGet(this, _SkyDataManagerComponent_sourceId, "f"))
|
535
|
+
.pipe(takeUntil(__classPrivateFieldGet(this, _SkyDataManagerComponent_ngUnsubscribe, "f")))
|
526
536
|
.subscribe(() => (this.isInitialized = true));
|
527
|
-
this.
|
528
|
-
.pipe(takeUntil(this
|
537
|
+
__classPrivateFieldGet(this, _SkyDataManagerComponent_dataManagerService, "f").viewkeeperClasses
|
538
|
+
.pipe(takeUntil(__classPrivateFieldGet(this, _SkyDataManagerComponent_ngUnsubscribe, "f")))
|
529
539
|
.subscribe((classes) => {
|
530
|
-
this
|
531
|
-
this.currentViewkeeperClasses =
|
540
|
+
__classPrivateFieldSet(this, _SkyDataManagerComponent_allViewkeeperClasses, classes, "f");
|
541
|
+
this.currentViewkeeperClasses = __classPrivateFieldGet(this, _SkyDataManagerComponent_activeViewId, "f")
|
542
|
+
? classes[__classPrivateFieldGet(this, _SkyDataManagerComponent_activeViewId, "f")]
|
543
|
+
: undefined;
|
532
544
|
});
|
533
|
-
this
|
545
|
+
__classPrivateFieldGet(this, _SkyDataManagerComponent_dataManagerService, "f")
|
534
546
|
.getActiveViewIdUpdates()
|
535
|
-
.pipe(takeUntil(this
|
547
|
+
.pipe(takeUntil(__classPrivateFieldGet(this, _SkyDataManagerComponent_ngUnsubscribe, "f")))
|
536
548
|
.subscribe((activeViewId) => {
|
537
|
-
this
|
549
|
+
__classPrivateFieldSet(this, _SkyDataManagerComponent_activeViewId, activeViewId, "f");
|
538
550
|
this.backToTopController.next({
|
539
551
|
type: SkyBackToTopMessageType.BackToTop,
|
540
552
|
});
|
541
553
|
this.currentViewkeeperClasses =
|
542
|
-
this
|
554
|
+
__classPrivateFieldGet(this, _SkyDataManagerComponent_allViewkeeperClasses, "f")[__classPrivateFieldGet(this, _SkyDataManagerComponent_activeViewId, "f")];
|
543
555
|
});
|
544
556
|
}
|
545
557
|
ngOnDestroy() {
|
546
|
-
this.
|
547
|
-
this.
|
558
|
+
__classPrivateFieldGet(this, _SkyDataManagerComponent_ngUnsubscribe, "f").next();
|
559
|
+
__classPrivateFieldGet(this, _SkyDataManagerComponent_ngUnsubscribe, "f").complete();
|
548
560
|
}
|
549
561
|
}
|
562
|
+
_SkyDataManagerComponent_activeViewId = new WeakMap(), _SkyDataManagerComponent_allViewkeeperClasses = new WeakMap(), _SkyDataManagerComponent_ngUnsubscribe = new WeakMap(), _SkyDataManagerComponent_sourceId = new WeakMap(), _SkyDataManagerComponent_changeDetection = new WeakMap(), _SkyDataManagerComponent_dataManagerService = new WeakMap(), _SkyDataManagerComponent__isInitialized = new WeakMap(), _SkyDataManagerComponent__currentViewkeeperClasses = new WeakMap();
|
550
563
|
SkyDataManagerComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: SkyDataManagerComponent, deps: [{ token: i0.ChangeDetectorRef }, { token: SkyDataManagerService }], target: i0.ɵɵFactoryTarget.Component });
|
551
564
|
SkyDataManagerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.0", 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 });
|
552
565
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: SkyDataManagerComponent, decorators: [{
|
@@ -554,6 +567,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImpor
|
|
554
567
|
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" }]
|
555
568
|
}], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }, { type: SkyDataManagerService }]; } });
|
556
569
|
|
570
|
+
// TODO: In a future breaking change convert this to an interface
|
557
571
|
/**
|
558
572
|
* Sets the state of the filters.
|
559
573
|
*/
|
@@ -574,6 +588,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImpor
|
|
574
588
|
type: Injectable
|
575
589
|
}] });
|
576
590
|
|
591
|
+
var _SkyDataManagerToolbarComponent_ngUnsubscribe, _SkyDataManagerToolbarComponent_changeDetector, _SkyDataManagerToolbarComponent_dataManagerService, _SkyDataManagerToolbarComponent_modalService, _SkyDataManagerToolbarComponent_columnPickerService, _SkyDataManagerToolbarComponent__source, _SkyDataManagerToolbarComponent__activeView, _SkyDataManagerToolbarComponent__dataManagerConfig, _SkyDataManagerToolbarComponent__dataState, _SkyDataManagerToolbarComponent__views;
|
577
592
|
/**
|
578
593
|
* Renders a `sky-toolbar` with the contents specified by the active view's `SkyDataViewConfig`
|
579
594
|
* and the `SkyDataManagerToolbarLeftItemsComponent`, `SkyDataManagerToolbarRightItemsComponent`,
|
@@ -581,102 +596,112 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImpor
|
|
581
596
|
*/
|
582
597
|
class SkyDataManagerToolbarComponent {
|
583
598
|
constructor(changeDetector, dataManagerService, modalService, columnPickerService) {
|
584
|
-
this
|
585
|
-
this
|
586
|
-
this
|
587
|
-
this
|
599
|
+
_SkyDataManagerToolbarComponent_ngUnsubscribe.set(this, new Subject());
|
600
|
+
_SkyDataManagerToolbarComponent_changeDetector.set(this, void 0);
|
601
|
+
_SkyDataManagerToolbarComponent_dataManagerService.set(this, void 0);
|
602
|
+
_SkyDataManagerToolbarComponent_modalService.set(this, void 0);
|
603
|
+
_SkyDataManagerToolbarComponent_columnPickerService.set(this, void 0);
|
588
604
|
// the source to provide for data state changes
|
589
|
-
this
|
590
|
-
this
|
591
|
-
this
|
592
|
-
|
593
|
-
|
594
|
-
|
595
|
-
|
605
|
+
_SkyDataManagerToolbarComponent__source.set(this, 'toolbar');
|
606
|
+
_SkyDataManagerToolbarComponent__activeView.set(this, void 0);
|
607
|
+
_SkyDataManagerToolbarComponent__dataManagerConfig.set(this, void 0);
|
608
|
+
_SkyDataManagerToolbarComponent__dataState.set(this, void 0);
|
609
|
+
_SkyDataManagerToolbarComponent__views.set(this, []);
|
610
|
+
__classPrivateFieldSet(this, _SkyDataManagerToolbarComponent_changeDetector, changeDetector, "f");
|
611
|
+
__classPrivateFieldSet(this, _SkyDataManagerToolbarComponent_dataManagerService, dataManagerService, "f");
|
612
|
+
__classPrivateFieldSet(this, _SkyDataManagerToolbarComponent_modalService, modalService, "f");
|
613
|
+
__classPrivateFieldSet(this, _SkyDataManagerToolbarComponent_columnPickerService, columnPickerService, "f");
|
596
614
|
}
|
597
615
|
get activeView() {
|
598
|
-
return this
|
616
|
+
return __classPrivateFieldGet(this, _SkyDataManagerToolbarComponent__activeView, "f");
|
599
617
|
}
|
600
618
|
set activeView(value) {
|
601
|
-
this
|
602
|
-
this.
|
619
|
+
__classPrivateFieldSet(this, _SkyDataManagerToolbarComponent__activeView, value, "f");
|
620
|
+
__classPrivateFieldGet(this, _SkyDataManagerToolbarComponent_changeDetector, "f").markForCheck();
|
603
621
|
}
|
604
622
|
get dataManagerConfig() {
|
605
|
-
return this
|
623
|
+
return __classPrivateFieldGet(this, _SkyDataManagerToolbarComponent__dataManagerConfig, "f");
|
606
624
|
}
|
607
625
|
set dataManagerConfig(value) {
|
608
|
-
this
|
609
|
-
this.
|
626
|
+
__classPrivateFieldSet(this, _SkyDataManagerToolbarComponent__dataManagerConfig, value, "f");
|
627
|
+
__classPrivateFieldGet(this, _SkyDataManagerToolbarComponent_changeDetector, "f").markForCheck();
|
610
628
|
}
|
611
629
|
get dataState() {
|
612
|
-
return this
|
630
|
+
return __classPrivateFieldGet(this, _SkyDataManagerToolbarComponent__dataState, "f");
|
613
631
|
}
|
614
632
|
set dataState(value) {
|
615
|
-
this
|
616
|
-
|
633
|
+
__classPrivateFieldSet(this, _SkyDataManagerToolbarComponent__dataState, value, "f");
|
634
|
+
if (value) {
|
635
|
+
__classPrivateFieldGet(this, _SkyDataManagerToolbarComponent_dataManagerService, "f").updateDataState(value, __classPrivateFieldGet(this, _SkyDataManagerToolbarComponent__source, "f"));
|
636
|
+
}
|
617
637
|
}
|
618
638
|
get views() {
|
619
|
-
return this
|
639
|
+
return __classPrivateFieldGet(this, _SkyDataManagerToolbarComponent__views, "f");
|
620
640
|
}
|
621
641
|
set views(value) {
|
622
|
-
this
|
623
|
-
this.
|
642
|
+
__classPrivateFieldSet(this, _SkyDataManagerToolbarComponent__views, value, "f");
|
643
|
+
__classPrivateFieldGet(this, _SkyDataManagerToolbarComponent_changeDetector, "f").markForCheck();
|
624
644
|
}
|
625
645
|
ngOnInit() {
|
626
|
-
this
|
646
|
+
__classPrivateFieldGet(this, _SkyDataManagerToolbarComponent_dataManagerService, "f")
|
627
647
|
.getActiveViewIdUpdates()
|
628
|
-
.pipe(takeUntil(this
|
648
|
+
.pipe(takeUntil(__classPrivateFieldGet(this, _SkyDataManagerToolbarComponent_ngUnsubscribe, "f")))
|
629
649
|
.subscribe((activeViewId) => {
|
630
650
|
/* istanbul ignore else */
|
631
651
|
if (activeViewId) {
|
632
|
-
this.activeView = this.
|
633
|
-
this.
|
652
|
+
this.activeView = __classPrivateFieldGet(this, _SkyDataManagerToolbarComponent_dataManagerService, "f").getViewById(activeViewId);
|
653
|
+
__classPrivateFieldGet(this, _SkyDataManagerToolbarComponent_changeDetector, "f").markForCheck();
|
634
654
|
}
|
635
655
|
});
|
636
|
-
this
|
656
|
+
__classPrivateFieldGet(this, _SkyDataManagerToolbarComponent_dataManagerService, "f")
|
637
657
|
.getDataViewsUpdates()
|
638
|
-
.pipe(takeUntil(this
|
658
|
+
.pipe(takeUntil(__classPrivateFieldGet(this, _SkyDataManagerToolbarComponent_ngUnsubscribe, "f")))
|
639
659
|
.subscribe((views) => {
|
640
660
|
this.views = views;
|
641
661
|
if (this.activeView) {
|
642
|
-
this.activeView = this.
|
662
|
+
this.activeView = __classPrivateFieldGet(this, _SkyDataManagerToolbarComponent_dataManagerService, "f").getViewById(this.activeView.id);
|
643
663
|
}
|
644
|
-
this.
|
664
|
+
__classPrivateFieldGet(this, _SkyDataManagerToolbarComponent_changeDetector, "f").markForCheck();
|
645
665
|
});
|
646
|
-
this
|
647
|
-
.getDataStateUpdates(this
|
648
|
-
.pipe(takeUntil(this
|
666
|
+
__classPrivateFieldGet(this, _SkyDataManagerToolbarComponent_dataManagerService, "f")
|
667
|
+
.getDataStateUpdates(__classPrivateFieldGet(this, _SkyDataManagerToolbarComponent__source, "f"))
|
668
|
+
.pipe(takeUntil(__classPrivateFieldGet(this, _SkyDataManagerToolbarComponent_ngUnsubscribe, "f")))
|
649
669
|
.subscribe((dataState) => {
|
650
|
-
this
|
670
|
+
__classPrivateFieldSet(this, _SkyDataManagerToolbarComponent__dataState, dataState, "f");
|
651
671
|
this.onlyShowSelected = dataState.onlyShowSelected;
|
652
|
-
this.
|
672
|
+
__classPrivateFieldGet(this, _SkyDataManagerToolbarComponent_changeDetector, "f").markForCheck();
|
653
673
|
});
|
654
|
-
this
|
674
|
+
__classPrivateFieldGet(this, _SkyDataManagerToolbarComponent_dataManagerService, "f")
|
655
675
|
.getDataManagerConfigUpdates()
|
656
|
-
.pipe(takeUntil(this
|
676
|
+
.pipe(takeUntil(__classPrivateFieldGet(this, _SkyDataManagerToolbarComponent_ngUnsubscribe, "f")))
|
657
677
|
.subscribe((config) => {
|
658
678
|
this.dataManagerConfig = config;
|
659
679
|
});
|
660
680
|
}
|
661
681
|
ngOnDestroy() {
|
662
|
-
this.
|
663
|
-
this.
|
682
|
+
__classPrivateFieldGet(this, _SkyDataManagerToolbarComponent_ngUnsubscribe, "f").next();
|
683
|
+
__classPrivateFieldGet(this, _SkyDataManagerToolbarComponent_ngUnsubscribe, "f").complete();
|
664
684
|
}
|
665
685
|
sortSelected(sortOption) {
|
666
|
-
this.dataState
|
667
|
-
|
686
|
+
if (this.dataState) {
|
687
|
+
this.dataState.activeSortOption = sortOption;
|
688
|
+
__classPrivateFieldGet(this, _SkyDataManagerToolbarComponent_dataManagerService, "f").updateDataState(this.dataState, __classPrivateFieldGet(this, _SkyDataManagerToolbarComponent__source, "f"));
|
689
|
+
}
|
668
690
|
}
|
669
691
|
onViewChange(viewId) {
|
670
|
-
this.
|
692
|
+
__classPrivateFieldGet(this, _SkyDataManagerToolbarComponent_dataManagerService, "f").updateActiveViewId(viewId);
|
671
693
|
}
|
672
694
|
searchApplied(text) {
|
673
|
-
this.dataState
|
674
|
-
|
695
|
+
if (this.dataState) {
|
696
|
+
this.dataState.searchText = text;
|
697
|
+
__classPrivateFieldGet(this, _SkyDataManagerToolbarComponent_dataManagerService, "f").updateDataState(this.dataState, __classPrivateFieldGet(this, _SkyDataManagerToolbarComponent__source, "f"));
|
698
|
+
}
|
675
699
|
}
|
676
700
|
filterButtonClicked() {
|
701
|
+
var _a;
|
677
702
|
const context = new SkyDataManagerFilterModalContext();
|
678
703
|
const filterModal = this.dataManagerConfig && this.dataManagerConfig.filterModalComponent;
|
679
|
-
context.filterData = this.dataState
|
704
|
+
context.filterData = (_a = this.dataState) === null || _a === void 0 ? void 0 : _a.filterData;
|
680
705
|
const options = {
|
681
706
|
providers: [
|
682
707
|
{ provide: SkyDataManagerFilterModalContext, useValue: context },
|
@@ -684,102 +709,109 @@ class SkyDataManagerToolbarComponent {
|
|
684
709
|
size: 'large',
|
685
710
|
};
|
686
711
|
if (filterModal) {
|
687
|
-
const modalInstance = this.
|
712
|
+
const modalInstance = __classPrivateFieldGet(this, _SkyDataManagerToolbarComponent_modalService, "f").open(filterModal, options);
|
688
713
|
modalInstance.closed.subscribe((result) => {
|
689
|
-
if (result.reason === 'save') {
|
714
|
+
if (this.dataState && result.reason === 'save') {
|
690
715
|
this.dataState.filterData = result.data;
|
691
|
-
this.
|
716
|
+
__classPrivateFieldGet(this, _SkyDataManagerToolbarComponent_dataManagerService, "f").updateDataState(this.dataState, __classPrivateFieldGet(this, _SkyDataManagerToolbarComponent__source, "f"));
|
692
717
|
}
|
693
718
|
});
|
694
719
|
}
|
695
720
|
}
|
696
721
|
openColumnPicker() {
|
697
|
-
|
698
|
-
|
699
|
-
|
700
|
-
|
701
|
-
|
702
|
-
|
703
|
-
|
704
|
-
|
705
|
-
|
706
|
-
|
707
|
-
|
708
|
-
|
709
|
-
|
710
|
-
|
711
|
-
|
712
|
-
|
713
|
-
|
714
|
-
|
722
|
+
if (this.dataState && this.activeView && this.activeView.columnOptions) {
|
723
|
+
const viewState = this.dataState.getViewStateById(this.activeView.id);
|
724
|
+
if (viewState) {
|
725
|
+
const context = new SkyDataManagerColumnPickerContext(this.activeView.columnOptions, viewState.displayedColumnIds);
|
726
|
+
if (this.activeView.columnPickerSortStrategy) {
|
727
|
+
context.columnPickerSortStrategy =
|
728
|
+
this.activeView.columnPickerSortStrategy;
|
729
|
+
}
|
730
|
+
const options = {
|
731
|
+
providers: [
|
732
|
+
{ provide: SkyDataManagerColumnPickerContext, useValue: context },
|
733
|
+
],
|
734
|
+
};
|
735
|
+
const modalInstance = __classPrivateFieldGet(this, _SkyDataManagerToolbarComponent_modalService, "f").open(__classPrivateFieldGet(this, _SkyDataManagerToolbarComponent_columnPickerService, "f").getComponentType(), options);
|
736
|
+
modalInstance.closed.subscribe((result) => {
|
737
|
+
if (result.reason === 'save') {
|
738
|
+
const displayedColumnIds = result.data.map((col) => col.id);
|
739
|
+
viewState.displayedColumnIds = displayedColumnIds;
|
740
|
+
if (this.dataState && this.activeView) {
|
741
|
+
this.dataState = this.dataState.addOrUpdateView(this.activeView.id, viewState);
|
742
|
+
}
|
743
|
+
}
|
744
|
+
});
|
715
745
|
}
|
716
|
-
}
|
746
|
+
}
|
717
747
|
}
|
718
748
|
selectAll() {
|
749
|
+
var _a;
|
719
750
|
/* istanbul ignore else */
|
720
|
-
if (this.activeView.onSelectAllClick) {
|
751
|
+
if ((_a = this.activeView) === null || _a === void 0 ? void 0 : _a.onSelectAllClick) {
|
721
752
|
this.activeView.onSelectAllClick();
|
722
753
|
}
|
723
754
|
}
|
724
755
|
clearAll() {
|
756
|
+
var _a;
|
725
757
|
/* istanbul ignore else */
|
726
|
-
if (this.activeView.onClearAllClick) {
|
758
|
+
if ((_a = this.activeView) === null || _a === void 0 ? void 0 : _a.onClearAllClick) {
|
727
759
|
this.activeView.onClearAllClick();
|
728
760
|
}
|
729
761
|
}
|
730
762
|
onOnlyShowSelected(event) {
|
731
|
-
this.dataState
|
732
|
-
|
763
|
+
if (this.dataState) {
|
764
|
+
this.dataState.onlyShowSelected = !!event.checked;
|
765
|
+
__classPrivateFieldGet(this, _SkyDataManagerToolbarComponent_dataManagerService, "f").updateDataState(this.dataState, __classPrivateFieldGet(this, _SkyDataManagerToolbarComponent__source, "f"));
|
766
|
+
}
|
733
767
|
}
|
734
768
|
}
|
769
|
+
_SkyDataManagerToolbarComponent_ngUnsubscribe = new WeakMap(), _SkyDataManagerToolbarComponent_changeDetector = new WeakMap(), _SkyDataManagerToolbarComponent_dataManagerService = new WeakMap(), _SkyDataManagerToolbarComponent_modalService = new WeakMap(), _SkyDataManagerToolbarComponent_columnPickerService = new WeakMap(), _SkyDataManagerToolbarComponent__source = new WeakMap(), _SkyDataManagerToolbarComponent__activeView = new WeakMap(), _SkyDataManagerToolbarComponent__dataManagerConfig = new WeakMap(), _SkyDataManagerToolbarComponent__dataState = new WeakMap(), _SkyDataManagerToolbarComponent__views = new WeakMap();
|
735
770
|
SkyDataManagerToolbarComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: SkyDataManagerToolbarComponent, deps: [{ token: i0.ChangeDetectorRef }, { token: SkyDataManagerService }, { token: i3.SkyModalService }, { token: SkyDataManagerColumnPickerService }], target: i0.ɵɵFactoryTarget.Component });
|
736
|
-
SkyDataManagerToolbarComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.0", 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]=\"
|
771
|
+
SkyDataManagerToolbarComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.0", 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 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"], 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", "required"], outputs: ["change", "checkedChange", "disabledChange"] }, { 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 });
|
737
772
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: SkyDataManagerToolbarComponent, decorators: [{
|
738
773
|
type: Component,
|
739
|
-
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]=\"
|
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 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"] }]
|
740
775
|
}], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }, { type: SkyDataManagerService }, { type: i3.SkyModalService }, { type: SkyDataManagerColumnPickerService }]; } });
|
741
776
|
|
777
|
+
var _SkyDataViewComponent_ngUnsubscribe, _SkyDataViewComponent_dataManagerService;
|
742
778
|
/**
|
743
779
|
* A data view is rendered within a data manager component.
|
744
780
|
* It can subscribe to data state changes from `SkyDataManagerService` and apply the filters,
|
745
781
|
* search text, and more to the data it displays.
|
746
782
|
*/
|
747
783
|
class SkyDataViewComponent {
|
748
|
-
constructor(
|
749
|
-
this
|
750
|
-
this
|
751
|
-
this
|
752
|
-
this._ngUnsubscribe = new Subject();
|
753
|
-
}
|
754
|
-
get isActive() {
|
755
|
-
return this._isActive;
|
756
|
-
}
|
757
|
-
set isActive(value) {
|
758
|
-
this._isActive = value;
|
759
|
-
this.changeDetector.markForCheck();
|
784
|
+
constructor(dataManagerService) {
|
785
|
+
_SkyDataViewComponent_ngUnsubscribe.set(this, new Subject());
|
786
|
+
_SkyDataViewComponent_dataManagerService.set(this, void 0);
|
787
|
+
__classPrivateFieldSet(this, _SkyDataViewComponent_dataManagerService, dataManagerService, "f");
|
760
788
|
}
|
761
789
|
ngOnInit() {
|
762
|
-
this
|
790
|
+
__classPrivateFieldGet(this, _SkyDataViewComponent_dataManagerService, "f")
|
763
791
|
.getActiveViewIdUpdates()
|
764
|
-
.pipe(takeUntil(this
|
792
|
+
.pipe(takeUntil(__classPrivateFieldGet(this, _SkyDataViewComponent_ngUnsubscribe, "f")))
|
765
793
|
.subscribe((activeViewId) => {
|
766
794
|
this.isActive = this.viewId === activeViewId;
|
767
795
|
});
|
768
796
|
}
|
769
797
|
ngOnDestroy() {
|
770
|
-
this.
|
771
|
-
this.
|
798
|
+
__classPrivateFieldGet(this, _SkyDataViewComponent_ngUnsubscribe, "f").next();
|
799
|
+
__classPrivateFieldGet(this, _SkyDataViewComponent_ngUnsubscribe, "f").complete();
|
772
800
|
}
|
773
801
|
}
|
774
|
-
|
775
|
-
SkyDataViewComponent.ɵ
|
802
|
+
_SkyDataViewComponent_ngUnsubscribe = new WeakMap(), _SkyDataViewComponent_dataManagerService = new WeakMap();
|
803
|
+
SkyDataViewComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: SkyDataViewComponent, deps: [{ token: SkyDataManagerService }], target: i0.ɵɵFactoryTarget.Component });
|
804
|
+
SkyDataViewComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.0", type: SkyDataViewComponent, selector: "sky-data-view", inputs: { viewId: "viewId", isActive: "isActive" }, 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 });
|
776
805
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: SkyDataViewComponent, decorators: [{
|
777
806
|
type: Component,
|
778
807
|
args: [{ selector: 'sky-data-view', changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-container *ngIf=\"isActive\">\n <ng-content></ng-content>\n</ng-container>\n" }]
|
779
|
-
}], ctorParameters: function () { return [{ type:
|
808
|
+
}], ctorParameters: function () { return [{ type: SkyDataManagerService }]; }, propDecorators: { viewId: [{
|
809
|
+
type: Input
|
810
|
+
}], isActive: [{
|
780
811
|
type: Input
|
781
812
|
}] } });
|
782
813
|
|
814
|
+
var _SkyDataManagerColumnPickerComponent_instances, _SkyDataManagerColumnPickerComponent_ngUnsubscribe, _SkyDataManagerColumnPickerComponent__dataState, _SkyDataManagerColumnPickerComponent_formatColumnOptions;
|
783
815
|
/**
|
784
816
|
* @internal
|
785
817
|
*/
|
@@ -788,6 +820,9 @@ class SkyDataManagerColumnPickerComponent {
|
|
788
820
|
this.context = context;
|
789
821
|
this.dataManagerService = dataManagerService;
|
790
822
|
this.instance = instance;
|
823
|
+
_SkyDataManagerColumnPickerComponent_instances.add(this);
|
824
|
+
this.columnData = [];
|
825
|
+
this.displayedColumnData = [];
|
791
826
|
this.viewConfig = {
|
792
827
|
id: 'columnPicker',
|
793
828
|
name: 'Column Picker',
|
@@ -797,14 +832,15 @@ class SkyDataManagerColumnPickerComponent {
|
|
797
832
|
onSelectAllClick: this.selectAll.bind(this),
|
798
833
|
onClearAllClick: this.clearAll.bind(this),
|
799
834
|
};
|
800
|
-
this.
|
801
|
-
this
|
835
|
+
this.isAnyDisplayedColumnSelected = false;
|
836
|
+
_SkyDataManagerColumnPickerComponent_ngUnsubscribe.set(this, new Subject());
|
837
|
+
_SkyDataManagerColumnPickerComponent__dataState.set(this, new SkyDataManagerState({}));
|
802
838
|
}
|
803
839
|
get dataState() {
|
804
|
-
return this
|
840
|
+
return __classPrivateFieldGet(this, _SkyDataManagerColumnPickerComponent__dataState, "f");
|
805
841
|
}
|
806
842
|
set dataState(value) {
|
807
|
-
this
|
843
|
+
__classPrivateFieldSet(this, _SkyDataManagerColumnPickerComponent__dataState, value, "f");
|
808
844
|
this.updateData();
|
809
845
|
}
|
810
846
|
ngOnInit() {
|
@@ -814,17 +850,17 @@ class SkyDataManagerColumnPickerComponent {
|
|
814
850
|
defaultDataState: this.dataState,
|
815
851
|
});
|
816
852
|
this.dataManagerService.initDataView(this.viewConfig);
|
817
|
-
this.columnData = this.
|
853
|
+
this.columnData = __classPrivateFieldGet(this, _SkyDataManagerColumnPickerComponent_instances, "m", _SkyDataManagerColumnPickerComponent_formatColumnOptions).call(this);
|
818
854
|
this.dataManagerService
|
819
855
|
.getDataStateUpdates('columnPicker')
|
820
|
-
.pipe(takeUntil(this
|
856
|
+
.pipe(takeUntil(__classPrivateFieldGet(this, _SkyDataManagerColumnPickerComponent_ngUnsubscribe, "f")))
|
821
857
|
.subscribe((state) => {
|
822
858
|
this.dataState = state;
|
823
859
|
});
|
824
860
|
}
|
825
861
|
ngOnDestroy() {
|
826
|
-
this.
|
827
|
-
this.
|
862
|
+
__classPrivateFieldGet(this, _SkyDataManagerColumnPickerComponent_ngUnsubscribe, "f").next();
|
863
|
+
__classPrivateFieldGet(this, _SkyDataManagerColumnPickerComponent_ngUnsubscribe, "f").complete();
|
828
864
|
}
|
829
865
|
updateData() {
|
830
866
|
this.displayedColumnData = this.searchColumns(this.columnData.filter((col) => !col.alwaysDisplayed));
|
@@ -839,10 +875,11 @@ class SkyDataManagerColumnPickerComponent {
|
|
839
875
|
const searchText = this.dataState && ((_a = this.dataState.searchText) === null || _a === void 0 ? void 0 : _a.toUpperCase());
|
840
876
|
if (searchText) {
|
841
877
|
searchedColumns = columns.filter((item) => {
|
878
|
+
var _a;
|
842
879
|
for (const property in item) {
|
843
880
|
if (Object.prototype.hasOwnProperty.call(item, property) &&
|
844
881
|
(property === 'label' || property === 'description')) {
|
845
|
-
const propertyText = item[property]
|
882
|
+
const propertyText = (_a = item[property]) === null || _a === void 0 ? void 0 : _a.toUpperCase();
|
846
883
|
if (propertyText && propertyText.indexOf(searchText) > -1) {
|
847
884
|
return true;
|
848
885
|
}
|
@@ -873,48 +910,48 @@ class SkyDataManagerColumnPickerComponent {
|
|
873
910
|
applyChanges() {
|
874
911
|
this.instance.save(this.columnData.filter((col) => col.isSelected || col.alwaysDisplayed));
|
875
912
|
}
|
876
|
-
|
877
|
-
|
878
|
-
|
879
|
-
|
880
|
-
|
881
|
-
|
882
|
-
|
883
|
-
|
884
|
-
|
885
|
-
|
886
|
-
|
887
|
-
|
888
|
-
|
889
|
-
|
890
|
-
|
891
|
-
|
892
|
-
|
893
|
-
|
894
|
-
|
895
|
-
|
896
|
-
|
897
|
-
|
898
|
-
else {
|
899
|
-
unselectedColumnOptions.push(formattedColumn);
|
900
|
-
}
|
913
|
+
}
|
914
|
+
_SkyDataManagerColumnPickerComponent_ngUnsubscribe = new WeakMap(), _SkyDataManagerColumnPickerComponent__dataState = new WeakMap(), _SkyDataManagerColumnPickerComponent_instances = new WeakSet(), _SkyDataManagerColumnPickerComponent_formatColumnOptions = function _SkyDataManagerColumnPickerComponent_formatColumnOptions() {
|
915
|
+
const allColumnOptions = this.context.columnOptions;
|
916
|
+
const visibleColumnIds = this.context.displayedColumnIds;
|
917
|
+
let formattedColumnOptions = [];
|
918
|
+
const unselectedColumnOptions = [];
|
919
|
+
for (const columnOption of allColumnOptions) {
|
920
|
+
// format the column with the properties the column picker needs
|
921
|
+
const colIndex = visibleColumnIds.indexOf(columnOption.id);
|
922
|
+
const formattedColumn = {
|
923
|
+
alwaysDisplayed: columnOption.alwaysDisplayed,
|
924
|
+
id: columnOption.id,
|
925
|
+
label: columnOption.label,
|
926
|
+
description: columnOption.description,
|
927
|
+
isSelected: colIndex !== -1,
|
928
|
+
};
|
929
|
+
// if column picker sorting is currently enabled sort columns by order displayed then alphabetical
|
930
|
+
// else display column in order they were specified in the columnOptions
|
931
|
+
if (this.context.columnPickerSortStrategy ===
|
932
|
+
SkyDataManagerColumnPickerSortStrategy.SelectedThenAlphabetical) {
|
933
|
+
if (formattedColumn.isSelected) {
|
934
|
+
formattedColumnOptions[colIndex] = formattedColumn;
|
901
935
|
}
|
902
936
|
else {
|
903
|
-
|
937
|
+
unselectedColumnOptions.push(formattedColumn);
|
904
938
|
}
|
905
939
|
}
|
906
|
-
|
907
|
-
|
908
|
-
if (this.context.columnPickerSortStrategy ===
|
909
|
-
SkyDataManagerColumnPickerSortStrategy.SelectedThenAlphabetical) {
|
910
|
-
unselectedColumnOptions.sort((col1, col2) => col1.label.localeCompare(col2.label));
|
911
|
-
formattedColumnOptions = formattedColumnOptions.concat(unselectedColumnOptions);
|
940
|
+
else {
|
941
|
+
formattedColumnOptions.push(formattedColumn);
|
912
942
|
}
|
913
|
-
return formattedColumnOptions;
|
914
943
|
}
|
915
|
-
|
944
|
+
// if column picker sorting is enabled, sort the columns that are not currently displayed
|
945
|
+
// and add them after the currently displayed options
|
946
|
+
if (this.context.columnPickerSortStrategy ===
|
947
|
+
SkyDataManagerColumnPickerSortStrategy.SelectedThenAlphabetical) {
|
948
|
+
unselectedColumnOptions.sort((col1, col2) => col1.label.localeCompare(col2.label));
|
949
|
+
formattedColumnOptions = formattedColumnOptions.concat(unselectedColumnOptions);
|
950
|
+
}
|
951
|
+
return formattedColumnOptions;
|
952
|
+
};
|
916
953
|
SkyDataManagerColumnPickerComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: SkyDataManagerColumnPickerComponent, deps: [{ token: SkyDataManagerColumnPickerContext }, { token: SkyDataManagerService }, { token: i3.SkyModalInstance }], target: i0.ɵɵFactoryTarget.Component });
|
917
|
-
SkyDataManagerColumnPickerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.0", 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: ["ariaRole", "tiledBody"] }, { 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 });
|
954
|
+
SkyDataManagerColumnPickerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.0", 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: ["ariaRole", "tiledBody"] }, { 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", "isActive"] }, { kind: "pipe", type: i11.SkyLibResourcesPipe, name: "skyLibResources" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
918
955
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: SkyDataManagerColumnPickerComponent, decorators: [{
|
919
956
|
type: Component,
|
920
957
|
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"] }]
|