@skyux/ag-grid 4.12.1 → 4.12.2
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/CHANGELOG.md +4 -0
- package/bundles/skyux-ag-grid.umd.js +34 -6
- package/bundles/skyux-ag-grid.umd.js.map +1 -1
- package/bundles/skyux-ag-grid.umd.min.js +2 -2
- package/bundles/skyux-ag-grid.umd.min.js.map +1 -1
- package/esm2015/modules/ag-grid/ag-grid-data-manager-adapter.directive.js +34 -8
- package/esm5/modules/ag-grid/ag-grid-data-manager-adapter.directive.js +36 -8
- package/fesm2015/skyux-ag-grid.js +33 -7
- package/fesm2015/skyux-ag-grid.js.map +1 -1
- package/fesm5/skyux-ag-grid.js +35 -7
- package/fesm5/skyux-ag-grid.js.map +1 -1
- package/modules/ag-grid/ag-grid-data-manager-adapter.directive.d.ts +2 -0
- package/package.json +1 -1
- package/skyux-ag-grid.metadata.json +1 -1
package/fesm5/skyux-ag-grid.js
CHANGED
|
@@ -7,7 +7,7 @@ import { SkyDataManagerService, SkyDataManagerModule } from '@skyux/data-manager
|
|
|
7
7
|
import { SkyInlineDeleteModule } from '@skyux/layout';
|
|
8
8
|
import { SkyLibResourcesService, getStringForLocale, SKY_LIB_RESOURCES_PROVIDERS, SkyI18nModule } from '@skyux/i18n';
|
|
9
9
|
import { Subject } from 'rxjs';
|
|
10
|
-
import { takeUntil } from 'rxjs/operators';
|
|
10
|
+
import { takeUntil, filter } from 'rxjs/operators';
|
|
11
11
|
import { SkyThemeService } from '@skyux/theme';
|
|
12
12
|
import { PopupComponent, RowNode, Events } from 'ag-grid-community';
|
|
13
13
|
import { FormGroup, FormControl, FormsModule, ReactiveFormsModule } from '@angular/forms';
|
|
@@ -1298,13 +1298,30 @@ var SkyAgGridDataManagerAdapterDirective = /** @class */ (function () {
|
|
|
1298
1298
|
agGrid.api.sizeColumnsToFit();
|
|
1299
1299
|
});
|
|
1300
1300
|
agGrid.columnMoved
|
|
1301
|
+
.pipe(takeUntil(this.ngUnsubscribe), filter(function (event) {
|
|
1302
|
+
return ![
|
|
1303
|
+
'gridInitializing',
|
|
1304
|
+
'uiColumnResized',
|
|
1305
|
+
'uiColumnDragged',
|
|
1306
|
+
'api'
|
|
1307
|
+
].includes(event.source);
|
|
1308
|
+
}))
|
|
1309
|
+
.subscribe(function (value) {
|
|
1310
|
+
_this.updateColumnsInCurrentDataState(value.columnApi);
|
|
1311
|
+
});
|
|
1312
|
+
var currentColumns;
|
|
1313
|
+
agGrid.dragStarted
|
|
1301
1314
|
.pipe(takeUntil(this.ngUnsubscribe))
|
|
1302
|
-
.subscribe(function (
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1315
|
+
.subscribe(function (value) {
|
|
1316
|
+
currentColumns = _this.getColumnOrder(value.columnApi);
|
|
1317
|
+
});
|
|
1318
|
+
agGrid.dragStopped
|
|
1319
|
+
.pipe(takeUntil(this.ngUnsubscribe))
|
|
1320
|
+
.subscribe(function (value) {
|
|
1321
|
+
var newColumns = _this.getColumnOrder(value.columnApi);
|
|
1322
|
+
var hasChanged = currentColumns.findIndex(function (colId, i) { return colId !== newColumns[i]; });
|
|
1323
|
+
if (hasChanged > -1) {
|
|
1324
|
+
_this.updateColumnsInCurrentDataState(value.columnApi);
|
|
1308
1325
|
}
|
|
1309
1326
|
});
|
|
1310
1327
|
agGrid.rowSelected
|
|
@@ -1348,6 +1365,17 @@ var SkyAgGridDataManagerAdapterDirective = /** @class */ (function () {
|
|
|
1348
1365
|
_this.dataManagerSvc.updateDataState(_this.currentDataState, _this.viewConfig.id);
|
|
1349
1366
|
});
|
|
1350
1367
|
};
|
|
1368
|
+
SkyAgGridDataManagerAdapterDirective.prototype.updateColumnsInCurrentDataState = function (columnApi) {
|
|
1369
|
+
var columnOrder = this.getColumnOrder(columnApi);
|
|
1370
|
+
var viewState = this.currentDataState.getViewStateById(this.viewConfig.id);
|
|
1371
|
+
viewState.displayedColumnIds = columnOrder;
|
|
1372
|
+
this.dataManagerSvc.updateDataState(this.currentDataState.addOrUpdateView(this.viewConfig.id, viewState), this.viewConfig.id);
|
|
1373
|
+
};
|
|
1374
|
+
SkyAgGridDataManagerAdapterDirective.prototype.getColumnOrder = function (columnApi) {
|
|
1375
|
+
return columnApi
|
|
1376
|
+
.getAllDisplayedVirtualColumns()
|
|
1377
|
+
.map(function (col) { return col.getColDef().colId; });
|
|
1378
|
+
};
|
|
1351
1379
|
SkyAgGridDataManagerAdapterDirective.prototype.displayColumns = function (dataState) {
|
|
1352
1380
|
var e_1, _a;
|
|
1353
1381
|
var agGrid = this.currentAgGrid;
|