@skyux/list-builder-view-grids 5.0.1 → 5.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -4
- package/bundles/skyux-list-builder-view-grids.umd.js +37 -37
- package/documentation.json +359 -123
- package/esm2015/index.js +21 -0
- package/esm2015/index.js.map +1 -0
- package/esm2015/lib/modules/column-selector/column-selector-context.js +9 -0
- package/esm2015/lib/modules/column-selector/column-selector-context.js.map +1 -0
- package/esm2015/lib/modules/column-selector/column-selector-modal.component.js +41 -0
- package/esm2015/lib/modules/column-selector/column-selector-modal.component.js.map +1 -0
- package/esm2015/lib/modules/column-selector/column-selector-modal.module.js +41 -0
- package/esm2015/lib/modules/column-selector/column-selector-modal.module.js.map +1 -0
- package/esm2015/lib/modules/list-column-selector-action/list-column-selector-action.component.js +136 -0
- package/esm2015/lib/modules/list-column-selector-action/list-column-selector-action.component.js.map +1 -0
- package/esm2015/lib/modules/list-column-selector-action/list-column-selector-action.module.js +47 -0
- package/esm2015/lib/modules/list-column-selector-action/list-column-selector-action.module.js.map +1 -0
- package/esm2015/{modules → lib/modules}/list-column-selector-action/list-column-selector-button.component.js +4 -4
- package/esm2015/lib/modules/list-column-selector-action/list-column-selector-button.component.js.map +1 -0
- package/esm2015/lib/modules/list-view-grid/list-view-grid.component.js +466 -0
- package/esm2015/lib/modules/list-view-grid/list-view-grid.component.js.map +1 -0
- package/esm2015/lib/modules/list-view-grid/list-view-grid.module.js +42 -0
- package/esm2015/lib/modules/list-view-grid/list-view-grid.module.js.map +1 -0
- package/esm2015/lib/modules/list-view-grid/state/columns/columns.orchestrator.js +22 -0
- package/esm2015/lib/modules/list-view-grid/state/columns/columns.orchestrator.js.map +1 -0
- package/esm2015/lib/modules/list-view-grid/state/columns/load.action.js +10 -0
- package/esm2015/lib/modules/list-view-grid/state/columns/load.action.js.map +1 -0
- package/esm2015/lib/modules/list-view-grid/state/displayed-columns/displayed-columns.orchestrator.js +22 -0
- package/esm2015/lib/modules/list-view-grid/state/displayed-columns/displayed-columns.orchestrator.js.map +1 -0
- package/esm2015/lib/modules/list-view-grid/state/displayed-columns/load.action.js +10 -0
- package/esm2015/lib/modules/list-view-grid/state/displayed-columns/load.action.js.map +1 -0
- package/esm2015/lib/modules/list-view-grid/state/grid-state-action.type.js +2 -0
- package/esm2015/lib/modules/list-view-grid/state/grid-state-action.type.js.map +1 -0
- package/esm2015/lib/modules/list-view-grid/state/grid-state.model.js +11 -0
- package/esm2015/lib/modules/list-view-grid/state/grid-state.model.js.map +1 -0
- package/esm2015/lib/modules/list-view-grid/state/grid-state.rxstate.js +19 -0
- package/esm2015/lib/modules/list-view-grid/state/grid-state.rxstate.js.map +1 -0
- package/esm2015/lib/modules/list-view-grid/state/grid-state.state-node.js +27 -0
- package/esm2015/lib/modules/list-view-grid/state/grid-state.state-node.js.map +1 -0
- package/esm2015/lib/modules/list-view-grid/types/list-view-grid-message-type.js +15 -0
- package/esm2015/lib/modules/list-view-grid/types/list-view-grid-message-type.js.map +1 -0
- package/esm2015/lib/modules/list-view-grid/types/list-view-grid-message.js +2 -0
- package/esm2015/lib/modules/list-view-grid/types/list-view-grid-message.js.map +1 -0
- package/esm2015/lib/modules/list-view-grid/types/list-view-grid-row-delete-cancel-args.js +2 -0
- package/esm2015/lib/modules/list-view-grid/types/list-view-grid-row-delete-cancel-args.js.map +1 -0
- package/esm2015/lib/modules/list-view-grid/types/list-view-grid-row-delete-confirm-args.js +2 -0
- package/esm2015/lib/modules/list-view-grid/types/list-view-grid-row-delete-confirm-args.js.map +1 -0
- package/esm2015/lib/modules/shared/sky-list-builder-view-grids-resources.module.js +56 -0
- package/esm2015/lib/modules/shared/sky-list-builder-view-grids-resources.module.js.map +1 -0
- package/esm2015/skyux-list-builder-view-grids.js +2 -2
- package/esm2015/skyux-list-builder-view-grids.js.map +1 -0
- package/esm2015/testing/list-view-grid-fixture-cell.js +1 -1
- package/esm2015/testing/list-view-grid-fixture-cell.js.map +1 -0
- package/esm2015/testing/list-view-grid-fixture-header.js +1 -1
- package/esm2015/testing/list-view-grid-fixture-header.js.map +1 -0
- package/esm2015/testing/list-view-grid-fixture-row.js +1 -1
- package/esm2015/testing/list-view-grid-fixture-row.js.map +1 -0
- package/esm2015/testing/list-view-grid-fixture.js +1 -1
- package/esm2015/testing/list-view-grid-fixture.js.map +1 -0
- package/esm2015/testing/public-api.js +1 -1
- package/esm2015/testing/public-api.js.map +1 -0
- package/esm2015/testing/skyux-list-builder-view-grids-testing.js +1 -1
- package/esm2015/testing/skyux-list-builder-view-grids-testing.js.map +1 -0
- package/fesm2015/skyux-list-builder-view-grids-testing.js.map +1 -1
- package/fesm2015/skyux-list-builder-view-grids.js +222 -222
- package/fesm2015/skyux-list-builder-view-grids.js.map +1 -1
- package/index.d.ts +18 -0
- package/{modules → lib/modules}/column-selector/column-selector-context.d.ts +0 -0
- package/{modules → lib/modules}/column-selector/column-selector-modal.component.d.ts +0 -0
- package/{modules → lib/modules}/column-selector/column-selector-modal.module.d.ts +0 -0
- package/{modules → lib/modules}/list-column-selector-action/list-column-selector-action.component.d.ts +0 -0
- package/{modules → lib/modules}/list-column-selector-action/list-column-selector-action.module.d.ts +0 -0
- package/{modules → lib/modules}/list-column-selector-action/list-column-selector-button.component.d.ts +0 -0
- package/{modules → lib/modules}/list-view-grid/list-view-grid.component.d.ts +3 -3
- package/{modules → lib/modules}/list-view-grid/list-view-grid.module.d.ts +0 -0
- package/{modules → lib/modules}/list-view-grid/state/columns/columns.orchestrator.d.ts +0 -0
- package/{modules → lib/modules}/list-view-grid/state/columns/load.action.d.ts +0 -0
- package/{modules → lib/modules}/list-view-grid/state/displayed-columns/displayed-columns.orchestrator.d.ts +0 -0
- package/{modules → lib/modules}/list-view-grid/state/displayed-columns/load.action.d.ts +0 -0
- package/{modules → lib/modules}/list-view-grid/state/grid-state-action.type.d.ts +0 -0
- package/{modules → lib/modules}/list-view-grid/state/grid-state.model.d.ts +0 -0
- package/{modules → lib/modules}/list-view-grid/state/grid-state.rxstate.d.ts +0 -0
- package/{modules → lib/modules}/list-view-grid/state/grid-state.state-node.d.ts +0 -0
- package/{modules → lib/modules}/list-view-grid/types/list-view-grid-message-type.d.ts +0 -0
- package/{modules → lib/modules}/list-view-grid/types/list-view-grid-message.d.ts +0 -0
- package/{modules → lib/modules}/list-view-grid/types/list-view-grid-row-delete-cancel-args.d.ts +0 -0
- package/{modules → lib/modules}/list-view-grid/types/list-view-grid-row-delete-confirm-args.d.ts +0 -0
- package/{modules → lib/modules}/shared/sky-list-builder-view-grids-resources.module.d.ts +0 -0
- package/package.json +24 -10
- package/skyux-list-builder-view-grids.d.ts +1 -1
- package/LICENSE +0 -21
- package/bundles/skyux-list-builder-view-grids-testing.umd.js.map +0 -1
- package/bundles/skyux-list-builder-view-grids.umd.js.map +0 -1
- package/esm2015/modules/column-selector/column-selector-context.js +0 -9
- package/esm2015/modules/column-selector/column-selector-modal.component.js +0 -39
- package/esm2015/modules/column-selector/column-selector-modal.module.js +0 -41
- package/esm2015/modules/list-column-selector-action/list-column-selector-action.component.js +0 -134
- package/esm2015/modules/list-column-selector-action/list-column-selector-action.module.js +0 -47
- package/esm2015/modules/list-view-grid/list-view-grid.component.js +0 -466
- package/esm2015/modules/list-view-grid/list-view-grid.module.js +0 -42
- package/esm2015/modules/list-view-grid/state/columns/columns.orchestrator.js +0 -22
- package/esm2015/modules/list-view-grid/state/columns/load.action.js +0 -10
- package/esm2015/modules/list-view-grid/state/displayed-columns/displayed-columns.orchestrator.js +0 -22
- package/esm2015/modules/list-view-grid/state/displayed-columns/load.action.js +0 -10
- package/esm2015/modules/list-view-grid/state/grid-state-action.type.js +0 -2
- package/esm2015/modules/list-view-grid/state/grid-state.model.js +0 -11
- package/esm2015/modules/list-view-grid/state/grid-state.rxstate.js +0 -19
- package/esm2015/modules/list-view-grid/state/grid-state.state-node.js +0 -25
- package/esm2015/modules/list-view-grid/types/list-view-grid-message-type.js +0 -15
- package/esm2015/modules/list-view-grid/types/list-view-grid-message.js +0 -2
- package/esm2015/modules/list-view-grid/types/list-view-grid-row-delete-cancel-args.js +0 -2
- package/esm2015/modules/list-view-grid/types/list-view-grid-row-delete-confirm-args.js +0 -2
- package/esm2015/modules/shared/sky-list-builder-view-grids-resources.module.js +0 -56
- package/esm2015/public-api.js +0 -21
- package/public-api.d.ts +0 -18
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { Component, NgModule, EventEmitter,
|
|
3
|
-
import * as
|
|
2
|
+
import { Component, NgModule, Injectable, EventEmitter, forwardRef, ChangeDetectionStrategy, Input, Output, ViewChild, ContentChildren, Optional } from '@angular/core';
|
|
3
|
+
import * as i6 from '@angular/common';
|
|
4
4
|
import { CommonModule } from '@angular/common';
|
|
5
5
|
import * as i2 from '@skyux/modals';
|
|
6
6
|
import { SkyModalModule } from '@skyux/modals';
|
|
7
7
|
import * as i1 from '@skyux/list-builder';
|
|
8
|
-
import { SkyListModule, SkyListToolbarModule,
|
|
8
|
+
import { SkyListModule, SkyListToolbarModule, ListViewComponent, ListSearchModel, ListToolbarItemModel, SkyListSecondaryActionsModule } from '@skyux/list-builder';
|
|
9
9
|
import * as i4 from '@skyux/list-builder-view-checklist';
|
|
10
10
|
import { SkyListViewChecklistModule } from '@skyux/list-builder-view-checklist';
|
|
11
11
|
import * as i5 from '@skyux/i18n';
|
|
12
12
|
import { SkyI18nModule, getLibStringForLocale, SKY_LIB_RESOURCES_PROVIDERS } from '@skyux/i18n';
|
|
13
|
-
import * as
|
|
13
|
+
import * as i5$1 from '@skyux/indicators';
|
|
14
14
|
import { SkyIconModule, SkyWaitModule } from '@skyux/indicators';
|
|
15
|
-
import { map, distinctUntilChanged, take,
|
|
15
|
+
import { map, takeUntil, distinctUntilChanged, take, scan } from 'rxjs/operators';
|
|
16
16
|
import { Subject, of } from 'rxjs';
|
|
17
|
-
import { StateDispatcher, StateOrchestrator,
|
|
18
|
-
import * as i4$
|
|
17
|
+
import { AsyncList, StateDispatcher, StateOrchestrator, StateNode, isObservable, getValue, getData } from '@skyux/list-builder-common';
|
|
18
|
+
import * as i4$1 from '@skyux/grids';
|
|
19
19
|
import { SkyGridColumnModel, SkyGridSelectedRowsSource, SkyGridMessageType, SkyGridColumnComponent, SkyGridComponent, SkyGridModule } from '@skyux/grids';
|
|
20
20
|
|
|
21
21
|
/* istanbul ignore next */
|
|
@@ -49,9 +49,9 @@ class SkyColumnSelectorComponent {
|
|
|
49
49
|
this.instance.save(this.newSelectedColumnIds);
|
|
50
50
|
}
|
|
51
51
|
}
|
|
52
|
-
SkyColumnSelectorComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.
|
|
53
|
-
SkyColumnSelectorComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.
|
|
54
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.
|
|
52
|
+
SkyColumnSelectorComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyColumnSelectorComponent, deps: [{ token: SkyColumnSelectorContext }, { token: i2.SkyModalInstance }], target: i0.ɵɵFactoryTarget.Component });
|
|
53
|
+
SkyColumnSelectorComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: SkyColumnSelectorComponent, selector: "sky-column-selector", ngImport: i0, template: "<sky-modal>\n <sky-modal-header>\n {{ 'skyux_grid_column_picker_header' | skyLibResources }}\n </sky-modal-header>\n <sky-modal-content>\n <sky-list\n #list\n [data]=\"context.columns\"\n [selectedIds]=\"context.selectedColumnIds\"\n (selectedIdsChange)=\"selectedColumnsChange($event)\"\n >\n <sky-list-toolbar\n [placeholder]=\"\n 'skyux_grid_column_picker_search_placeholder' | skyLibResources\n \"\n >\n </sky-list-toolbar>\n\n <sky-list-view-checklist label=\"heading\" description=\"description\">\n </sky-list-view-checklist>\n </sky-list>\n </sky-modal-content>\n <sky-modal-footer>\n <button\n sky-cmp-id=\"apply-changes\"\n class=\"sky-btn sky-btn-primary\"\n (click)=\"applyChanges()\"\n >\n {{ 'skyux_grid_column_picker_submit' | skyLibResources }}\n </button>\n <button\n sky-cmp-id=\"cancel\"\n class=\"sky-btn sky-btn-link\"\n (click)=\"cancelChanges()\"\n >\n {{ 'skyux_grid_column_picker_cancel' | skyLibResources }}\n </button>\n </sky-modal-footer>\n</sky-modal>\n", components: [{ type: i2.λ5, selector: "sky-modal", inputs: ["ariaRole", "tiledBody"] }, { type: i2.λ4, selector: "sky-modal-header" }, { type: i2.λ2, selector: "sky-modal-content" }, { type: i1.SkyListComponent, selector: "sky-list", inputs: ["data", "dataProvider", "defaultView", "initialTotal", "selectedIds", "sortFields", "appliedFilters", "search"], outputs: ["selectedIdsChange", "appliedFiltersChange"] }, { type: i1.SkyListToolbarComponent, selector: "sky-list-toolbar", inputs: ["inMemorySearchEnabled", "placeholder", "searchEnabled", "sortSelectorEnabled", "toolbarType", "searchText"] }, { type: i4.SkyListViewChecklistComponent, selector: "sky-list-view-checklist", inputs: ["name", "search", "label", "description", "selectMode", "showOnlySelected"] }, { type: i2.λ3, selector: "sky-modal-footer" }], pipes: { "skyLibResources": i5.SkyLibResourcesPipe } });
|
|
54
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyColumnSelectorComponent, decorators: [{
|
|
55
55
|
type: Component,
|
|
56
56
|
args: [{
|
|
57
57
|
selector: 'sky-column-selector',
|
|
@@ -61,14 +61,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.13", ngImpo
|
|
|
61
61
|
|
|
62
62
|
class SkyColumnSelectorModule {
|
|
63
63
|
}
|
|
64
|
-
SkyColumnSelectorModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.
|
|
65
|
-
SkyColumnSelectorModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.
|
|
64
|
+
SkyColumnSelectorModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyColumnSelectorModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
65
|
+
SkyColumnSelectorModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyColumnSelectorModule, declarations: [SkyColumnSelectorComponent], imports: [CommonModule,
|
|
66
66
|
SkyI18nModule,
|
|
67
67
|
SkyModalModule,
|
|
68
68
|
SkyListModule,
|
|
69
69
|
SkyListToolbarModule,
|
|
70
70
|
SkyListViewChecklistModule] });
|
|
71
|
-
SkyColumnSelectorModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.
|
|
71
|
+
SkyColumnSelectorModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyColumnSelectorModule, imports: [[
|
|
72
72
|
CommonModule,
|
|
73
73
|
SkyI18nModule,
|
|
74
74
|
SkyModalModule,
|
|
@@ -76,7 +76,7 @@ SkyColumnSelectorModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0",
|
|
|
76
76
|
SkyListToolbarModule,
|
|
77
77
|
SkyListViewChecklistModule,
|
|
78
78
|
]] });
|
|
79
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.
|
|
79
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyColumnSelectorModule, decorators: [{
|
|
80
80
|
type: NgModule,
|
|
81
81
|
args: [{
|
|
82
82
|
declarations: [SkyColumnSelectorComponent],
|
|
@@ -95,194 +95,21 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.13", ngImpo
|
|
|
95
95
|
/**
|
|
96
96
|
* @internal
|
|
97
97
|
*/
|
|
98
|
-
class
|
|
99
|
-
constructor(
|
|
100
|
-
this.columns =
|
|
101
|
-
this.
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
class SkyListColumnSelectorButtonComponent {
|
|
106
|
-
constructor() { }
|
|
107
|
-
}
|
|
108
|
-
SkyListColumnSelectorButtonComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: SkyListColumnSelectorButtonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
109
|
-
SkyListColumnSelectorButtonComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.13", type: SkyListColumnSelectorButtonComponent, selector: "sky-list-column-selector-button", ngImport: i0, template: "<button\n class=\"sky-btn sky-btn-default\"\n type=\"button\"\n [attr.aria-label]=\"'skyux_grid_columns_button' | skyLibResources\"\n [title]=\"'skyux_grid_columns_button' | skyLibResources\"\n>\n <sky-icon icon=\"columns\"></sky-icon>\n <span class=\"sky-column-selector-action-btn-text\">\n {{ 'skyux_grid_columns_toolbar_button' | skyLibResources }}\n </span>\n</button>\n", styles: [":host .sky-column-selector-action-btn-text{display:none}:host-context(.sky-responsive-container-xs) .sky-column-selector-action-btn-text,:host-context(.sky-responsive-container-sm) .sky-column-selector-action-btn-text,:host-context(.sky-responsive-container-md) .sky-column-selector-action-btn-text,:host-context(.sky-responsive-container-lg) .sky-column-selector-action-btn-text{display:none}@media (min-width: 768px){:host .sky-column-selector-action-btn-text{display:inline}}:host-context(.sky-responsive-container-sm) .sky-column-selector-action-btn-text,:host-context(.sky-responsive-container-md) .sky-column-selector-action-btn-text,:host-context(.sky-responsive-container-lg) .sky-column-selector-action-btn-text{display:inline}\n"], components: [{ type: i1$1.λ4, selector: "sky-icon", inputs: ["icon", "iconType", "size", "fixedWidth", "variant"] }], pipes: { "skyLibResources": i5.SkyLibResourcesPipe } });
|
|
110
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: SkyListColumnSelectorButtonComponent, decorators: [{
|
|
111
|
-
type: Component,
|
|
112
|
-
args: [{
|
|
113
|
-
selector: 'sky-list-column-selector-button',
|
|
114
|
-
templateUrl: './list-column-selector-button.component.html',
|
|
115
|
-
styleUrls: ['./list-column-selector-button.component.scss'],
|
|
116
|
-
}]
|
|
117
|
-
}], ctorParameters: function () { return []; } });
|
|
118
|
-
|
|
119
|
-
/**
|
|
120
|
-
* Provides a column selector modal for a list grid view when placed in a
|
|
121
|
-
* [list toolbar](https://developer.blackbaud.com/skyux/components/list/toolbar).
|
|
122
|
-
*/
|
|
123
|
-
class SkyListColumnSelectorActionComponent {
|
|
124
|
-
constructor(listState, modalService, dispatcher, secondaryActions) {
|
|
125
|
-
this.listState = listState;
|
|
126
|
-
this.modalService = modalService;
|
|
127
|
-
this.dispatcher = dispatcher;
|
|
128
|
-
this.secondaryActions = secondaryActions;
|
|
129
|
-
/**
|
|
130
|
-
* Fires when users click the help button and broadcasts the `helpKey`.
|
|
131
|
-
*/
|
|
132
|
-
this.helpOpened = new EventEmitter();
|
|
133
|
-
this.columnSelectorActionItemToolbarIndex = 7000;
|
|
134
|
-
}
|
|
135
|
-
ngAfterContentInit() {
|
|
136
|
-
if (!this.secondaryActions) {
|
|
137
|
-
let columnChooserItem = new ListToolbarItemModel({
|
|
138
|
-
id: 'column-chooser',
|
|
139
|
-
template: this.columnChooserTemplate,
|
|
140
|
-
location: 'left',
|
|
141
|
-
});
|
|
142
|
-
this.dispatcher.toolbarAddItems([columnChooserItem], this.columnSelectorActionItemToolbarIndex);
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
get isInGridView() {
|
|
146
|
-
return this.listState.pipe(map((s) => s.views.active), map((activeView) => {
|
|
147
|
-
return this.gridView && activeView === this.gridView.id;
|
|
148
|
-
}), distinctUntilChanged());
|
|
149
|
-
}
|
|
150
|
-
get isInGridViewAndSecondary() {
|
|
151
|
-
return this.listState.pipe(map((s) => s.views.active), map((activeView) => {
|
|
152
|
-
return (this.secondaryActions &&
|
|
153
|
-
this.gridView &&
|
|
154
|
-
activeView === this.gridView.id);
|
|
155
|
-
}), distinctUntilChanged());
|
|
156
|
-
}
|
|
157
|
-
openColumnSelector() {
|
|
158
|
-
/* istanbul ignore else */
|
|
159
|
-
/* sanity check */
|
|
160
|
-
if (this.gridView) {
|
|
161
|
-
let columns = [];
|
|
162
|
-
let selectedColumnIds = [];
|
|
163
|
-
this.gridView.gridState
|
|
164
|
-
.pipe(take(1))
|
|
165
|
-
.subscribe((state) => {
|
|
166
|
-
columns = state.columns.items
|
|
167
|
-
.filter((item) => {
|
|
168
|
-
return !item.locked;
|
|
169
|
-
})
|
|
170
|
-
.map((item) => {
|
|
171
|
-
return {
|
|
172
|
-
id: item.id,
|
|
173
|
-
heading: item.heading,
|
|
174
|
-
description: item.description,
|
|
175
|
-
};
|
|
176
|
-
});
|
|
177
|
-
selectedColumnIds = state.displayedColumns.items
|
|
178
|
-
.filter((item) => {
|
|
179
|
-
return !item.locked;
|
|
180
|
-
})
|
|
181
|
-
.map((item) => {
|
|
182
|
-
return item.id;
|
|
183
|
-
});
|
|
184
|
-
});
|
|
185
|
-
const modalInstance = this.modalService.open(SkyColumnSelectorComponent, {
|
|
186
|
-
providers: [
|
|
187
|
-
{
|
|
188
|
-
provide: SkyColumnSelectorContext,
|
|
189
|
-
useValue: {
|
|
190
|
-
columns,
|
|
191
|
-
selectedColumnIds,
|
|
192
|
-
},
|
|
193
|
-
},
|
|
194
|
-
],
|
|
195
|
-
helpKey: this.helpKey,
|
|
196
|
-
});
|
|
197
|
-
modalInstance.helpOpened.subscribe((helpKey) => {
|
|
198
|
-
this.helpOpened.emit(helpKey);
|
|
199
|
-
this.helpOpened.complete();
|
|
200
|
-
});
|
|
201
|
-
modalInstance.closed.subscribe((result) => {
|
|
202
|
-
if (result.reason === 'save' && result.data) {
|
|
203
|
-
let newSelectedIds = result.data;
|
|
204
|
-
let newDisplayedColumns = [];
|
|
205
|
-
this.gridView.gridState
|
|
206
|
-
.pipe(take(1))
|
|
207
|
-
.subscribe((state) => {
|
|
208
|
-
newDisplayedColumns = state.columns.items.filter((item) => {
|
|
209
|
-
return newSelectedIds.indexOf(item.id) > -1 || item.locked;
|
|
210
|
-
});
|
|
211
|
-
});
|
|
212
|
-
this.gridView.gridDispatcher.next(new ListViewDisplayedGridColumnsLoadAction(newDisplayedColumns, true));
|
|
213
|
-
}
|
|
214
|
-
});
|
|
215
|
-
}
|
|
98
|
+
class GridStateModel {
|
|
99
|
+
constructor() {
|
|
100
|
+
this.columns = new AsyncList();
|
|
101
|
+
this.displayedColumns = new AsyncList();
|
|
216
102
|
}
|
|
217
103
|
}
|
|
218
|
-
SkyListColumnSelectorActionComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: SkyListColumnSelectorActionComponent, deps: [{ token: i1.ListState }, { token: i2.SkyModalService }, { token: i1.ListStateDispatcher }, { token: i1.SkyListSecondaryActionsComponent, optional: true }], target: i0.ɵɵFactoryTarget.Component });
|
|
219
|
-
SkyListColumnSelectorActionComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.13", type: SkyListColumnSelectorActionComponent, selector: "sky-list-column-selector-action", inputs: { gridView: "gridView", helpKey: "helpKey" }, outputs: { helpOpened: "helpOpened" }, viewQueries: [{ propertyName: "columnChooserTemplate", first: true, predicate: ["columnChooser"], descendants: true, static: true }], ngImport: i0, template: "<ng-container *ngIf=\"isInGridViewAndSecondary | async\">\n <sky-list-secondary-action>\n <button type=\"button\" (click)=\"openColumnSelector()\">\n {{ 'skyux_grid_columns_button' | skyLibResources }}\n </button>\n </sky-list-secondary-action>\n</ng-container>\n\n<ng-template #columnChooser>\n <sky-list-column-selector-button\n *ngIf=\"isInGridView | async\"\n (click)=\"openColumnSelector()\"\n >\n </sky-list-column-selector-button>\n</ng-template>\n", components: [{ type: i1.λ6, selector: "sky-list-secondary-action" }, { type: SkyListColumnSelectorButtonComponent, selector: "sky-list-column-selector-button" }], directives: [{ type: i4$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], pipes: { "async": i4$1.AsyncPipe, "skyLibResources": i5.SkyLibResourcesPipe } });
|
|
220
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: SkyListColumnSelectorActionComponent, decorators: [{
|
|
221
|
-
type: Component,
|
|
222
|
-
args: [{
|
|
223
|
-
selector: 'sky-list-column-selector-action',
|
|
224
|
-
templateUrl: './list-column-selector-action.component.html',
|
|
225
|
-
}]
|
|
226
|
-
}], ctorParameters: function () { return [{ type: i1.ListState }, { type: i2.SkyModalService }, { type: i1.ListStateDispatcher }, { type: i1.SkyListSecondaryActionsComponent, decorators: [{
|
|
227
|
-
type: Optional
|
|
228
|
-
}] }]; }, propDecorators: { gridView: [{
|
|
229
|
-
type: Input
|
|
230
|
-
}], helpKey: [{
|
|
231
|
-
type: Input
|
|
232
|
-
}], helpOpened: [{
|
|
233
|
-
type: Output
|
|
234
|
-
}], columnChooserTemplate: [{
|
|
235
|
-
type: ViewChild,
|
|
236
|
-
args: ['columnChooser', {
|
|
237
|
-
static: true,
|
|
238
|
-
}]
|
|
239
|
-
}] } });
|
|
240
|
-
|
|
241
|
-
class SkyListColumnSelectorActionModule {
|
|
242
|
-
}
|
|
243
|
-
SkyListColumnSelectorActionModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: SkyListColumnSelectorActionModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
244
|
-
SkyListColumnSelectorActionModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: SkyListColumnSelectorActionModule, declarations: [SkyListColumnSelectorActionComponent,
|
|
245
|
-
SkyListColumnSelectorButtonComponent], imports: [CommonModule,
|
|
246
|
-
SkyI18nModule,
|
|
247
|
-
SkyModalModule,
|
|
248
|
-
SkyListSecondaryActionsModule,
|
|
249
|
-
SkyListToolbarModule,
|
|
250
|
-
SkyIconModule], exports: [SkyListColumnSelectorActionComponent, SkyColumnSelectorModule] });
|
|
251
|
-
SkyListColumnSelectorActionModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: SkyListColumnSelectorActionModule, imports: [[
|
|
252
|
-
CommonModule,
|
|
253
|
-
SkyI18nModule,
|
|
254
|
-
SkyModalModule,
|
|
255
|
-
SkyListSecondaryActionsModule,
|
|
256
|
-
SkyListToolbarModule,
|
|
257
|
-
SkyIconModule,
|
|
258
|
-
], SkyColumnSelectorModule] });
|
|
259
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: SkyListColumnSelectorActionModule, decorators: [{
|
|
260
|
-
type: NgModule,
|
|
261
|
-
args: [{
|
|
262
|
-
declarations: [
|
|
263
|
-
SkyListColumnSelectorActionComponent,
|
|
264
|
-
SkyListColumnSelectorButtonComponent,
|
|
265
|
-
],
|
|
266
|
-
imports: [
|
|
267
|
-
CommonModule,
|
|
268
|
-
SkyI18nModule,
|
|
269
|
-
SkyModalModule,
|
|
270
|
-
SkyListSecondaryActionsModule,
|
|
271
|
-
SkyListToolbarModule,
|
|
272
|
-
SkyIconModule,
|
|
273
|
-
],
|
|
274
|
-
exports: [SkyListColumnSelectorActionComponent, SkyColumnSelectorModule],
|
|
275
|
-
}]
|
|
276
|
-
}] });
|
|
277
104
|
|
|
278
105
|
/**
|
|
279
106
|
* @internal
|
|
280
107
|
*/
|
|
281
108
|
class GridStateDispatcher extends StateDispatcher {
|
|
282
109
|
}
|
|
283
|
-
GridStateDispatcher.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.
|
|
284
|
-
GridStateDispatcher.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.
|
|
285
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.
|
|
110
|
+
GridStateDispatcher.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: GridStateDispatcher, deps: null, target: i0.ɵɵFactoryTarget.Injectable });
|
|
111
|
+
GridStateDispatcher.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: GridStateDispatcher });
|
|
112
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: GridStateDispatcher, decorators: [{
|
|
286
113
|
type: Injectable
|
|
287
114
|
}] });
|
|
288
115
|
/**
|
|
@@ -319,6 +146,16 @@ class ListViewGridColumnsOrchestrator extends GridStateOrchestrator {
|
|
|
319
146
|
}
|
|
320
147
|
}
|
|
321
148
|
|
|
149
|
+
/**
|
|
150
|
+
* @internal
|
|
151
|
+
*/
|
|
152
|
+
class ListViewDisplayedGridColumnsLoadAction {
|
|
153
|
+
constructor(columns, refresh = false) {
|
|
154
|
+
this.columns = columns;
|
|
155
|
+
this.refresh = refresh;
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
|
|
322
159
|
/**
|
|
323
160
|
* @internal
|
|
324
161
|
*/
|
|
@@ -337,16 +174,6 @@ class ListViewDisplayedGridColumnsOrchestrator extends GridStateOrchestrator {
|
|
|
337
174
|
}
|
|
338
175
|
}
|
|
339
176
|
|
|
340
|
-
/**
|
|
341
|
-
* @internal
|
|
342
|
-
*/
|
|
343
|
-
class GridStateModel {
|
|
344
|
-
constructor() {
|
|
345
|
-
this.columns = new AsyncList();
|
|
346
|
-
this.displayedColumns = new AsyncList();
|
|
347
|
-
}
|
|
348
|
-
}
|
|
349
|
-
|
|
350
177
|
/**
|
|
351
178
|
* @internal
|
|
352
179
|
*/
|
|
@@ -359,9 +186,9 @@ class GridState extends StateNode {
|
|
|
359
186
|
.begin();
|
|
360
187
|
}
|
|
361
188
|
}
|
|
362
|
-
GridState.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.
|
|
363
|
-
GridState.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.
|
|
364
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.
|
|
189
|
+
GridState.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: GridState, deps: [{ token: GridStateModel }, { token: GridStateDispatcher }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
190
|
+
GridState.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: GridState });
|
|
191
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: GridState, decorators: [{
|
|
365
192
|
type: Injectable
|
|
366
193
|
}], ctorParameters: function () { return [{ type: GridStateModel }, { type: GridStateDispatcher }]; } });
|
|
367
194
|
|
|
@@ -393,10 +220,10 @@ class SkyListViewGridComponent extends ListViewComponent {
|
|
|
393
220
|
this.gridState = gridState;
|
|
394
221
|
this.gridDispatcher = gridDispatcher;
|
|
395
222
|
/**
|
|
396
|
-
* Specifies how the grid fits to its parent. `width` fits the grid to the parent's full
|
|
397
|
-
* width, and `scroll` allows the grid to exceed the parent's width. If the grid does not have
|
|
223
|
+
* Specifies how the grid fits to its parent. `"width"` fits the grid to the parent's full
|
|
224
|
+
* width, and `"scroll"` allows the grid to exceed the parent's width. If the grid does not have
|
|
398
225
|
* enough columns to fill the parent's width, it always stretches to the parent's full width.
|
|
399
|
-
* @default width
|
|
226
|
+
* @default "width"
|
|
400
227
|
*/
|
|
401
228
|
this.fit = 'width';
|
|
402
229
|
/**
|
|
@@ -756,8 +583,8 @@ class SkyListViewGridComponent extends ListViewComponent {
|
|
|
756
583
|
arrayA.every((value, index) => value === arrayB[index]));
|
|
757
584
|
}
|
|
758
585
|
}
|
|
759
|
-
SkyListViewGridComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.
|
|
760
|
-
SkyListViewGridComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.
|
|
586
|
+
SkyListViewGridComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyListViewGridComponent, deps: [{ token: i1.ListState }, { token: i1.ListStateDispatcher }, { token: GridState }, { token: GridStateDispatcher }], target: i0.ɵɵFactoryTarget.Component });
|
|
587
|
+
SkyListViewGridComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: SkyListViewGridComponent, selector: "sky-list-view-grid", inputs: { name: "name", displayedColumns: "displayedColumns", hiddenColumns: "hiddenColumns", fit: "fit", width: "width", height: "height", highlightSearchText: "highlightSearchText", messageStream: "messageStream", rowHighlightedId: "rowHighlightedId", enableMultiselect: "enableMultiselect", settingsKey: "settingsKey", searchFunction: ["search", "searchFunction"] }, outputs: { rowDeleteCancel: "rowDeleteCancel", rowDeleteConfirm: "rowDeleteConfirm", selectedColumnIdsChange: "selectedColumnIdsChange" }, providers: [
|
|
761
588
|
/* tslint:disable */
|
|
762
589
|
{
|
|
763
590
|
provide: ListViewComponent,
|
|
@@ -767,8 +594,8 @@ SkyListViewGridComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0
|
|
|
767
594
|
GridState,
|
|
768
595
|
GridStateDispatcher,
|
|
769
596
|
GridStateModel,
|
|
770
|
-
], queries: [{ propertyName: "columnComponents", predicate: SkyGridColumnComponent }], viewQueries: [{ propertyName: "gridComponent", first: true, predicate: SkyGridComponent, descendants: true }], usesInheritance: true, ngImport: i0, template: "<div *ngIf=\"active | async\">\n <sky-grid\n [columns]=\"columns | async\"\n [data]=\"items | async\"\n [enableMultiselect]=\"enableMultiselect\"\n [fit]=\"fit\"\n [height]=\"gridHeight | async\"\n [highlightText]=\"\n highlightSearchText ? (currentSearchText | async) : undefined\n \"\n [rowHighlightedId]=\"rowHighlightedId\"\n [messageStream]=\"gridMessageStream\"\n [selectedColumnIds]=\"selectedColumnIds | async\"\n [selectedRowIds]=\"multiselectSelectedIds\"\n [settingsKey]=\"settingsKey\"\n [sortField]=\"sortField | async\"\n [width]=\"gridWidth | async\"\n (multiselectSelectionChange)=\"onMultiselectSelectionChange($event)\"\n (rowDeleteCancel)=\"cancelRowDelete($event)\"\n (rowDeleteConfirm)=\"confirmRowDelete($event)\"\n (selectedColumnIdsChange)=\"columnIdsChanged($event)\"\n (sortFieldChange)=\"sortFieldChanged($event)\"\n #skyGrid\n >\n </sky-grid>\n <sky-wait [isWaiting]=\"loading | async\"> </sky-wait>\n</div>\n", styles: [":host ::ng-deep .sky-grid-heading{border-top:0!important}\n"], components: [{ type: i4$
|
|
771
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.
|
|
597
|
+
], queries: [{ propertyName: "columnComponents", predicate: SkyGridColumnComponent }], viewQueries: [{ propertyName: "gridComponent", first: true, predicate: SkyGridComponent, descendants: true }], usesInheritance: true, ngImport: i0, template: "<div *ngIf=\"active | async\">\n <sky-grid\n [columns]=\"columns | async\"\n [data]=\"items | async\"\n [enableMultiselect]=\"enableMultiselect\"\n [fit]=\"fit\"\n [height]=\"gridHeight | async\"\n [highlightText]=\"\n highlightSearchText ? (currentSearchText | async) : undefined\n \"\n [rowHighlightedId]=\"rowHighlightedId\"\n [messageStream]=\"gridMessageStream\"\n [selectedColumnIds]=\"selectedColumnIds | async\"\n [selectedRowIds]=\"multiselectSelectedIds\"\n [settingsKey]=\"settingsKey\"\n [sortField]=\"sortField | async\"\n [width]=\"gridWidth | async\"\n (multiselectSelectionChange)=\"onMultiselectSelectionChange($event)\"\n (rowDeleteCancel)=\"cancelRowDelete($event)\"\n (rowDeleteConfirm)=\"confirmRowDelete($event)\"\n (selectedColumnIdsChange)=\"columnIdsChanged($event)\"\n (sortFieldChange)=\"sortFieldChanged($event)\"\n #skyGrid\n >\n </sky-grid>\n <sky-wait [isWaiting]=\"loading | async\"> </sky-wait>\n</div>\n", styles: [":host ::ng-deep .sky-grid-heading{border-top:0!important}\n"], components: [{ type: i4$1.SkyGridComponent, selector: "sky-grid", inputs: ["columns", "data", "enableMultiselect", "fit", "hasToolbar", "height", "highlightText", "messageStream", "multiselectRowId", "rowHighlightedId", "selectedColumnIds", "selectedRowIds", "settingsKey", "sortField", "width"], outputs: ["columnWidthChange", "multiselectSelectionChange", "rowDeleteCancel", "rowDeleteConfirm", "selectedColumnIdsChange", "sortFieldChange"] }, { type: i5$1.λ14, selector: "sky-wait", inputs: ["ariaLabel", "isWaiting", "isFullPage", "isNonBlocking"] }], directives: [{ type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], pipes: { "async": i6.AsyncPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
598
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyListViewGridComponent, decorators: [{
|
|
772
599
|
type: Component,
|
|
773
600
|
args: [{
|
|
774
601
|
selector: 'sky-list-view-grid',
|
|
@@ -826,6 +653,179 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.13", ngImpo
|
|
|
826
653
|
args: [SkyGridColumnComponent]
|
|
827
654
|
}] } });
|
|
828
655
|
|
|
656
|
+
class SkyListColumnSelectorButtonComponent {
|
|
657
|
+
constructor() { }
|
|
658
|
+
}
|
|
659
|
+
SkyListColumnSelectorButtonComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyListColumnSelectorButtonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
660
|
+
SkyListColumnSelectorButtonComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: SkyListColumnSelectorButtonComponent, selector: "sky-list-column-selector-button", ngImport: i0, template: "<button\n class=\"sky-btn sky-btn-default\"\n type=\"button\"\n [attr.aria-label]=\"'skyux_grid_columns_button' | skyLibResources\"\n [title]=\"'skyux_grid_columns_button' | skyLibResources\"\n>\n <sky-icon icon=\"columns\"></sky-icon>\n <span class=\"sky-column-selector-action-btn-text\">\n {{ 'skyux_grid_columns_toolbar_button' | skyLibResources }}\n </span>\n</button>\n", styles: [":host .sky-column-selector-action-btn-text{display:none}:host-context(.sky-responsive-container-xs) .sky-column-selector-action-btn-text,:host-context(.sky-responsive-container-sm) .sky-column-selector-action-btn-text,:host-context(.sky-responsive-container-md) .sky-column-selector-action-btn-text,:host-context(.sky-responsive-container-lg) .sky-column-selector-action-btn-text{display:none}@media (min-width: 768px){:host .sky-column-selector-action-btn-text{display:inline}}:host-context(.sky-responsive-container-sm) .sky-column-selector-action-btn-text,:host-context(.sky-responsive-container-md) .sky-column-selector-action-btn-text,:host-context(.sky-responsive-container-lg) .sky-column-selector-action-btn-text{display:inline}\n"], components: [{ type: i5$1.λ4, selector: "sky-icon", inputs: ["icon", "iconType", "size", "fixedWidth", "variant"] }], pipes: { "skyLibResources": i5.SkyLibResourcesPipe } });
|
|
661
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyListColumnSelectorButtonComponent, decorators: [{
|
|
662
|
+
type: Component,
|
|
663
|
+
args: [{
|
|
664
|
+
selector: 'sky-list-column-selector-button',
|
|
665
|
+
templateUrl: './list-column-selector-button.component.html',
|
|
666
|
+
styleUrls: ['./list-column-selector-button.component.scss'],
|
|
667
|
+
}]
|
|
668
|
+
}], ctorParameters: function () { return []; } });
|
|
669
|
+
|
|
670
|
+
/**
|
|
671
|
+
* Provides a column selector modal for a list grid view when placed in a
|
|
672
|
+
* [list toolbar](https://developer.blackbaud.com/skyux/components/list/toolbar).
|
|
673
|
+
*/
|
|
674
|
+
class SkyListColumnSelectorActionComponent {
|
|
675
|
+
constructor(listState, modalService, dispatcher, secondaryActions) {
|
|
676
|
+
this.listState = listState;
|
|
677
|
+
this.modalService = modalService;
|
|
678
|
+
this.dispatcher = dispatcher;
|
|
679
|
+
this.secondaryActions = secondaryActions;
|
|
680
|
+
/**
|
|
681
|
+
* Fires when users click the help button and broadcasts the `helpKey`.
|
|
682
|
+
*/
|
|
683
|
+
this.helpOpened = new EventEmitter();
|
|
684
|
+
this.columnSelectorActionItemToolbarIndex = 7000;
|
|
685
|
+
}
|
|
686
|
+
ngAfterContentInit() {
|
|
687
|
+
if (!this.secondaryActions) {
|
|
688
|
+
let columnChooserItem = new ListToolbarItemModel({
|
|
689
|
+
id: 'column-chooser',
|
|
690
|
+
template: this.columnChooserTemplate,
|
|
691
|
+
location: 'left',
|
|
692
|
+
});
|
|
693
|
+
this.dispatcher.toolbarAddItems([columnChooserItem], this.columnSelectorActionItemToolbarIndex);
|
|
694
|
+
}
|
|
695
|
+
}
|
|
696
|
+
get isInGridView() {
|
|
697
|
+
return this.listState.pipe(map((s) => s.views.active), map((activeView) => {
|
|
698
|
+
return this.gridView && activeView === this.gridView.id;
|
|
699
|
+
}), distinctUntilChanged());
|
|
700
|
+
}
|
|
701
|
+
get isInGridViewAndSecondary() {
|
|
702
|
+
return this.listState.pipe(map((s) => s.views.active), map((activeView) => {
|
|
703
|
+
return (this.secondaryActions &&
|
|
704
|
+
this.gridView &&
|
|
705
|
+
activeView === this.gridView.id);
|
|
706
|
+
}), distinctUntilChanged());
|
|
707
|
+
}
|
|
708
|
+
openColumnSelector() {
|
|
709
|
+
/* istanbul ignore else */
|
|
710
|
+
/* sanity check */
|
|
711
|
+
if (this.gridView) {
|
|
712
|
+
let columns = [];
|
|
713
|
+
let selectedColumnIds = [];
|
|
714
|
+
this.gridView.gridState
|
|
715
|
+
.pipe(take(1))
|
|
716
|
+
.subscribe((state) => {
|
|
717
|
+
columns = state.columns.items
|
|
718
|
+
.filter((item) => {
|
|
719
|
+
return !item.locked;
|
|
720
|
+
})
|
|
721
|
+
.map((item) => {
|
|
722
|
+
return {
|
|
723
|
+
id: item.id,
|
|
724
|
+
heading: item.heading,
|
|
725
|
+
description: item.description,
|
|
726
|
+
};
|
|
727
|
+
});
|
|
728
|
+
selectedColumnIds = state.displayedColumns.items
|
|
729
|
+
.filter((item) => {
|
|
730
|
+
return !item.locked;
|
|
731
|
+
})
|
|
732
|
+
.map((item) => {
|
|
733
|
+
return item.id;
|
|
734
|
+
});
|
|
735
|
+
});
|
|
736
|
+
const modalInstance = this.modalService.open(SkyColumnSelectorComponent, {
|
|
737
|
+
providers: [
|
|
738
|
+
{
|
|
739
|
+
provide: SkyColumnSelectorContext,
|
|
740
|
+
useValue: {
|
|
741
|
+
columns,
|
|
742
|
+
selectedColumnIds,
|
|
743
|
+
},
|
|
744
|
+
},
|
|
745
|
+
],
|
|
746
|
+
helpKey: this.helpKey,
|
|
747
|
+
});
|
|
748
|
+
modalInstance.helpOpened.subscribe((helpKey) => {
|
|
749
|
+
this.helpOpened.emit(helpKey);
|
|
750
|
+
this.helpOpened.complete();
|
|
751
|
+
});
|
|
752
|
+
modalInstance.closed.subscribe((result) => {
|
|
753
|
+
if (result.reason === 'save' && result.data) {
|
|
754
|
+
let newSelectedIds = result.data;
|
|
755
|
+
let newDisplayedColumns = [];
|
|
756
|
+
this.gridView.gridState
|
|
757
|
+
.pipe(take(1))
|
|
758
|
+
.subscribe((state) => {
|
|
759
|
+
newDisplayedColumns = state.columns.items.filter((item) => {
|
|
760
|
+
return newSelectedIds.indexOf(item.id) > -1 || item.locked;
|
|
761
|
+
});
|
|
762
|
+
});
|
|
763
|
+
this.gridView.gridDispatcher.next(new ListViewDisplayedGridColumnsLoadAction(newDisplayedColumns, true));
|
|
764
|
+
}
|
|
765
|
+
});
|
|
766
|
+
}
|
|
767
|
+
}
|
|
768
|
+
}
|
|
769
|
+
SkyListColumnSelectorActionComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyListColumnSelectorActionComponent, deps: [{ token: i1.ListState }, { token: i2.SkyModalService }, { token: i1.ListStateDispatcher }, { token: i1.SkyListSecondaryActionsComponent, optional: true }], target: i0.ɵɵFactoryTarget.Component });
|
|
770
|
+
SkyListColumnSelectorActionComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: SkyListColumnSelectorActionComponent, selector: "sky-list-column-selector-action", inputs: { gridView: "gridView", helpKey: "helpKey" }, outputs: { helpOpened: "helpOpened" }, viewQueries: [{ propertyName: "columnChooserTemplate", first: true, predicate: ["columnChooser"], descendants: true, static: true }], ngImport: i0, template: "<ng-container *ngIf=\"isInGridViewAndSecondary | async\">\n <sky-list-secondary-action>\n <button type=\"button\" (click)=\"openColumnSelector()\">\n {{ 'skyux_grid_columns_button' | skyLibResources }}\n </button>\n </sky-list-secondary-action>\n</ng-container>\n\n<ng-template #columnChooser>\n <sky-list-column-selector-button\n *ngIf=\"isInGridView | async\"\n (click)=\"openColumnSelector()\"\n >\n </sky-list-column-selector-button>\n</ng-template>\n", components: [{ type: i1.λ6, selector: "sky-list-secondary-action" }, { type: SkyListColumnSelectorButtonComponent, selector: "sky-list-column-selector-button" }], directives: [{ type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], pipes: { "async": i6.AsyncPipe, "skyLibResources": i5.SkyLibResourcesPipe } });
|
|
771
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyListColumnSelectorActionComponent, decorators: [{
|
|
772
|
+
type: Component,
|
|
773
|
+
args: [{
|
|
774
|
+
selector: 'sky-list-column-selector-action',
|
|
775
|
+
templateUrl: './list-column-selector-action.component.html',
|
|
776
|
+
}]
|
|
777
|
+
}], ctorParameters: function () { return [{ type: i1.ListState }, { type: i2.SkyModalService }, { type: i1.ListStateDispatcher }, { type: i1.SkyListSecondaryActionsComponent, decorators: [{
|
|
778
|
+
type: Optional
|
|
779
|
+
}] }]; }, propDecorators: { gridView: [{
|
|
780
|
+
type: Input
|
|
781
|
+
}], helpKey: [{
|
|
782
|
+
type: Input
|
|
783
|
+
}], helpOpened: [{
|
|
784
|
+
type: Output
|
|
785
|
+
}], columnChooserTemplate: [{
|
|
786
|
+
type: ViewChild,
|
|
787
|
+
args: ['columnChooser', {
|
|
788
|
+
static: true,
|
|
789
|
+
}]
|
|
790
|
+
}] } });
|
|
791
|
+
|
|
792
|
+
class SkyListColumnSelectorActionModule {
|
|
793
|
+
}
|
|
794
|
+
SkyListColumnSelectorActionModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyListColumnSelectorActionModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
795
|
+
SkyListColumnSelectorActionModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyListColumnSelectorActionModule, declarations: [SkyListColumnSelectorActionComponent,
|
|
796
|
+
SkyListColumnSelectorButtonComponent], imports: [CommonModule,
|
|
797
|
+
SkyI18nModule,
|
|
798
|
+
SkyModalModule,
|
|
799
|
+
SkyListSecondaryActionsModule,
|
|
800
|
+
SkyListToolbarModule,
|
|
801
|
+
SkyIconModule], exports: [SkyListColumnSelectorActionComponent, SkyColumnSelectorModule] });
|
|
802
|
+
SkyListColumnSelectorActionModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyListColumnSelectorActionModule, imports: [[
|
|
803
|
+
CommonModule,
|
|
804
|
+
SkyI18nModule,
|
|
805
|
+
SkyModalModule,
|
|
806
|
+
SkyListSecondaryActionsModule,
|
|
807
|
+
SkyListToolbarModule,
|
|
808
|
+
SkyIconModule,
|
|
809
|
+
], SkyColumnSelectorModule] });
|
|
810
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyListColumnSelectorActionModule, decorators: [{
|
|
811
|
+
type: NgModule,
|
|
812
|
+
args: [{
|
|
813
|
+
declarations: [
|
|
814
|
+
SkyListColumnSelectorActionComponent,
|
|
815
|
+
SkyListColumnSelectorButtonComponent,
|
|
816
|
+
],
|
|
817
|
+
imports: [
|
|
818
|
+
CommonModule,
|
|
819
|
+
SkyI18nModule,
|
|
820
|
+
SkyModalModule,
|
|
821
|
+
SkyListSecondaryActionsModule,
|
|
822
|
+
SkyListToolbarModule,
|
|
823
|
+
SkyIconModule,
|
|
824
|
+
],
|
|
825
|
+
exports: [SkyListColumnSelectorActionComponent, SkyColumnSelectorModule],
|
|
826
|
+
}]
|
|
827
|
+
}] });
|
|
828
|
+
|
|
829
829
|
/**
|
|
830
830
|
* NOTICE: DO NOT MODIFY THIS FILE!
|
|
831
831
|
* The contents of this file were automatically generated by
|
|
@@ -856,16 +856,16 @@ class SkyListBuilderViewGridsResourcesProvider {
|
|
|
856
856
|
*/
|
|
857
857
|
class SkyListBuilderViewGridsResourcesModule {
|
|
858
858
|
}
|
|
859
|
-
SkyListBuilderViewGridsResourcesModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.
|
|
860
|
-
SkyListBuilderViewGridsResourcesModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.
|
|
861
|
-
SkyListBuilderViewGridsResourcesModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.
|
|
859
|
+
SkyListBuilderViewGridsResourcesModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyListBuilderViewGridsResourcesModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
860
|
+
SkyListBuilderViewGridsResourcesModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyListBuilderViewGridsResourcesModule, exports: [SkyI18nModule] });
|
|
861
|
+
SkyListBuilderViewGridsResourcesModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyListBuilderViewGridsResourcesModule, providers: [
|
|
862
862
|
{
|
|
863
863
|
provide: SKY_LIB_RESOURCES_PROVIDERS,
|
|
864
864
|
useClass: SkyListBuilderViewGridsResourcesProvider,
|
|
865
865
|
multi: true,
|
|
866
866
|
},
|
|
867
867
|
], imports: [SkyI18nModule] });
|
|
868
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.
|
|
868
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyListBuilderViewGridsResourcesModule, decorators: [{
|
|
869
869
|
type: NgModule,
|
|
870
870
|
args: [{
|
|
871
871
|
exports: [SkyI18nModule],
|
|
@@ -881,21 +881,21 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.13", ngImpo
|
|
|
881
881
|
|
|
882
882
|
class SkyListViewGridModule {
|
|
883
883
|
}
|
|
884
|
-
SkyListViewGridModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.
|
|
885
|
-
SkyListViewGridModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.
|
|
884
|
+
SkyListViewGridModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyListViewGridModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
885
|
+
SkyListViewGridModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyListViewGridModule, declarations: [SkyListViewGridComponent], imports: [CommonModule,
|
|
886
886
|
SkyWaitModule,
|
|
887
887
|
SkyGridModule,
|
|
888
888
|
SkyListBuilderViewGridsResourcesModule], exports: [SkyListViewGridComponent,
|
|
889
889
|
SkyListColumnSelectorActionModule,
|
|
890
890
|
SkyGridModule] });
|
|
891
|
-
SkyListViewGridModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.
|
|
891
|
+
SkyListViewGridModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyListViewGridModule, imports: [[
|
|
892
892
|
CommonModule,
|
|
893
893
|
SkyWaitModule,
|
|
894
894
|
SkyGridModule,
|
|
895
895
|
SkyListBuilderViewGridsResourcesModule,
|
|
896
896
|
], SkyListColumnSelectorActionModule,
|
|
897
897
|
SkyGridModule] });
|
|
898
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.
|
|
898
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyListViewGridModule, decorators: [{
|
|
899
899
|
type: NgModule,
|
|
900
900
|
args: [{
|
|
901
901
|
declarations: [SkyListViewGridComponent],
|