@datorama/core 22.15.0 → 22.15.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.
Files changed (32) hide show
  1. package/bundle.scss +122 -50
  2. package/bundles/datorama-core.umd.js +140 -47
  3. package/bundles/datorama-core.umd.js.map +1 -1
  4. package/bundles/datorama-core.umd.min.js +27 -27
  5. package/bundles/datorama-core.umd.min.js.map +1 -1
  6. package/datorama-core.metadata.json +1 -1
  7. package/esm2015/lib/grid/grid/grid.component.js +4 -4
  8. package/esm2015/lib/grid/grid-sort.utils.js +7 -2
  9. package/esm2015/lib/grid-v2/grid/grid-v2.component.js +10 -3
  10. package/esm2015/lib/grid-v2/grid/grid-v2.config.js +30 -4
  11. package/esm2015/lib/grid-v2/grid-controller/grid-controller.component.js +58 -24
  12. package/esm2015/lib/grid-v2/grid-header/grid-header.component.js +3 -2
  13. package/esm2015/lib/grid-v2/grid-store/grid.query.js +9 -5
  14. package/esm2015/lib/grid-v2/grid-toolbar/grid-toolbar.component.js +22 -16
  15. package/esm2015/lib/version.js +2 -2
  16. package/esm5/lib/grid/grid/grid.component.js +4 -4
  17. package/esm5/lib/grid/grid-sort.utils.js +7 -2
  18. package/esm5/lib/grid-v2/grid/grid-v2.component.js +14 -3
  19. package/esm5/lib/grid-v2/grid/grid-v2.config.js +30 -4
  20. package/esm5/lib/grid-v2/grid-controller/grid-controller.component.js +62 -24
  21. package/esm5/lib/grid-v2/grid-header/grid-header.component.js +3 -2
  22. package/esm5/lib/grid-v2/grid-store/grid.query.js +9 -5
  23. package/esm5/lib/grid-v2/grid-toolbar/grid-toolbar.component.js +22 -16
  24. package/esm5/lib/version.js +2 -2
  25. package/fesm2015/datorama-core.js +133 -48
  26. package/fesm2015/datorama-core.js.map +1 -1
  27. package/fesm5/datorama-core.js +141 -48
  28. package/fesm5/datorama-core.js.map +1 -1
  29. package/lib/grid-v2/grid/grid-v2.component.d.ts +4 -0
  30. package/lib/grid-v2/grid-controller/grid-controller.component.d.ts +15 -0
  31. package/lib/grid-v2/grid-toolbar/grid-toolbar.component.d.ts +1 -0
  32. package/package.json +1 -1
@@ -5894,10 +5894,10 @@
5894
5894
  _this.onChange(selectedRows);
5895
5895
  },
5896
5896
  rowSelection: 'multiple',
5897
- rowDeselection: true,
5897
+ // rowDeselection removed: true by default in AG Grid 27 (suppress with suppressRowDeselection).
5898
5898
  unSortIcon: true,
5899
- animateRows: true,
5900
- rememberGroupStateWhenNewData: true
5899
+ animateRows: true
5900
+ // rememberGroupStateWhenNewData removed: no-op since AG Grid 24 (transaction updates keep group state).
5901
5901
  };
5902
5902
  _this.infinitePagination = false;
5903
5903
  _this.isRowsCollapsed = true;
@@ -11356,7 +11356,12 @@
11356
11356
  */
11357
11357
  function getSortModel(columnApi) {
11358
11358
  var sortIndexes = {};
11359
- var sortedColumns = columnApi.getColumnState().filter(function (columnState) { return columnState.sort != null; });
11359
+ // AG Grid 27: getColumnState() returns undefined before the grid's columns are initialized.
11360
+ // getSortModel() is reached via getCurrentGridSettings()/onFilterSortChanged() on resize/data
11361
+ // events that can fire before that point, so guard against undefined to avoid
11362
+ // "Cannot read properties of undefined (reading 'filter')".
11363
+ var columnState = columnApi.getColumnState() || [];
11364
+ var sortedColumns = columnState.filter(function (state) { return state.sort != null; });
11360
11365
  sortedColumns.forEach(function (columnState) {
11361
11366
  sortIndexes[columnState.colId] = columnState.sortIndex;
11362
11367
  });
@@ -11651,9 +11656,13 @@
11651
11656
  GridQuery.prototype.getCurrentGridSettings = function () {
11652
11657
  var toColId = function (column) { return column.getColId(); };
11653
11658
  var columns = this.api.columns;
11654
- var groupedColumns = columns.getRowGroupColumns();
11655
- var columnsOrder = columns.getAllColumns();
11656
- var allGridColumns = columns.getAllGridColumns();
11659
+ // AG Grid 27: getAllColumns() returns Column[] | null (and the grouped/grid column getters can
11660
+ // likewise be empty) before the grid's columns are initialized. getCurrentGridSettings() is
11661
+ // reached via fitGrid -> updateSettings on window resize, which can fire before that point, so
11662
+ // guard against null to avoid "Cannot read properties of undefined (reading 'filter')".
11663
+ var groupedColumns = columns.getRowGroupColumns() || [];
11664
+ var columnsOrder = columns.getAllColumns() || [];
11665
+ var allGridColumns = columns.getAllGridColumns() || [];
11657
11666
  var hiddenColumns = columnsOrder
11658
11667
  .filter(function (column) { return !column.isVisible() && !groupedColumns.includes(column); })
11659
11668
  .map(toColId);
@@ -11664,7 +11673,7 @@
11664
11673
  hiddenColumns: hiddenColumns,
11665
11674
  groupedColumns: groupedColumns.map(toColId),
11666
11675
  filter: this.getFilter(),
11667
- pinnedColumns: columns.getDisplayedLeftColumns().map(toColId),
11676
+ pinnedColumns: (columns.getDisplayedLeftColumns() || []).map(toColId),
11668
11677
  columnsOrder: allGridColumns.map(toColId),
11669
11678
  columnsSizes: null,
11670
11679
  searchTerm: null
@@ -13810,7 +13819,27 @@
13810
13819
  comparator: function (a, b) { return getTime$1(a) - getTime$1(b); }
13811
13820
  },
13812
13821
  _a$3[exports.DatoGridColumnTypes.Number] = {
13813
- filter: exports.DatoGridFilterTypes.Number
13822
+ filter: exports.DatoGridFilterTypes.Number,
13823
+ // AG Grid resolves a column's sort comparator only from its merged colDef.comparator.
13824
+ // Number columns had none, so they fell back to AG Grid's default comparator, which sorts
13825
+ // string-typed values lexicographically ("10" before "2"). Provide an explicit numeric
13826
+ // comparator. Map null/empty/non-numeric to -Infinity so we never return NaN (AG Grid's
13827
+ // sorter skips a NaN result). Ascending-sense only — AG Grid flips the sign for descending.
13828
+ comparator: function (a, b) {
13829
+ var toNum = function (v) {
13830
+ var n = v == null || v === '' ? NaN : Number(v);
13831
+ return isNaN(n) ? -Infinity : n;
13832
+ };
13833
+ var na = toNum(a);
13834
+ var nb = toNum(b);
13835
+ // Compare relationally (not by subtraction): two missing/non-numeric values both map to
13836
+ // -Infinity, and -Infinity - (-Infinity) === NaN, which AG Grid's sorter skips. Returning
13837
+ // 0 / -1 / 1 avoids NaN entirely. Ascending sense — AG Grid flips the sign for descending.
13838
+ if (na === nb) {
13839
+ return 0;
13840
+ }
13841
+ return na < nb ? -1 : 1;
13842
+ }
13814
13843
  },
13815
13844
  _a$3[exports.DatoGridColumnTypes.String] = stringColDef,
13816
13845
  _a$3[exports.DatoGridColumnTypes.Status] = __assign(__assign({}, stringColDef), { cellRenderer: 'DatoGridStatusCellComponent' }),
@@ -13818,14 +13847,20 @@
13818
13847
  _a$3[exports.DatoGridColumnTypes.ItemsCount] = __assign(__assign({}, stringColDef), { cellRenderer: 'DatoGridItemsCountCellComponent' }),
13819
13848
  _a$3[exports.DatoGridColumnTypes.Initials] = __assign(__assign({}, stringColDef), { cellRenderer: 'DatoGridInitialsCellComponent' }),
13820
13849
  _a$3[exports.DatoGridColumnTypes.Avatar] = __assign(__assign({}, stringColDef), { cellRenderer: 'DatoGridAvatarCellComponent' }),
13821
- _a$3), multiSortKey: 'ctrl', suppressPaginationPanel: true, pagination: true, paginateChildRows: true, deltaColumnMode: true, loadingOverlayComponentFramework: DatoGridV2LoaderComponent, noRowsOverlayComponentFramework: DatoGridV2NoDataOverlayComponent, defaultColDef: {
13850
+ _a$3), multiSortKey: 'ctrl', suppressPaginationPanel: true, pagination: true, paginateChildRows: true,
13851
+ // deltaColumnMode removed: deprecated in AG Grid 27, delta column updates are the default now.
13852
+ loadingOverlayComponentFramework: DatoGridV2LoaderComponent, noRowsOverlayComponentFramework: DatoGridV2NoDataOverlayComponent, defaultColDef: {
13822
13853
  minWidth: exports.GridMinWidths.Default,
13823
13854
  sortable: true,
13824
13855
  resizable: true,
13825
13856
  type: exports.DatoGridColumnTypes.String,
13826
13857
  menuTabs: ['filterMenuTab'],
13827
13858
  headerComponentFramework: DatoGridColumnHeaderComponent
13828
- }, suppressCellSelection: true, suppressPropertyNamesCheck: true, rowHeight: 35, headerHeight: 30, rowSelection: exports.GridRowSelectionType.MULTIPLE, rowDeselection: true, unSortIcon: true, animateRows: true, rememberGroupStateWhenNewData: true, groupDisplayType: 'multipleColumns', groupDefaultExpanded: -1, usePivotGridStyle: false, disabledHTMLRenderingFields: [] }, (isTestEnv() ? { suppressColumnVirtualisation: true, rowBuffer: 99999 } : {}));
13859
+ }, suppressCellFocus: true, suppressPropertyNamesCheck: true, rowHeight: 35, headerHeight: 30, rowSelection: exports.GridRowSelectionType.MULTIPLE,
13860
+ // rowDeselection removed: true by default in AG Grid 27 (suppress with suppressRowDeselection).
13861
+ unSortIcon: true, animateRows: true,
13862
+ // rememberGroupStateWhenNewData removed: no-op since AG Grid 24 (transaction updates keep group state).
13863
+ groupDisplayType: 'multipleColumns', groupDefaultExpanded: -1, usePivotGridStyle: false, disabledHTMLRenderingFields: [] }, (isTestEnv() ? { suppressColumnVirtualisation: true, rowBuffer: 99999 } : {}));
13829
13864
  var DEFAULT_GRID_SEARCH_DEBOUNCE_TIME = {
13830
13865
  CLIENT: 200,
13831
13866
  SERVER: 250
@@ -15795,18 +15830,30 @@
15795
15830
  this.gridActions = [];
15796
15831
  this.gridReady$ = this.gridQuery.gridReady$;
15797
15832
  this.contentInit = new rxjs.Subject();
15833
+ // ngx-take-until-destroy patches ngOnDestroy on the instance, which Ivy never calls (it uses the
15834
+ // prototype hook), so listeners outlived the grid and hit the destroyed AG Grid API.
15835
+ this.destroy$ = new rxjs.Subject();
15836
+ this.hasGridOptions = new rxjs.BehaviorSubject(false);
15837
+ this.agGridReady = new rxjs.ReplaySubject(1);
15798
15838
  this.gridElements = {
15799
15839
  centerViewport: null,
15800
15840
  centerContainer: null,
15801
15841
  bodyViewport: null
15802
15842
  };
15803
15843
  this.treeGridClass = 'tree';
15844
+ this.hasGridOptions$ = this.hasGridOptions.asObservable();
15804
15845
  }
15805
15846
  Object.defineProperty(DatoGridControllerComponent.prototype, "gridOptions", {
15806
15847
  get: function () {
15807
15848
  return this._gridOptions;
15808
15849
  },
15809
15850
  set: function (gridOptions) {
15851
+ // The [gridOptions] binding can resolve to undefined during the host's initial change-detection
15852
+ // pass (before the consumer computes its options). Ignore it instead of throwing
15853
+ // "Cannot read properties of undefined" from initGridOptions() and aborting the view render.
15854
+ if (!gridOptions) {
15855
+ return;
15856
+ }
15810
15857
  this._gridOptions = this.gridService.initGridOptions(gridOptions);
15811
15858
  this.gridService.treeData = gridOptions.treeData;
15812
15859
  this.gridService.isPivotMode = gridOptions.pivotMode;
@@ -15818,16 +15865,37 @@
15818
15865
  this.agGridEl.classList.add(this.treeGridClass);
15819
15866
  }
15820
15867
  }
15868
+ !this.hasGridOptions.value && this.hasGridOptions.next(true);
15869
+ },
15870
+ enumerable: true,
15871
+ configurable: true
15872
+ });
15873
+ Object.defineProperty(DatoGridControllerComponent.prototype, "agGridOptions", {
15874
+ /* @internal */
15875
+ get: function () {
15876
+ if (!this._agGridOptions && this._gridOptions) {
15877
+ this.gridOptions = this.normalizeOptions();
15878
+ this._agGridOptions = this.gridOptions;
15879
+ }
15880
+ return this._agGridOptions;
15821
15881
  },
15822
15882
  enumerable: true,
15823
15883
  configurable: true
15824
15884
  });
15825
15885
  DatoGridControllerComponent.prototype.ngOnDestroy = function () {
15886
+ this.destroy$.next();
15887
+ this.destroy$.complete();
15826
15888
  this.contentInit.complete();
15889
+ this.hasGridOptions.complete();
15890
+ this.agGridReady.complete();
15827
15891
  this.clearTooltip();
15828
15892
  this.rowHoverComponent && this.rowHoverComponent.destroy();
15829
15893
  this.rowHoverComponent = null;
15830
15894
  };
15895
+ /* @internal */
15896
+ DatoGridControllerComponent.prototype.onAgGridReady = function (event) {
15897
+ this.agGridReady.next(event);
15898
+ };
15831
15899
  DatoGridControllerComponent.prototype.initializeGrid = function (agGrid, agGridEl) {
15832
15900
  if (!this.contentInit.isStopped) {
15833
15901
  this._initializeGrid(agGrid, agGridEl);
@@ -15842,11 +15910,13 @@
15842
15910
  this.contentInit
15843
15911
  .asObservable()
15844
15912
  .pipe(operators.switchMap(function () {
15845
- _this.gridOptions = _this.normalizeOptions();
15846
- agGrid.gridOptions = _this.gridOptions;
15913
+ // Already normalized when dato-grid-v2 bound them to <ag-grid-angular [gridOptions]>.
15914
+ if (!_this.agGridOptions) {
15915
+ return rxjs.EMPTY;
15916
+ }
15847
15917
  var settingsLoader = _this.gridOptions.saveSettings === false ? rxjs.of(null) : _this.storageAPI.get(_this.gridOptions.gridName);
15848
- return rxjs.combineLatest([agGrid.gridReady, settingsLoader]);
15849
- }), ngxTakeUntilDestroy.untilDestroyed(this))
15918
+ return rxjs.combineLatest([_this.agGridReady, settingsLoader]);
15919
+ }), operators.takeUntil(this.destroy$))
15850
15920
  .subscribe(function (_a) {
15851
15921
  var _b = __read(_a, 2), _c = _b[0], api = _c.api, columnApi = _c.columnApi, _d = _b[1], savedSettings = _d === void 0 ? {} : _d;
15852
15922
  if (!_this.gridOptions.rowData) {
@@ -15925,7 +15995,7 @@
15925
15995
  .pipe(operators.auditTime(100), operators.filter(function (_a) {
15926
15996
  var finished = _a.finished, source = _a.source;
15927
15997
  return finished && source === 'uiColumnDragged';
15928
- }), ngxTakeUntilDestroy.untilDestroyed(this))
15998
+ }), operators.takeUntil(this.destroy$))
15929
15999
  .subscribe(function (e) {
15930
16000
  var _a = __read(e.columns, 1), column = _a[0];
15931
16001
  var columnsSizes = __assign({}, _this.gridQuery.getColumnSizes());
@@ -15944,7 +16014,7 @@
15944
16014
  rxjs.merge(columnVisible, sortChanged, columnRowGroupChanged, columnPinned, dragStopped, filterChanged)
15945
16015
  .pipe(
15946
16016
  /* Skip the initial sorting event fired by the grid when adding rows */
15947
- operators.skip(1), ngxTakeUntilDestroy.untilDestroyed(this))
16017
+ operators.skip(1), operators.takeUntil(this.destroy$))
15948
16018
  .subscribe(function (_a) {
15949
16019
  var type = _a.type;
15950
16020
  var settingsDiff = _this.gridService.getSettingsDiff();
@@ -15962,7 +16032,7 @@
15962
16032
  var _this = this;
15963
16033
  this.gridQuery
15964
16034
  .select(function (state) { return state.settings; })
15965
- .pipe(operators.skip(1), operators.debounceTime(1000), ngxTakeUntilDestroy.untilDestroyed(this))
16035
+ .pipe(operators.skip(1), operators.debounceTime(1000), operators.takeUntil(this.destroy$))
15966
16036
  .subscribe(function () {
15967
16037
  var settingsDiff = _this.gridService.getSettingsDiff();
15968
16038
  _this.gridService.saveSettingsToServer(settingsDiff);
@@ -15992,7 +16062,7 @@
15992
16062
  var value = _a.value, node = _a.node;
15993
16063
  return value !== undefined && node.group === true;
15994
16064
  }));
15995
- }), ngxTakeUntilDestroy.untilDestroyed(this))
16065
+ }), operators.takeUntil(this.destroy$))
15996
16066
  .subscribe(function (_a) {
15997
16067
  var node = _a.node;
15998
16068
  node.setExpanded(!node.expanded);
@@ -16003,7 +16073,7 @@
16003
16073
  .pipe(operators.filter(function (_a) {
16004
16074
  var node = _a.node;
16005
16075
  return node.expanded === false;
16006
- }), ngxTakeUntilDestroy.untilDestroyed(this))
16076
+ }), operators.takeUntil(this.destroy$))
16007
16077
  .subscribe(function () {
16008
16078
  _this.lastHoveredRow = null;
16009
16079
  _this.setOnHoverState(false);
@@ -16018,7 +16088,7 @@
16018
16088
  rxjs.fromEvent(bodyViewport, 'click')
16019
16089
  .pipe(operators.filter(function (event) {
16020
16090
  return (event.target === bodyViewport || event.target === centerViewport) && api.getSelectedRows().length > 0;
16021
- }), ngxTakeUntilDestroy.untilDestroyed(this))
16091
+ }), operators.takeUntil(this.destroy$))
16022
16092
  .subscribe(function () { return api.deselectAll(); });
16023
16093
  };
16024
16094
  DatoGridControllerComponent.prototype.onHoverEnabled = function () {
@@ -16031,7 +16101,7 @@
16031
16101
  var onHoverEnabled = this.onHoverEnabled();
16032
16102
  if (onHoverEnabled) {
16033
16103
  rxjs.fromEvent(centerContainer, 'mouseleave')
16034
- .pipe(ngxTakeUntilDestroy.untilDestroyed(this))
16104
+ .pipe(operators.takeUntil(this.destroy$))
16035
16105
  .subscribe(function () {
16036
16106
  _this.toggleRowHoverClass(_this.lastHoveredRow);
16037
16107
  _this.lastHoveredRow = null;
@@ -16042,13 +16112,13 @@
16042
16112
  var direction = _a.direction;
16043
16113
  return direction === 'horizontal';
16044
16114
  })), agGrid.rowDataChanged)
16045
- .pipe(ngxTakeUntilDestroy.untilDestroyed(this))
16115
+ .pipe(operators.takeUntil(this.destroy$))
16046
16116
  .subscribe(function () {
16047
16117
  _this.updateOnHoverPos();
16048
16118
  });
16049
16119
  this.addOnHoverElement();
16050
16120
  }
16051
- agGrid.cellMouseOver.pipe(ngxTakeUntilDestroy.untilDestroyed(this)).subscribe(function (event) {
16121
+ agGrid.cellMouseOver.pipe(operators.takeUntil(this.destroy$)).subscribe(function (event) {
16052
16122
  var node = event.node, column = event.column;
16053
16123
  if (lastHoveredCell === node.id + "-" + column.getColId()) {
16054
16124
  clearTimeout(_this.cellMouseOutTimer);
@@ -16065,12 +16135,12 @@
16065
16135
  }
16066
16136
  });
16067
16137
  var onTooltipOut = rxjs.merge(rxjs.fromEvent(bodyViewport, 'scroll'), rxjs.fromEvent(this.agGridEl, 'mouseleave'));
16068
- onTooltipOut.pipe(ngxTakeUntilDestroy.untilDestroyed(this)).subscribe(function () {
16138
+ onTooltipOut.pipe(operators.takeUntil(this.destroy$)).subscribe(function () {
16069
16139
  lastHoveredCell = null;
16070
16140
  _this.clearTooltip();
16071
16141
  });
16072
16142
  agGrid.cellMouseOut
16073
- .pipe(operators.filter(function () { return !isNil(_this.tooltip); }), ngxTakeUntilDestroy.untilDestroyed(this))
16143
+ .pipe(operators.filter(function () { return !isNil(_this.tooltip); }), operators.takeUntil(this.destroy$))
16074
16144
  .subscribe(function () {
16075
16145
  _this.cellMouseOutTimer = window.setTimeout(function () { return _this.clearTooltip(); });
16076
16146
  });
@@ -16087,9 +16157,13 @@
16087
16157
  if (cell.tagName === 'SPAN' && cell.scrollWidth === 0) {
16088
16158
  cell = cell.parentElement;
16089
16159
  }
16090
- if (event.colDef.editable) {
16160
+ if (event.colDef.editable && cell) {
16091
16161
  cell = cell.querySelector('.value-wrapper') || cell;
16092
16162
  }
16163
+ // AG Grid 27 can fire cellMouseOver for an element that was already detached by a re-render.
16164
+ if (!cell) {
16165
+ return;
16166
+ }
16093
16167
  var textOverflow = cell.offsetWidth < cell.scrollWidth;
16094
16168
  if (textOverflow) {
16095
16169
  clearTimeout(this.cellMouseOutTimer);
@@ -16173,7 +16247,7 @@
16173
16247
  keys: 'meta.a',
16174
16248
  ignoreInEditable: true
16175
16249
  })
16176
- .pipe(ngxTakeUntilDestroy.untilDestroyed(this))
16250
+ .pipe(operators.takeUntil(this.destroy$))
16177
16251
  .subscribe(function () {
16178
16252
  _this.gridService.selectAllCurrentPageRows();
16179
16253
  });
@@ -16181,7 +16255,7 @@
16181
16255
  DatoGridControllerComponent.prototype.registerWindowResizeListener = function () {
16182
16256
  var _this = this;
16183
16257
  rxjs.fromEvent(window, 'resize')
16184
- .pipe(operators.debounceTime(100), operators.filter(function () { return _this.gridQuery.gridAlignment !== 2 /* CUSTOM */; }), ngxTakeUntilDestroy.untilDestroyed(this))
16258
+ .pipe(operators.debounceTime(100), operators.filter(function () { return _this.gridQuery.gridAlignment !== 2 /* CUSTOM */; }), operators.takeUntil(this.destroy$))
16185
16259
  .subscribe(function () {
16186
16260
  var fitTo = _this.gridQuery.gridAlignment === 0 /* FIT_TO_CONTAINER */ ? 'container' : 'content';
16187
16261
  _this.gridService.fitGrid(fitTo);
@@ -16205,7 +16279,7 @@
16205
16279
  var events$ = this.gridQuery.isServerSide
16206
16280
  ? rxjs.merge(agGrid.sortChanged, agGrid.filterChanged)
16207
16281
  : agGrid.filterChanged;
16208
- events$.pipe(ngxTakeUntilDestroy.untilDestroyed(this)).subscribe(function () {
16282
+ events$.pipe(operators.takeUntil(this.destroy$)).subscribe(function () {
16209
16283
  _this.gridService.deselectAllRows();
16210
16284
  });
16211
16285
  };
@@ -16214,7 +16288,7 @@
16214
16288
  if (!this.gridQuery.isServerSide) {
16215
16289
  return;
16216
16290
  }
16217
- agGrid.paginationChanged.pipe(ngxTakeUntilDestroy.untilDestroyed(this)).subscribe(function () {
16291
+ agGrid.paginationChanged.pipe(operators.takeUntil(this.destroy$)).subscribe(function () {
16218
16292
  if (_this.gridQuery.isServerSelectAllRowsEnabled) {
16219
16293
  _this.gridService.selectAllCurrentPageRows(true, true);
16220
16294
  }
@@ -16286,6 +16360,7 @@
16286
16360
  function DatoGridV2Component(controller, host) {
16287
16361
  this.controller = controller;
16288
16362
  this.host = host;
16363
+ this.hasGridOptions$ = this.controller.hasGridOptions$;
16289
16364
  }
16290
16365
  Object.defineProperty(DatoGridV2Component.prototype, "grid", {
16291
16366
  set: function (agGrid) {
@@ -16297,6 +16372,13 @@
16297
16372
  enumerable: true,
16298
16373
  configurable: true
16299
16374
  });
16375
+ Object.defineProperty(DatoGridV2Component.prototype, "agGridOptions", {
16376
+ get: function () {
16377
+ return this.controller.agGridOptions;
16378
+ },
16379
+ enumerable: true,
16380
+ configurable: true
16381
+ });
16300
16382
  Object.defineProperty(DatoGridV2Component.prototype, "gridOptions", {
16301
16383
  get: function () {
16302
16384
  return this.controller ? this.controller.gridOptions : null;
@@ -16325,6 +16407,9 @@
16325
16407
  enumerable: true,
16326
16408
  configurable: true
16327
16409
  });
16410
+ DatoGridV2Component.prototype.onGridReady = function (event) {
16411
+ this.controller.onAgGridReady(event);
16412
+ };
16328
16413
  DatoGridV2Component.ctorParameters = function () { return [
16329
16414
  { type: DatoGridControllerComponent },
16330
16415
  { type: core.ElementRef }
@@ -16337,10 +16422,10 @@
16337
16422
  DatoGridV2Component = __decorate([
16338
16423
  core.Component({
16339
16424
  selector: 'dato-grid-v2',
16340
- template: "<ag-grid-angular data-auto-id=\"grid\" class=\"dato-grid ag-theme-material\" [class.has-background]=\"enableBackground\" [class.enable-v2_1]=\"enableV2_1\"\n [class.with-multi-selection-col]=\"gridOptions?.showMultiSelectionCheckboxes\" [class.pivot-style]=\"isPivotStyle\">\n</ag-grid-angular>\n<dato-grid-pagination-v2 [class.has-background]=\"enableBackground\"></dato-grid-pagination-v2>\n",
16425
+ template: "<ag-grid-angular *ngIf=\"hasGridOptions$ | async\" [gridOptions]=\"agGridOptions\" (gridReady)=\"onGridReady($event)\"\n data-auto-id=\"grid\" class=\"dato-grid ag-theme-material\" [class.has-background]=\"enableBackground\" [class.enable-v2_1]=\"enableV2_1\"\n [class.with-multi-selection-col]=\"gridOptions?.showMultiSelectionCheckboxes\" [class.pivot-style]=\"isPivotStyle\">\n</ag-grid-angular>\n<dato-grid-pagination-v2 [class.has-background]=\"enableBackground\"></dato-grid-pagination-v2>\n",
16341
16426
  changeDetection: core.ChangeDetectionStrategy.OnPush,
16342
16427
  encapsulation: core.ViewEncapsulation.None,
16343
- styles: ["dato-grid-v2{flex-grow:1;display:flex;flex-direction:column;position:relative}dato-grid-v2 .dato-grid,dato-grid-v2 dato-grid-pagination-v2{position:absolute;left:0;right:0;bottom:0}dato-grid-v2 .dato-grid{top:0;bottom:50px}dato-grid-v2 .grid-hover-actions{position:absolute;z-index:2;transition:opacity .2s ease-in-out}dato-grid-v2 .ag-row-drag{width:initial!important;min-width:auto!important}dato-grid-v2 .da-grid-icon{display:inline-block;line-height:31px;vertical-align:middle;width:initial;height:initial}dato-grid-v2 .da-grid-icon.drag{width:14px;height:14px;margin-right:6px;opacity:0;transition:opacity .3s;transform:translateY(-50%)}dato-grid-v2 .da-grid-icon.folder{width:18px;height:35px;margin:0 8px}dato-grid-v2 .ag-row.ag-row-hover .da-grid-icon.drag{opacity:1}dato-grid-v2 ag-grid-angular.tree .ag-group-contracted,dato-grid-v2 ag-grid-angular.tree .ag-group-expanded{display:inline-block;width:18px;text-align:center}dato-grid-v2 ag-grid-angular.tree .ag-group-checkbox{display:none}dato-grid-v2 ag-grid-angular.tree .ag-row.ag-empty-folder .folder{margin-left:26px}dato-grid-v2 ag-grid-angular.tree .ag-row.ag-row-level-1 .ag-cell-wrapper .ag-row-drag{padding-right:calc(55px * 1)}dato-grid-v2 ag-grid-angular.tree .ag-row .ag-row-group-indent-1{margin-left:0!important;padding-left:0!important}dato-grid-v2 ag-grid-angular.tree .ag-row.ag-row-level-2 .ag-cell-wrapper .ag-row-drag{padding-right:calc(55px * 2)}dato-grid-v2 ag-grid-angular.tree .ag-row .ag-row-group-indent-2{margin-left:0!important;padding-left:0!important}dato-grid-v2 ag-grid-angular.tree .ag-row.ag-row-level-3 .ag-cell-wrapper .ag-row-drag{padding-right:calc(55px * 3)}dato-grid-v2 ag-grid-angular.tree .ag-row .ag-row-group-indent-3{margin-left:0!important;padding-left:0!important}dato-grid-v2 ag-grid-angular.tree .ag-row.ag-row-level-4 .ag-cell-wrapper .ag-row-drag{padding-right:calc(55px * 4)}dato-grid-v2 ag-grid-angular.tree .ag-row .ag-row-group-indent-4{margin-left:0!important;padding-left:0!important}dato-grid-v2 ag-grid-angular.tree .ag-row div[col-id=ag-Grid-AutoColumn]{padding-left:0}dato-grid-v2 ag-grid-angular.tree .ag-row .ag-cell{display:flex;align-items:center}dato-grid-v2 ag-grid-angular.tree .ag-row .ag-cell .ag-group-value>span{display:inline-block;vertical-align:middle}dato-grid-v2 ag-grid-angular.tree .ag-row .ag-cell .initials{border-radius:50%;padding:4px;margin-right:8px;margin-left:20px;width:28px;height:28px;display:inline-block;text-align:center}dato-grid-v2 ag-grid-angular.tree .ag-row-group-leaf-indent{margin-left:0!important}dato-grid-v2 ag-grid-angular.tree .ag-selection-checkbox .ag-icon-checkbox-indeterminate:before{text-align:center;content:\"-\";display:inline-block;position:absolute;top:0;left:0;right:0;bottom:0;line-height:.5;color:#fff}dato-grid-v2 ag-grid-angular.row-height-35 .ag-cell{line-height:33px}dato-grid-v2 ag-grid-angular.row-height-35 .ag-cell.dato-editable-cell{line-height:29px}dato-grid-v2 ag-grid-angular.row-height-35 .ag-cell.ag-cell-inline-editing{height:35px}dato-grid-v2 ag-grid-angular.row-height-44 .ag-cell{line-height:42px}dato-grid-v2 ag-grid-angular.row-height-44 .ag-cell.dato-editable-cell{line-height:38px}dato-grid-v2 ag-grid-angular.row-height-44 .ag-cell.ag-cell-inline-editing{height:44px}dato-grid-v2 ag-grid-angular.row-height-50 .ag-cell{line-height:48px}dato-grid-v2 ag-grid-angular.row-height-50 .ag-cell.dato-editable-cell{line-height:44px}dato-grid-v2 ag-grid-angular.row-height-50 .ag-cell.ag-cell-inline-editing{height:50px}dato-grid-v2 ag-grid-angular.row-height-59 .ag-cell{line-height:57px}dato-grid-v2 ag-grid-angular.row-height-59 .ag-cell.dato-editable-cell{line-height:53px}dato-grid-v2 ag-grid-angular.row-height-59 .ag-cell.ag-cell-inline-editing{height:59px}dato-grid-v2 ag-grid-angular .ag-cell.checkbox-selection-cell{display:flex;padding-right:0}dato-grid-v2 .ag-menu .da-grid-icon svg{vertical-align:middle}dato-grid-v2 .ag-header-cell-sortable .ag-sort-none-icon{opacity:0;transition:opacity .2s}dato-grid-v2 .ag-header-cell-sortable:hover .ag-sort-none-icon{opacity:1}dato-grid-v2 .group-contracted-icon,dato-grid-v2 .group-expanded-icon{width:7px}dato-grid-v2 .group-expanded-icon{transform:rotate(90deg)}dato-grid-v2 .dato-grid .ag-cell{border-top:0;border-bottom:0}dato-grid-v2 .ag-overlay-wrapper ng-component{display:flex}.ag-dnd-ghost{min-width:100px;border:none;display:flex;justify-content:flex-start;align-content:center;align-items:center;cursor:-webkit-grabbing;cursor:grabbing;z-index:10000000}.ag-dnd-ghost .da-grid-icon.column-move-hide svg{height:18px;width:18px}.ag-dnd-ghost .da-grid-icon.column-move svg,.ag-dnd-ghost .da-grid-icon.column-move-pin svg{height:16px;width:16px}"]
16428
+ styles: ["dato-grid-v2{flex-grow:1;display:flex;flex-direction:column;position:relative}dato-grid-v2 .dato-grid,dato-grid-v2 dato-grid-pagination-v2{position:absolute;left:0;right:0;bottom:0}dato-grid-v2 .dato-grid{top:0;bottom:50px}dato-grid-v2 .grid-hover-actions{position:absolute;z-index:2;transition:opacity .2s ease-in-out}dato-grid-v2 .ag-row-drag{width:initial!important;min-width:auto!important}dato-grid-v2 .da-grid-icon{display:inline-block;line-height:31px;vertical-align:middle;width:initial;height:initial}dato-grid-v2 .da-grid-icon.drag{width:14px;height:14px;margin-right:6px;opacity:0;transition:opacity .3s;transform:translateY(-50%)}dato-grid-v2 .da-grid-icon.folder{width:18px;height:35px;margin:0 8px}dato-grid-v2 .ag-row.ag-row-hover .da-grid-icon.drag{opacity:1}dato-grid-v2 ag-grid-angular.tree .ag-group-contracted,dato-grid-v2 ag-grid-angular.tree .ag-group-expanded{display:inline-block;width:18px;text-align:center}dato-grid-v2 ag-grid-angular.tree .ag-group-checkbox{display:none}dato-grid-v2 ag-grid-angular.tree .ag-row.ag-empty-folder .folder{margin-left:26px}dato-grid-v2 ag-grid-angular.tree .ag-row.ag-row-level-1 .ag-cell-wrapper .ag-row-drag{padding-right:calc(55px * 1)}dato-grid-v2 ag-grid-angular.tree .ag-row .ag-row-group-indent-1{margin-left:0!important;padding-left:0!important}dato-grid-v2 ag-grid-angular.tree .ag-row.ag-row-level-2 .ag-cell-wrapper .ag-row-drag{padding-right:calc(55px * 2)}dato-grid-v2 ag-grid-angular.tree .ag-row .ag-row-group-indent-2{margin-left:0!important;padding-left:0!important}dato-grid-v2 ag-grid-angular.tree .ag-row.ag-row-level-3 .ag-cell-wrapper .ag-row-drag{padding-right:calc(55px * 3)}dato-grid-v2 ag-grid-angular.tree .ag-row .ag-row-group-indent-3{margin-left:0!important;padding-left:0!important}dato-grid-v2 ag-grid-angular.tree .ag-row.ag-row-level-4 .ag-cell-wrapper .ag-row-drag{padding-right:calc(55px * 4)}dato-grid-v2 ag-grid-angular.tree .ag-row .ag-row-group-indent-4{margin-left:0!important;padding-left:0!important}dato-grid-v2 ag-grid-angular.tree .ag-row div[col-id=ag-Grid-AutoColumn]{padding-left:0}dato-grid-v2 ag-grid-angular.tree .ag-row .ag-cell{display:flex;align-items:center}dato-grid-v2 ag-grid-angular.tree .ag-row .ag-cell .ag-group-value>span{display:inline-block;vertical-align:middle}dato-grid-v2 ag-grid-angular.tree .ag-row .ag-cell .initials{border-radius:50%;padding:4px;margin-right:8px;margin-left:20px;width:28px;height:28px;display:inline-block;text-align:center}dato-grid-v2 ag-grid-angular.tree .ag-row-group-leaf-indent{margin-left:0!important}dato-grid-v2 ag-grid-angular.tree .ag-selection-checkbox .ag-checkbox-input-wrapper.ag-indeterminate:before{text-align:center;content:\"-\";display:inline-block;position:absolute;top:0;left:0;right:0;bottom:0;line-height:.5;color:#fff}dato-grid-v2 ag-grid-angular.row-height-35 .ag-cell{line-height:33px}dato-grid-v2 ag-grid-angular.row-height-35 .ag-cell.dato-editable-cell{line-height:29px}dato-grid-v2 ag-grid-angular.row-height-35 .ag-cell.ag-cell-inline-editing{height:35px}dato-grid-v2 ag-grid-angular.row-height-44 .ag-cell{line-height:42px}dato-grid-v2 ag-grid-angular.row-height-44 .ag-cell.dato-editable-cell{line-height:38px}dato-grid-v2 ag-grid-angular.row-height-44 .ag-cell.ag-cell-inline-editing{height:44px}dato-grid-v2 ag-grid-angular.row-height-50 .ag-cell{line-height:48px}dato-grid-v2 ag-grid-angular.row-height-50 .ag-cell.dato-editable-cell{line-height:44px}dato-grid-v2 ag-grid-angular.row-height-50 .ag-cell.ag-cell-inline-editing{height:50px}dato-grid-v2 ag-grid-angular.row-height-59 .ag-cell{line-height:57px}dato-grid-v2 ag-grid-angular.row-height-59 .ag-cell.dato-editable-cell{line-height:53px}dato-grid-v2 ag-grid-angular.row-height-59 .ag-cell.ag-cell-inline-editing{height:59px}dato-grid-v2 ag-grid-angular .ag-cell.checkbox-selection-cell{display:flex;padding-right:0}dato-grid-v2 .ag-menu .da-grid-icon svg{vertical-align:middle}dato-grid-v2 .ag-header-cell-sortable .ag-sort-none-icon{opacity:0;transition:opacity .2s}dato-grid-v2 .ag-header-cell-sortable:hover .ag-sort-none-icon{opacity:1}dato-grid-v2 .group-contracted-icon,dato-grid-v2 .group-expanded-icon{width:7px}dato-grid-v2 .group-expanded-icon{transform:rotate(90deg)}dato-grid-v2 .dato-grid .ag-cell{border-top:0;border-bottom:0}dato-grid-v2 .ag-overlay-wrapper ng-component{display:flex}.ag-dnd-ghost{min-width:100px;border:none;display:flex;justify-content:flex-start;align-content:center;align-items:center;cursor:-webkit-grabbing;cursor:grabbing;z-index:10000000}.ag-dnd-ghost .da-grid-icon.column-move-hide svg{height:18px;width:18px}.ag-dnd-ghost .da-grid-icon.column-move svg,.ag-dnd-ghost .da-grid-icon.column-move-pin svg{height:16px;width:16px}"]
16344
16429
  }),
16345
16430
  __metadata("design:paramtypes", [DatoGridControllerComponent, core.ElementRef])
16346
16431
  ], DatoGridV2Component);
@@ -16539,7 +16624,8 @@
16539
16624
  }
16540
16625
  Object.defineProperty(DatoGridHeaderV2Component.prototype, "enableBackground", {
16541
16626
  get: function () {
16542
- return this.controller.gridOptions.enableBackground;
16627
+ var gridOptions = this.controller.gridOptions;
16628
+ return gridOptions ? gridOptions.enableBackground : false;
16543
16629
  },
16544
16630
  enumerable: true,
16545
16631
  configurable: true
@@ -17021,6 +17107,7 @@
17021
17107
  this.gridService = gridService;
17022
17108
  this.MAX_VISIBLE_ROW_ACTIONS = 5;
17023
17109
  this.MAX_VISIBLE_GRID_ACTIONS = 2;
17110
+ this.destroy$ = new rxjs.Subject();
17024
17111
  this._maxRowActions = this.MAX_VISIBLE_ROW_ACTIONS;
17025
17112
  this.displayExport = true;
17026
17113
  this.rowActions = { mainList: [], moreMenu: [] };
@@ -17058,21 +17145,24 @@
17058
17145
  });
17059
17146
  Object.defineProperty(DatoGridV2ToolbarComponent.prototype, "enableV2_1", {
17060
17147
  get: function () {
17061
- return this.gridController.gridOptions.enableV2_1;
17148
+ var gridOptions = this.gridController.gridOptions;
17149
+ return gridOptions ? gridOptions.enableV2_1 : false;
17062
17150
  },
17063
17151
  enumerable: true,
17064
17152
  configurable: true
17065
17153
  });
17066
17154
  Object.defineProperty(DatoGridV2ToolbarComponent.prototype, "enableSearch", {
17067
17155
  get: function () {
17068
- return this.gridController.gridOptions.enableSearch;
17156
+ var gridOptions = this.gridController.gridOptions;
17157
+ return gridOptions ? gridOptions.enableSearch : false;
17069
17158
  },
17070
17159
  enumerable: true,
17071
17160
  configurable: true
17072
17161
  });
17073
17162
  Object.defineProperty(DatoGridV2ToolbarComponent.prototype, "enableBackground", {
17074
17163
  get: function () {
17075
- return this.gridController.gridOptions.enableBackground;
17164
+ var gridOptions = this.gridController.gridOptions;
17165
+ return gridOptions ? gridOptions.enableBackground : false;
17076
17166
  },
17077
17167
  enumerable: true,
17078
17168
  configurable: true
@@ -17118,17 +17208,17 @@
17118
17208
  DatoGridV2ToolbarComponent.prototype.ngOnInit = function () {
17119
17209
  var _this = this;
17120
17210
  var dataChanges = this.gridController.gridQuery.waitForGrid(function () {
17121
- return rxjs.merge(_this.gridQuery.gridRef.cellValueChanged, _this.gridQuery.gridRef.rowDataUpdated, _this.gridQuery.rowActionVisibilityChanged$).pipe(operators.debounceTime(100), ngxTakeUntilDestroy.untilDestroyed(_this));
17211
+ return rxjs.merge(_this.gridQuery.gridRef.cellValueChanged, _this.gridQuery.gridRef.rowDataUpdated, _this.gridQuery.rowActionVisibilityChanged$).pipe(operators.debounceTime(100), operators.takeUntil(_this.destroy$));
17122
17212
  });
17123
17213
  var gridInit = this.gridQuery.gridReady$.pipe(operators.take(1));
17124
- gridInit.pipe(ngxTakeUntilDestroy.untilDestroyed(this)).subscribe(function () {
17214
+ gridInit.pipe(operators.takeUntil(this.destroy$)).subscribe(function () {
17125
17215
  _this.groupsAllowed = !_this.hideGrouping && !_this.gridQuery.getValue().serverSidePagination.enabled;
17126
17216
  });
17127
17217
  this.initGridActions();
17128
17218
  var selectedRowsChanged$ = this.gridQuery.selectedRowsChange$;
17129
17219
  var isSelectAllRowsChanged$ = this.gridQuery.selectIsSelectAllRowsEnabled();
17130
17220
  rxjs.merge(dataChanges, gridInit, selectedRowsChanged$, isSelectAllRowsChanged$)
17131
- .pipe(operators.filter(function () { return !!_this.api; }), ngxTakeUntilDestroy.untilDestroyed(this))
17221
+ .pipe(operators.filter(function () { return !!_this.api; }), operators.takeUntil(this.destroy$))
17132
17222
  .subscribe(function () {
17133
17223
  _this.resolveVisibleActions();
17134
17224
  _this.cdr.detectChanges();
@@ -17304,7 +17394,7 @@
17304
17394
  var waitForAnimation = this.hasGroups ? 0 : 200;
17305
17395
  /** When changing the tables grouping all the rows are automatically expanded, we need to update the icon state */
17306
17396
  var expandSubscription = this.gridQuery.gridRef.columnRowGroupChanged
17307
- .pipe(operators.take(1), ngxTakeUntilDestroy.untilDestroyed(this))
17397
+ .pipe(operators.take(1), operators.takeUntil(this.destroy$))
17308
17398
  .subscribe(function () {
17309
17399
  _this.rowGroupsCollapsed = false;
17310
17400
  _this.cdr.detectChanges();
@@ -17321,7 +17411,7 @@
17321
17411
  gridService: _this.gridService
17322
17412
  }
17323
17413
  })
17324
- .pipe(ngxTakeUntilDestroy.untilDestroyed(_this))
17414
+ .pipe(operators.takeUntil(_this.destroy$))
17325
17415
  .subscribe(function () {
17326
17416
  expandSubscription.unsubscribe();
17327
17417
  _this.openMenus.group = false;
@@ -17338,7 +17428,10 @@
17338
17428
  DatoGridV2ToolbarComponent.prototype.clearSelectedRows = function () {
17339
17429
  this.gridService.deselectAllRows();
17340
17430
  };
17341
- DatoGridV2ToolbarComponent.prototype.ngOnDestroy = function () { };
17431
+ DatoGridV2ToolbarComponent.prototype.ngOnDestroy = function () {
17432
+ this.destroy$.next();
17433
+ this.destroy$.complete();
17434
+ };
17342
17435
  DatoGridV2ToolbarComponent.prototype.getCollapseState = function (_a) {
17343
17436
  var node = _a.node, api = _a.api;
17344
17437
  var collapsed = true;
@@ -17357,7 +17450,7 @@
17357
17450
  /** Listen to adding or removing row groups from the columns and not the groups menu */
17358
17451
  this.gridQuery
17359
17452
  .waitForGrid(function () { return _this.gridQuery.gridRef.columnRowGroupChanged; })
17360
- .pipe(operators.filter(function () { return !_this.openMenus.group; }), ngxTakeUntilDestroy.untilDestroyed(this))
17453
+ .pipe(operators.filter(function () { return !_this.openMenus.group; }), operators.takeUntil(this.destroy$))
17361
17454
  .subscribe(function () {
17362
17455
  _this.rowGroupsCollapsed = false;
17363
17456
  _this.cdr.detectChanges();
@@ -17365,7 +17458,7 @@
17365
17458
  /** Listen to row collapse state to update the icon */
17366
17459
  this.gridQuery
17367
17460
  .waitForGrid(function () { return _this.gridQuery.gridRef.rowGroupOpened; })
17368
- .pipe(ngxTakeUntilDestroy.untilDestroyed(this))
17461
+ .pipe(operators.takeUntil(this.destroy$))
17369
17462
  .subscribe(function (event) {
17370
17463
  var collapsed = _this.getCollapseState(event);
17371
17464
  if (collapsed !== _this.rowGroupsCollapsed) {
@@ -17377,7 +17470,7 @@
17377
17470
  DatoGridV2ToolbarComponent.prototype.subscribeRowsSelectionData = function () {
17378
17471
  var _this = this;
17379
17472
  this.gridQuery.rowsSelectionData$
17380
- .pipe(ngxTakeUntilDestroy.untilDestroyed(this))
17473
+ .pipe(operators.takeUntil(this.destroy$))
17381
17474
  .subscribe(function (_a) {
17382
17475
  var totalRowsCount = _a.totalRowsCount, selectedRowsCount = _a.selectedRowsCount, selectedPageRowsCount = _a.selectedPageRowsCount, isAllPageRowsSelected = _a.isAllPageRowsSelected;
17383
17476
  _this.totalRowsCount = totalRowsCount;
@@ -25753,7 +25846,7 @@
25753
25846
  };
25754
25847
  }
25755
25848
 
25756
- window.coreVersion = '22.15.0';
25849
+ window.coreVersion = '22.15.2';
25757
25850
 
25758
25851
  exports.APP_TRANSLATE = APP_TRANSLATE;
25759
25852
  exports.AceService = AceService;