@skyux/data-manager 7.0.0-beta.0 → 7.0.0-beta.10
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 +12 -4
- package/package.json +9 -9
package/documentation.json
CHANGED
@@ -45,7 +45,7 @@
|
|
45
45
|
"id": 238,
|
46
46
|
"name": "None",
|
47
47
|
"kind": 16,
|
48
|
-
"kindString": "Enumeration
|
48
|
+
"kindString": "Enumeration Member",
|
49
49
|
"flags": {},
|
50
50
|
"comment": {
|
51
51
|
"shortText": "No sorting is applied to the columns."
|
@@ -57,13 +57,17 @@
|
|
57
57
|
"character": 2
|
58
58
|
}
|
59
59
|
],
|
60
|
+
"type": {
|
61
|
+
"type": "literal",
|
62
|
+
"value": "none"
|
63
|
+
},
|
60
64
|
"defaultValue": "\"none\""
|
61
65
|
},
|
62
66
|
{
|
63
67
|
"id": 239,
|
64
68
|
"name": "SelectedThenAlphabetical",
|
65
69
|
"kind": 16,
|
66
|
-
"kindString": "Enumeration
|
70
|
+
"kindString": "Enumeration Member",
|
67
71
|
"flags": {},
|
68
72
|
"comment": {
|
69
73
|
"shortText": "If `sortEnabled` is set to `true`, then the selected columns are displayed before the unselected columns. Unselected columns are sorted alphabetically.\nIf `sortEnabled` is set to `false`, then the columns are displayed in the order specified by `columnOptions`."
|
@@ -75,12 +79,16 @@
|
|
75
79
|
"character": 2
|
76
80
|
}
|
77
81
|
],
|
82
|
+
"type": {
|
83
|
+
"type": "literal",
|
84
|
+
"value": "selectedThenAlphabetical"
|
85
|
+
},
|
78
86
|
"defaultValue": "\"selectedThenAlphabetical\""
|
79
87
|
}
|
80
88
|
],
|
81
89
|
"groups": [
|
82
90
|
{
|
83
|
-
"title": "Enumeration
|
91
|
+
"title": "Enumeration Members",
|
84
92
|
"kind": 16,
|
85
93
|
"children": [
|
86
94
|
238,
|
@@ -4934,7 +4942,7 @@
|
|
4934
4942
|
{
|
4935
4943
|
"fileName": "data-view-grid.component.ts",
|
4936
4944
|
"filePath": "/projects/data-manager/documentation/code-examples/data-manager/basic/data-view-grid.component.ts",
|
4937
|
-
"rawContents": "import {\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n Input,\n OnInit,\n} from '@angular/core';\nimport { SkyAgGridService, SkyCellType } from '@skyux/ag-grid';\nimport {\n SkyDataManagerService,\n SkyDataManagerState,\n SkyDataViewConfig,\n} from '@skyux/data-manager';\n\nimport {\n ColDef,\n ColumnApi,\n ColumnState,\n GridApi,\n GridOptions,\n GridReadyEvent,\n RowSelectedEvent,\n} from 'ag-grid-community';\n\n@Component({\n selector: 'app-data-view-grid-demo',\n templateUrl: './data-view-grid.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class DataViewGridDemoComponent implements OnInit {\n @Input()\n public items: any[] = [];\n\n public viewId = 'gridView';\n\n public columnDefs: ColDef[] = [\n {\n colId: 'selected',\n field: 'selected',\n headerName: '',\n maxWidth: 50,\n type: SkyCellType.RowSelector,\n suppressMovable: true,\n lockPosition: true,\n lockVisible: true,\n },\n {\n colId: 'name',\n field: 'name',\n headerName: 'Fruit name',\n width: 150,\n },\n {\n colId: 'description',\n field: 'description',\n headerName: 'Description',\n },\n ];\n\n public dataState = new SkyDataManagerState({});\n\n public viewConfig: SkyDataViewConfig = {\n id: this.viewId,\n name: 'Grid View',\n icon: 'table',\n searchEnabled: true,\n sortEnabled: true,\n multiselectToolbarEnabled: true,\n columnPickerEnabled: true,\n filterButtonEnabled: true,\n columnOptions: [\n {\n id: 'selected',\n alwaysDisplayed: true,\n label: 'selected',\n },\n {\n id: 'name',\n label: 'Fruit name',\n description: 'The name of the fruit.',\n },\n {\n id: 'description',\n label: 'Description',\n description: 'Some information about the fruit.',\n },\n ],\n };\n\n public columnApi?: ColumnApi;\n public displayedItems: any[] = [];\n public gridApi?: GridApi;\n public gridInitialized = false;\n public gridOptions!: GridOptions;\n public noRowsTemplate
|
4945
|
+
"rawContents": "import {\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n Input,\n OnInit,\n} from '@angular/core';\nimport { SkyAgGridService, SkyCellType } from '@skyux/ag-grid';\nimport {\n SkyDataManagerService,\n SkyDataManagerState,\n SkyDataViewConfig,\n} from '@skyux/data-manager';\n\nimport {\n ColDef,\n ColumnApi,\n ColumnState,\n GridApi,\n GridOptions,\n GridReadyEvent,\n RowSelectedEvent,\n} from 'ag-grid-community';\n\n@Component({\n selector: 'app-data-view-grid-demo',\n templateUrl: './data-view-grid.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class DataViewGridDemoComponent implements OnInit {\n @Input()\n public items: any[] = [];\n\n public viewId = 'gridView';\n\n public columnDefs: ColDef[] = [\n {\n colId: 'selected',\n field: 'selected',\n headerName: '',\n maxWidth: 50,\n type: SkyCellType.RowSelector,\n suppressMovable: true,\n lockPosition: true,\n lockVisible: true,\n },\n {\n colId: 'name',\n field: 'name',\n headerName: 'Fruit name',\n width: 150,\n },\n {\n colId: 'description',\n field: 'description',\n headerName: 'Description',\n },\n ];\n\n public dataState = new SkyDataManagerState({});\n\n public viewConfig: SkyDataViewConfig = {\n id: this.viewId,\n name: 'Grid View',\n icon: 'table',\n searchEnabled: true,\n sortEnabled: true,\n multiselectToolbarEnabled: true,\n columnPickerEnabled: true,\n filterButtonEnabled: true,\n columnOptions: [\n {\n id: 'selected',\n alwaysDisplayed: true,\n label: 'selected',\n },\n {\n id: 'name',\n label: 'Fruit name',\n description: 'The name of the fruit.',\n },\n {\n id: 'description',\n label: 'Description',\n description: 'Some information about the fruit.',\n },\n ],\n };\n\n public columnApi?: ColumnApi;\n public displayedItems: any[] = [];\n public gridApi?: GridApi;\n public gridInitialized = false;\n public gridOptions!: GridOptions;\n public noRowsTemplate = `<div class=\"sky-font-deemphasized\">No results found.</div>`;\n public isActive = false;\n\n constructor(\n private agGridService: SkyAgGridService,\n private changeDetector: ChangeDetectorRef,\n private dataManagerService: SkyDataManagerService\n ) {}\n\n public ngOnInit(): void {\n this.displayedItems = this.items;\n\n this.dataManagerService.initDataView(this.viewConfig);\n\n this.gridOptions = this.agGridService.getGridOptions({\n gridOptions: {\n columnDefs: this.columnDefs,\n onGridReady: this.onGridReady.bind(this),\n },\n });\n\n this.dataManagerService\n .getDataStateUpdates(this.viewId)\n .subscribe((state) => {\n this.dataState = state;\n this.setInitialColumnOrder();\n this.updateData();\n this.changeDetector.detectChanges();\n });\n\n this.dataManagerService.getActiveViewIdUpdates().subscribe((id) => {\n this.isActive = id === this.viewId;\n this.changeDetector.detectChanges();\n });\n }\n\n public updateData(): void {\n this.sortItems();\n this.displayedItems = this.filterItems(this.searchItems(this.items));\n\n if (this.dataState.onlyShowSelected) {\n this.displayedItems = this.displayedItems.filter((item) => item.selected);\n }\n\n if (this.displayedItems.length > 0) {\n this.gridApi?.hideOverlay();\n } else {\n this.gridApi?.showNoRowsOverlay();\n }\n }\n\n public setInitialColumnOrder(): void {\n const viewState = this.dataState.getViewStateById(this.viewId);\n const visibleColumns = viewState.displayedColumnIds;\n\n this.columnDefs.sort((col1, col2) => {\n const col1Index = visibleColumns.findIndex(\n (colId: string) => colId === col1.colId\n );\n const col2Index = visibleColumns.findIndex(\n (colId: string) => colId === col2.colId\n );\n\n if (col1Index === -1) {\n col1.hide = true;\n return 0;\n } else if (col2Index === -1) {\n col2.hide = true;\n return 0;\n } else {\n return col1Index - col2Index;\n }\n });\n\n this.gridInitialized = true;\n }\n\n public onGridReady(event: GridReadyEvent): void {\n this.columnApi = event.columnApi;\n this.gridApi = event.api;\n this.gridApi.sizeColumnsToFit();\n this.updateData();\n }\n\n public onRowSelected(rowSelectedEvent: RowSelectedEvent): void {\n if (!rowSelectedEvent.data.selected) {\n this.updateData();\n }\n }\n\n public sortItems(): void {\n const sortOption = this.dataState.activeSortOption;\n if (this.columnApi && sortOption) {\n const sort: ColumnState[] = [\n {\n colId: sortOption.propertyName,\n sort: sortOption.descending ? 'desc' : 'asc',\n },\n ];\n\n this.columnApi.applyColumnState({\n state: sort,\n });\n }\n }\n\n public searchItems(items: any[]): any[] {\n let searchedItems = items;\n const searchText = this.dataState && this.dataState.searchText;\n\n if (searchText) {\n searchedItems = items.filter(function (item: any) {\n let property: any;\n\n for (property in item) {\n if (\n Object.prototype.hasOwnProperty.call(item, property) &&\n (property === 'name' || property === 'description')\n ) {\n const propertyText = item[property].toLowerCase();\n if (propertyText.indexOf(searchText) > -1) {\n return true;\n }\n }\n }\n\n return false;\n });\n }\n return searchedItems;\n }\n\n public filterItems(items: any[]): any[] {\n let filteredItems = items;\n const filterData = this.dataState && this.dataState.filterData;\n\n if (filterData && filterData.filters) {\n const filters = filterData.filters;\n filteredItems = items.filter((item: any) => {\n return (\n ((filters.hideOrange && item.color !== 'orange') ||\n !filters.hideOrange) &&\n ((filters.type !== 'any' && item.type === filters.type) ||\n !filters.type ||\n filters.type === 'any')\n );\n });\n }\n\n return filteredItems;\n }\n}\n"
|
4938
4946
|
},
|
4939
4947
|
{
|
4940
4948
|
"fileName": "data-view-repeater.component.html",
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@skyux/data-manager",
|
3
|
-
"version": "7.0.0-beta.
|
3
|
+
"version": "7.0.0-beta.10",
|
4
4
|
"author": "Blackbaud, Inc.",
|
5
5
|
"keywords": [
|
6
6
|
"blackbaud",
|
@@ -35,14 +35,14 @@
|
|
35
35
|
"@angular/common": "^14.2.0",
|
36
36
|
"@angular/core": "^14.2.0",
|
37
37
|
"@angular/forms": "^14.2.0",
|
38
|
-
"@skyux/core": "7.0.0-beta.
|
39
|
-
"@skyux/forms": "7.0.0-beta.
|
40
|
-
"@skyux/i18n": "7.0.0-beta.
|
41
|
-
"@skyux/indicators": "7.0.0-beta.
|
42
|
-
"@skyux/layout": "7.0.0-beta.
|
43
|
-
"@skyux/lists": "7.0.0-beta.
|
44
|
-
"@skyux/lookup": "7.0.0-beta.
|
45
|
-
"@skyux/modals": "7.0.0-beta.
|
38
|
+
"@skyux/core": "7.0.0-beta.10",
|
39
|
+
"@skyux/forms": "7.0.0-beta.10",
|
40
|
+
"@skyux/i18n": "7.0.0-beta.10",
|
41
|
+
"@skyux/indicators": "7.0.0-beta.10",
|
42
|
+
"@skyux/layout": "7.0.0-beta.10",
|
43
|
+
"@skyux/lists": "7.0.0-beta.10",
|
44
|
+
"@skyux/lookup": "7.0.0-beta.10",
|
45
|
+
"@skyux/modals": "7.0.0-beta.10"
|
46
46
|
},
|
47
47
|
"dependencies": {
|
48
48
|
"tslib": "^2.3.1"
|