@skyux/ag-grid 4.12.0 → 4.12.4

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,20 @@
1
+ # 4.12.4 (2022-01-04)
2
+
3
+ - Fixed an issue where the first row would not render. [#182](https://github.com/blackbaud/skyux-ag-grid/pull/182)
4
+
5
+ # 4.12.3 (2022-01-03)
6
+
7
+ - Added support for wrapped text in custom components. [#177](https://github.com/blackbaud/skyux-ag-grid/pull/177)
8
+ - Fixed an error with the validator popover change detection. [#180](https://github.com/blackbaud/skyux-ag-grid/pull/180)
9
+
10
+ # 4.12.2 (2021-12-02)
11
+
12
+ - Added bug fixes and features from the `master` branch. [#173](https://github.com/blackbaud/skyux-ag-grid/pull/173)
13
+
14
+ # 4.12.1 (2021-11-10)
15
+
16
+ - Added bug fixes and features from the `master` branch. [#165](https://github.com/blackbaud/skyux-ag-grid/pull/165)
17
+
1
18
  # 4.12.0 (2021-11-04)
2
19
 
3
20
  - Added bug fixes and features from the `master` branch. [#161](https://github.com/blackbaud/skyux-ag-grid/pull/161)
@@ -885,6 +885,7 @@
885
885
  return fallback;
886
886
  };
887
887
  }
888
+ var rowNodeId = -1;
888
889
  /**
889
890
  * A service that provides default styling and behavior for agGrids in SKY UX SPAs.
890
891
  */
@@ -1036,6 +1037,20 @@
1036
1037
  'sky-ag-grid-cell-renderer-currency-validator': SkyAgGridCellRendererCurrencyValidatorComponent,
1037
1038
  'sky-ag-grid-cell-renderer-validator-tooltip': SkyAgGridCellRendererValidatorTooltipComponent
1038
1039
  },
1040
+ getRowNodeId: function (data) {
1041
+ if ('id' in data && data.id !== undefined) {
1042
+ return "" + data.id;
1043
+ }
1044
+ return "" + rowNodeId--;
1045
+ },
1046
+ getRowClass: function (params) {
1047
+ if (params.node.id) {
1048
+ return "sky-ag-grid-row-" + params.node.id;
1049
+ }
1050
+ else {
1051
+ return undefined;
1052
+ }
1053
+ },
1039
1054
  headerHeight: ((_p = (_o = this.currentTheme) === null || _o === void 0 ? void 0 : _o.theme) === null || _p === void 0 ? void 0 : _p.name) === 'modern' ? 60 : 37,
1040
1055
  icons: {
1041
1056
  sortDescending: this.getIconTemplate('caret-down'),
@@ -1488,13 +1503,30 @@
1488
1503
  agGrid.api.sizeColumnsToFit();
1489
1504
  });
1490
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
1491
1519
  .pipe(operators.takeUntil(this.ngUnsubscribe))
1492
- .subscribe(function (event) {
1493
- var columnOrder = agGrid.columnApi.getAllDisplayedVirtualColumns().map(function (col) { return col.getColDef().colId; });
1494
- if (event.source !== 'api') {
1495
- var viewState = _this.currentDataState.getViewStateById(_this.viewConfig.id);
1496
- viewState.displayedColumnIds = columnOrder;
1497
- _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);
1498
1530
  }
1499
1531
  });
1500
1532
  agGrid.rowSelected
@@ -1538,6 +1570,17 @@
1538
1570
  _this.dataManagerSvc.updateDataState(_this.currentDataState, _this.viewConfig.id);
1539
1571
  });
1540
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
+ };
1541
1584
  SkyAgGridDataManagerAdapterDirective.prototype.displayColumns = function (dataState) {
1542
1585
  var e_1, _a;
1543
1586
  var agGrid = this.currentAgGrid;
@@ -1639,7 +1682,7 @@
1639
1682
  var _this = this;
1640
1683
  this.zone.run(function () {
1641
1684
  _this.indicatorShouldShow = false;
1642
- _this.changeDetector.markForCheck();
1685
+ _this.changeDetector.detectChanges();
1643
1686
  });
1644
1687
  };
1645
1688
  SkyAgGridCellValidatorTooltipComponent.prototype.hidePopover = function () {
@@ -1649,7 +1692,7 @@
1649
1692
  var _this = this;
1650
1693
  this.zone.run(function () {
1651
1694
  _this.indicatorShouldShow = true;
1652
- _this.changeDetector.markForCheck();
1695
+ _this.changeDetector.detectChanges();
1653
1696
  });
1654
1697
  };
1655
1698
  SkyAgGridCellValidatorTooltipComponent.prototype.showPopover = function () {
@@ -1928,7 +1971,7 @@
1928
1971
  return this.rowDeleteConfigs.find(function (rowDelete) { return rowDelete.id === row.id; });
1929
1972
  };
1930
1973
  SkyAgGridRowDeleteDirective.prototype.affixToRow = function (affixer, id) {
1931
- var rowElement = this.elementRef.nativeElement.querySelector('[row-id="' + id + '"] div[aria-colindex="1"]');
1974
+ var rowElement = this.elementRef.nativeElement.querySelector("\n [row-id=\"" + id + "\"] div[aria-colindex=\"1\"],\n .ag-row.sky-ag-grid-row-" + id + " div[aria-colindex=\"1\"]\n ");
1932
1975
  // This covers cases where AG Grid places the column index on an inner element (such as with the `enableCellTextSelection` option)
1933
1976
  // This appears to have been fixed by AG Grid in version 24 and so it is not testable after that version.
1934
1977
  /* istanbul ignore if */