@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 CHANGED
@@ -1,3 +1,7 @@
1
+ # 4.12.2 (2021-12-02)
2
+
3
+ - Added bug fixes and features from the `master` branch. [#173](https://github.com/blackbaud/skyux-ag-grid/pull/173)
4
+
1
5
  # 4.12.1 (2021-11-10)
2
6
 
3
7
  - Added bug fixes and features from the `master` branch. [#165](https://github.com/blackbaud/skyux-ag-grid/pull/165)
@@ -1503,13 +1503,30 @@
1503
1503
  agGrid.api.sizeColumnsToFit();
1504
1504
  });
1505
1505
  agGrid.columnMoved
1506
+ .pipe(operators.takeUntil(this.ngUnsubscribe), operators.filter(function (event) {
1507
+ return ![
1508
+ 'gridInitializing',
1509
+ 'uiColumnResized',
1510
+ 'uiColumnDragged',
1511
+ 'api'
1512
+ ].includes(event.source);
1513
+ }))
1514
+ .subscribe(function (value) {
1515
+ _this.updateColumnsInCurrentDataState(value.columnApi);
1516
+ });
1517
+ var currentColumns;
1518
+ agGrid.dragStarted
1506
1519
  .pipe(operators.takeUntil(this.ngUnsubscribe))
1507
- .subscribe(function (event) {
1508
- var columnOrder = agGrid.columnApi.getAllDisplayedVirtualColumns().map(function (col) { return col.getColDef().colId; });
1509
- if (event.source !== 'api') {
1510
- var viewState = _this.currentDataState.getViewStateById(_this.viewConfig.id);
1511
- viewState.displayedColumnIds = columnOrder;
1512
- _this.dataManagerSvc.updateDataState(_this.currentDataState.addOrUpdateView(_this.viewConfig.id, viewState), _this.viewConfig.id);
1520
+ .subscribe(function (value) {
1521
+ currentColumns = _this.getColumnOrder(value.columnApi);
1522
+ });
1523
+ agGrid.dragStopped
1524
+ .pipe(operators.takeUntil(this.ngUnsubscribe))
1525
+ .subscribe(function (value) {
1526
+ var newColumns = _this.getColumnOrder(value.columnApi);
1527
+ var hasChanged = currentColumns.findIndex(function (colId, i) { return colId !== newColumns[i]; });
1528
+ if (hasChanged > -1) {
1529
+ _this.updateColumnsInCurrentDataState(value.columnApi);
1513
1530
  }
1514
1531
  });
1515
1532
  agGrid.rowSelected
@@ -1553,6 +1570,17 @@
1553
1570
  _this.dataManagerSvc.updateDataState(_this.currentDataState, _this.viewConfig.id);
1554
1571
  });
1555
1572
  };
1573
+ SkyAgGridDataManagerAdapterDirective.prototype.updateColumnsInCurrentDataState = function (columnApi) {
1574
+ var columnOrder = this.getColumnOrder(columnApi);
1575
+ var viewState = this.currentDataState.getViewStateById(this.viewConfig.id);
1576
+ viewState.displayedColumnIds = columnOrder;
1577
+ this.dataManagerSvc.updateDataState(this.currentDataState.addOrUpdateView(this.viewConfig.id, viewState), this.viewConfig.id);
1578
+ };
1579
+ SkyAgGridDataManagerAdapterDirective.prototype.getColumnOrder = function (columnApi) {
1580
+ return columnApi
1581
+ .getAllDisplayedVirtualColumns()
1582
+ .map(function (col) { return col.getColDef().colId; });
1583
+ };
1556
1584
  SkyAgGridDataManagerAdapterDirective.prototype.displayColumns = function (dataState) {
1557
1585
  var e_1, _a;
1558
1586
  var agGrid = this.currentAgGrid;