@datorama/core 22.15.0 → 22.15.3
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/bundle.scss +122 -50
- package/bundles/datorama-core.umd.js +167 -47
- package/bundles/datorama-core.umd.js.map +1 -1
- package/bundles/datorama-core.umd.min.js +27 -27
- package/bundles/datorama-core.umd.min.js.map +1 -1
- package/datorama-core.metadata.json +1 -1
- package/esm2015/lib/grid/grid/grid.component.js +4 -4
- package/esm2015/lib/grid/grid-sort.utils.js +7 -2
- package/esm2015/lib/grid-v2/grid/grid-v2.component.js +10 -3
- package/esm2015/lib/grid-v2/grid/grid-v2.config.js +30 -4
- package/esm2015/lib/grid-v2/grid-controller/grid-controller.component.js +58 -24
- package/esm2015/lib/grid-v2/grid-header/grid-header.component.js +3 -2
- package/esm2015/lib/grid-v2/grid-store/grid.query.js +9 -5
- package/esm2015/lib/grid-v2/grid-store/grid.service.js +3 -2
- package/esm2015/lib/grid-v2/grid-store/util.js +27 -1
- package/esm2015/lib/grid-v2/grid-toolbar/grid-toolbar.component.js +22 -16
- package/esm2015/lib/version.js +2 -2
- package/esm5/lib/grid/grid/grid.component.js +4 -4
- package/esm5/lib/grid/grid-sort.utils.js +7 -2
- package/esm5/lib/grid-v2/grid/grid-v2.component.js +14 -3
- package/esm5/lib/grid-v2/grid/grid-v2.config.js +30 -4
- package/esm5/lib/grid-v2/grid-controller/grid-controller.component.js +62 -24
- package/esm5/lib/grid-v2/grid-header/grid-header.component.js +3 -2
- package/esm5/lib/grid-v2/grid-store/grid.query.js +9 -5
- package/esm5/lib/grid-v2/grid-store/grid.service.js +3 -2
- package/esm5/lib/grid-v2/grid-store/util.js +28 -1
- package/esm5/lib/grid-v2/grid-toolbar/grid-toolbar.component.js +22 -16
- package/esm5/lib/version.js +2 -2
- package/fesm2015/datorama-core.js +160 -48
- package/fesm2015/datorama-core.js.map +1 -1
- package/fesm5/datorama-core.js +168 -48
- package/fesm5/datorama-core.js.map +1 -1
- package/lib/grid-v2/grid/grid-v2.component.d.ts +4 -0
- package/lib/grid-v2/grid-controller/grid-controller.component.d.ts +15 -0
- package/lib/grid-v2/grid-store/grid.service.d.ts +1 -1
- package/lib/grid-v2/grid-store/util.d.ts +7 -0
- package/lib/grid-v2/grid-toolbar/grid-toolbar.component.d.ts +1 -0
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { __decorate, __metadata, __param, __rest } from 'tslib';
|
|
2
2
|
import { forwardRef, NgZone, Renderer2, Input, ViewChild, ElementRef, Component, ChangeDetectionStrategy, NgModule, Attribute, HostBinding, ɵɵdefineInjectable, Injectable, isDevMode, InjectionToken, Inject, ChangeDetectorRef, HostListener, Directive, EventEmitter, Output, ɵɵinject, ApplicationRef, Injector, INJECTOR, TemplateRef, ViewContainerRef, Pipe, ViewEncapsulation, ComponentFactoryResolver, ContentChildren, QueryList, ViewChildren, Optional, ContentChild, SkipSelf, Self, SecurityContext } from '@angular/core';
|
|
3
|
-
import { fromEvent, merge as merge$1, Subject, combineLatest, Observable, forkJoin, of, Subscription, BehaviorSubject, EMPTY, defer, interval,
|
|
3
|
+
import { fromEvent, merge as merge$1, Subject, combineLatest, Observable, forkJoin, of, Subscription, BehaviorSubject, ReplaySubject, EMPTY, defer, interval, throwError, isObservable, timer, pipe } from 'rxjs';
|
|
4
4
|
import { NG_VALUE_ACCESSOR, NgControl, FormControl, ReactiveFormsModule, Validators, FormBuilder, ControlContainer, FormGroup, FormControlDirective, FormControlName } from '@angular/forms';
|
|
5
5
|
import { untilDestroyed } from 'ngx-take-until-destroy';
|
|
6
6
|
import { debounceTime, filter as filter$1, map as map$1, pluck, tap, switchMap, takeUntil, take, auditTime, distinctUntilChanged, throttleTime, first, mapTo, startWith, pairwise, skip, shareReplay, delay as delay$1, switchMapTo, repeat, concatMap, concatMapTo } from 'rxjs/operators';
|
|
@@ -5098,10 +5098,10 @@ let DatoGridComponent = class DatoGridComponent extends BaseCustomControl {
|
|
|
5098
5098
|
this.onChange(selectedRows);
|
|
5099
5099
|
},
|
|
5100
5100
|
rowSelection: 'multiple',
|
|
5101
|
-
rowDeselection: true
|
|
5101
|
+
// rowDeselection removed: true by default in AG Grid 27 (suppress with suppressRowDeselection).
|
|
5102
5102
|
unSortIcon: true,
|
|
5103
|
-
animateRows: true
|
|
5104
|
-
rememberGroupStateWhenNewData:
|
|
5103
|
+
animateRows: true
|
|
5104
|
+
// rememberGroupStateWhenNewData removed: no-op since AG Grid 24 (transaction updates keep group state).
|
|
5105
5105
|
};
|
|
5106
5106
|
this.infinitePagination = false;
|
|
5107
5107
|
this.isRowsCollapsed = true;
|
|
@@ -9904,7 +9904,12 @@ function getGridModel(gridName) {
|
|
|
9904
9904
|
*/
|
|
9905
9905
|
function getSortModel(columnApi) {
|
|
9906
9906
|
const sortIndexes = {};
|
|
9907
|
-
|
|
9907
|
+
// AG Grid 27: getColumnState() returns undefined before the grid's columns are initialized.
|
|
9908
|
+
// getSortModel() is reached via getCurrentGridSettings()/onFilterSortChanged() on resize/data
|
|
9909
|
+
// events that can fire before that point, so guard against undefined to avoid
|
|
9910
|
+
// "Cannot read properties of undefined (reading 'filter')".
|
|
9911
|
+
const columnState = columnApi.getColumnState() || [];
|
|
9912
|
+
const sortedColumns = columnState.filter(state => state.sort != null);
|
|
9908
9913
|
sortedColumns.forEach(columnState => {
|
|
9909
9914
|
sortIndexes[columnState.colId] = columnState.sortIndex;
|
|
9910
9915
|
});
|
|
@@ -10098,6 +10103,32 @@ function tryParsePivotValue(str) {
|
|
|
10098
10103
|
}
|
|
10099
10104
|
return value;
|
|
10100
10105
|
}
|
|
10106
|
+
/** ag-grid's colId prefix for pivotRowTotals columns (PivotColDefService.PIVOT_ROW_TOTAL_PREFIX, not exported) */
|
|
10107
|
+
const PIVOT_ROW_TOTAL_COL_ID_PREFIX = 'PivotRowTotal_';
|
|
10108
|
+
/**
|
|
10109
|
+
* ag-grid 22 nested each pivot row total column in one group per pivot level, and the innermost group gets the "Total" header,
|
|
10110
|
+
* but ag-grid 27 adds the column without groups.
|
|
10111
|
+
* Turn the column def into those groups in place, as processSecondaryColDef can't replace it in its parent's children.
|
|
10112
|
+
* This relies on ag-grid checking for children before it calls processSecondaryColDef, so re-check it when moving to processPivotResultColDef.
|
|
10113
|
+
*/
|
|
10114
|
+
function wrapPivotRowTotalColDef(colDef, headerName, pivotLevels) {
|
|
10115
|
+
if (!colDef.colId || !colDef.colId.startsWith(PIVOT_ROW_TOTAL_COL_ID_PREFIX)) {
|
|
10116
|
+
return;
|
|
10117
|
+
}
|
|
10118
|
+
const totalColDef = Object.assign({}, colDef);
|
|
10119
|
+
// A 'group_' prefix can't match a pivot column id, which starts with 'pivot_' or 'PivotRowTotal_'
|
|
10120
|
+
let groupDef = {
|
|
10121
|
+
groupId: `group_${totalColDef.colId}`,
|
|
10122
|
+
headerName,
|
|
10123
|
+
headerClass: ['total-pivot-cell'],
|
|
10124
|
+
children: [totalColDef]
|
|
10125
|
+
};
|
|
10126
|
+
for (let level = 1; level < pivotLevels; level++) {
|
|
10127
|
+
groupDef = { groupId: `group_${totalColDef.colId}_${level}`, children: [groupDef] };
|
|
10128
|
+
}
|
|
10129
|
+
Object.keys(colDef).forEach(key => delete colDef[key]);
|
|
10130
|
+
Object.assign(colDef, groupDef);
|
|
10131
|
+
}
|
|
10101
10132
|
function isHtmlAllowedForCol(gridOptions, colDef) {
|
|
10102
10133
|
return (!gridOptions.disabledHTMLRenderingFields || !gridOptions.disabledHTMLRenderingFields.includes(getColField(colDef)));
|
|
10103
10134
|
}
|
|
@@ -10150,9 +10181,13 @@ let GridQuery = class GridQuery extends Query {
|
|
|
10150
10181
|
getCurrentGridSettings() {
|
|
10151
10182
|
const toColId = column => column.getColId();
|
|
10152
10183
|
const { columns } = this.api;
|
|
10153
|
-
|
|
10154
|
-
|
|
10155
|
-
|
|
10184
|
+
// AG Grid 27: getAllColumns() returns Column[] | null (and the grouped/grid column getters can
|
|
10185
|
+
// likewise be empty) before the grid's columns are initialized. getCurrentGridSettings() is
|
|
10186
|
+
// reached via fitGrid -> updateSettings on window resize, which can fire before that point, so
|
|
10187
|
+
// guard against null to avoid "Cannot read properties of undefined (reading 'filter')".
|
|
10188
|
+
const groupedColumns = columns.getRowGroupColumns() || [];
|
|
10189
|
+
const columnsOrder = columns.getAllColumns() || [];
|
|
10190
|
+
const allGridColumns = columns.getAllGridColumns() || [];
|
|
10156
10191
|
const hiddenColumns = columnsOrder
|
|
10157
10192
|
.filter(column => !column.isVisible() && !groupedColumns.includes(column))
|
|
10158
10193
|
.map(toColId);
|
|
@@ -10163,7 +10198,7 @@ let GridQuery = class GridQuery extends Query {
|
|
|
10163
10198
|
hiddenColumns,
|
|
10164
10199
|
groupedColumns: groupedColumns.map(toColId),
|
|
10165
10200
|
filter: this.getFilter(),
|
|
10166
|
-
pinnedColumns: columns.getDisplayedLeftColumns().map(toColId),
|
|
10201
|
+
pinnedColumns: (columns.getDisplayedLeftColumns() || []).map(toColId),
|
|
10167
10202
|
columnsOrder: allGridColumns.map(toColId),
|
|
10168
10203
|
columnsSizes: null,
|
|
10169
10204
|
searchTerm: null
|
|
@@ -12109,7 +12144,27 @@ const defaultGridOptions = Object.assign({
|
|
|
12109
12144
|
comparator: (a, b) => getTime$1(a) - getTime$1(b)
|
|
12110
12145
|
},
|
|
12111
12146
|
[DatoGridColumnTypes.Number]: {
|
|
12112
|
-
filter: DatoGridFilterTypes.Number
|
|
12147
|
+
filter: DatoGridFilterTypes.Number,
|
|
12148
|
+
// AG Grid resolves a column's sort comparator only from its merged colDef.comparator.
|
|
12149
|
+
// Number columns had none, so they fell back to AG Grid's default comparator, which sorts
|
|
12150
|
+
// string-typed values lexicographically ("10" before "2"). Provide an explicit numeric
|
|
12151
|
+
// comparator. Map null/empty/non-numeric to -Infinity so we never return NaN (AG Grid's
|
|
12152
|
+
// sorter skips a NaN result). Ascending-sense only — AG Grid flips the sign for descending.
|
|
12153
|
+
comparator: (a, b) => {
|
|
12154
|
+
const toNum = (v) => {
|
|
12155
|
+
const n = v == null || v === '' ? NaN : Number(v);
|
|
12156
|
+
return isNaN(n) ? -Infinity : n;
|
|
12157
|
+
};
|
|
12158
|
+
const na = toNum(a);
|
|
12159
|
+
const nb = toNum(b);
|
|
12160
|
+
// Compare relationally (not by subtraction): two missing/non-numeric values both map to
|
|
12161
|
+
// -Infinity, and -Infinity - (-Infinity) === NaN, which AG Grid's sorter skips. Returning
|
|
12162
|
+
// 0 / -1 / 1 avoids NaN entirely. Ascending sense — AG Grid flips the sign for descending.
|
|
12163
|
+
if (na === nb) {
|
|
12164
|
+
return 0;
|
|
12165
|
+
}
|
|
12166
|
+
return na < nb ? -1 : 1;
|
|
12167
|
+
}
|
|
12113
12168
|
},
|
|
12114
12169
|
[DatoGridColumnTypes.String]: stringColDef,
|
|
12115
12170
|
[DatoGridColumnTypes.Status]: Object.assign(Object.assign({}, stringColDef), { cellRenderer: 'DatoGridStatusCellComponent' }),
|
|
@@ -12117,14 +12172,20 @@ const defaultGridOptions = Object.assign({
|
|
|
12117
12172
|
[DatoGridColumnTypes.ItemsCount]: Object.assign(Object.assign({}, stringColDef), { cellRenderer: 'DatoGridItemsCountCellComponent' }),
|
|
12118
12173
|
[DatoGridColumnTypes.Initials]: Object.assign(Object.assign({}, stringColDef), { cellRenderer: 'DatoGridInitialsCellComponent' }),
|
|
12119
12174
|
[DatoGridColumnTypes.Avatar]: Object.assign(Object.assign({}, stringColDef), { cellRenderer: 'DatoGridAvatarCellComponent' })
|
|
12120
|
-
}, multiSortKey: 'ctrl', suppressPaginationPanel: true, pagination: true, paginateChildRows: true,
|
|
12175
|
+
}, multiSortKey: 'ctrl', suppressPaginationPanel: true, pagination: true, paginateChildRows: true,
|
|
12176
|
+
// deltaColumnMode removed: deprecated in AG Grid 27, delta column updates are the default now.
|
|
12177
|
+
loadingOverlayComponentFramework: DatoGridV2LoaderComponent, noRowsOverlayComponentFramework: DatoGridV2NoDataOverlayComponent, defaultColDef: {
|
|
12121
12178
|
minWidth: GridMinWidths.Default,
|
|
12122
12179
|
sortable: true,
|
|
12123
12180
|
resizable: true,
|
|
12124
12181
|
type: DatoGridColumnTypes.String,
|
|
12125
12182
|
menuTabs: ['filterMenuTab'],
|
|
12126
12183
|
headerComponentFramework: DatoGridColumnHeaderComponent
|
|
12127
|
-
},
|
|
12184
|
+
}, suppressCellFocus: true, suppressPropertyNamesCheck: true, rowHeight: 35, headerHeight: 30, rowSelection: GridRowSelectionType.MULTIPLE,
|
|
12185
|
+
// rowDeselection removed: true by default in AG Grid 27 (suppress with suppressRowDeselection).
|
|
12186
|
+
unSortIcon: true, animateRows: true,
|
|
12187
|
+
// rememberGroupStateWhenNewData removed: no-op since AG Grid 24 (transaction updates keep group state).
|
|
12188
|
+
groupDisplayType: 'multipleColumns', groupDefaultExpanded: -1, usePivotGridStyle: false, disabledHTMLRenderingFields: [] }, (isTestEnv() ? { suppressColumnVirtualisation: true, rowBuffer: 99999 } : {}));
|
|
12128
12189
|
const DEFAULT_GRID_SEARCH_DEBOUNCE_TIME = {
|
|
12129
12190
|
CLIENT: 200,
|
|
12130
12191
|
SERVER: 250
|
|
@@ -13450,6 +13511,7 @@ let GridService = class GridService {
|
|
|
13450
13511
|
return (parsedKey && parsedKey.value) || '';
|
|
13451
13512
|
});
|
|
13452
13513
|
}
|
|
13514
|
+
wrapPivotRowTotalColDef(colDef, this.translate.transform('core.total'), this.api ? this.api.columns.getPivotColumns().length : 1);
|
|
13453
13515
|
};
|
|
13454
13516
|
/** Use processPivotResultColGroupDe from ver 28 */
|
|
13455
13517
|
gridOptions.processSecondaryColGroupDef = (colGroupDef) => {
|
|
@@ -13925,14 +13987,26 @@ let DatoGridControllerComponent = class DatoGridControllerComponent {
|
|
|
13925
13987
|
this.gridActions = [];
|
|
13926
13988
|
this.gridReady$ = this.gridQuery.gridReady$;
|
|
13927
13989
|
this.contentInit = new Subject();
|
|
13990
|
+
// ngx-take-until-destroy patches ngOnDestroy on the instance, which Ivy never calls (it uses the
|
|
13991
|
+
// prototype hook), so listeners outlived the grid and hit the destroyed AG Grid API.
|
|
13992
|
+
this.destroy$ = new Subject();
|
|
13993
|
+
this.hasGridOptions = new BehaviorSubject(false);
|
|
13994
|
+
this.agGridReady = new ReplaySubject(1);
|
|
13928
13995
|
this.gridElements = {
|
|
13929
13996
|
centerViewport: null,
|
|
13930
13997
|
centerContainer: null,
|
|
13931
13998
|
bodyViewport: null
|
|
13932
13999
|
};
|
|
13933
14000
|
this.treeGridClass = 'tree';
|
|
14001
|
+
this.hasGridOptions$ = this.hasGridOptions.asObservable();
|
|
13934
14002
|
}
|
|
13935
14003
|
set gridOptions(gridOptions) {
|
|
14004
|
+
// The [gridOptions] binding can resolve to undefined during the host's initial change-detection
|
|
14005
|
+
// pass (before the consumer computes its options). Ignore it instead of throwing
|
|
14006
|
+
// "Cannot read properties of undefined" from initGridOptions() and aborting the view render.
|
|
14007
|
+
if (!gridOptions) {
|
|
14008
|
+
return;
|
|
14009
|
+
}
|
|
13936
14010
|
this._gridOptions = this.gridService.initGridOptions(gridOptions);
|
|
13937
14011
|
this.gridService.treeData = gridOptions.treeData;
|
|
13938
14012
|
this.gridService.isPivotMode = gridOptions.pivotMode;
|
|
@@ -13944,16 +14018,33 @@ let DatoGridControllerComponent = class DatoGridControllerComponent {
|
|
|
13944
14018
|
this.agGridEl.classList.add(this.treeGridClass);
|
|
13945
14019
|
}
|
|
13946
14020
|
}
|
|
14021
|
+
!this.hasGridOptions.value && this.hasGridOptions.next(true);
|
|
13947
14022
|
}
|
|
13948
14023
|
get gridOptions() {
|
|
13949
14024
|
return this._gridOptions;
|
|
13950
14025
|
}
|
|
14026
|
+
/* @internal */
|
|
14027
|
+
get agGridOptions() {
|
|
14028
|
+
if (!this._agGridOptions && this._gridOptions) {
|
|
14029
|
+
this.gridOptions = this.normalizeOptions();
|
|
14030
|
+
this._agGridOptions = this.gridOptions;
|
|
14031
|
+
}
|
|
14032
|
+
return this._agGridOptions;
|
|
14033
|
+
}
|
|
13951
14034
|
ngOnDestroy() {
|
|
14035
|
+
this.destroy$.next();
|
|
14036
|
+
this.destroy$.complete();
|
|
13952
14037
|
this.contentInit.complete();
|
|
14038
|
+
this.hasGridOptions.complete();
|
|
14039
|
+
this.agGridReady.complete();
|
|
13953
14040
|
this.clearTooltip();
|
|
13954
14041
|
this.rowHoverComponent && this.rowHoverComponent.destroy();
|
|
13955
14042
|
this.rowHoverComponent = null;
|
|
13956
14043
|
}
|
|
14044
|
+
/* @internal */
|
|
14045
|
+
onAgGridReady(event) {
|
|
14046
|
+
this.agGridReady.next(event);
|
|
14047
|
+
}
|
|
13957
14048
|
initializeGrid(agGrid, agGridEl) {
|
|
13958
14049
|
if (!this.contentInit.isStopped) {
|
|
13959
14050
|
this._initializeGrid(agGrid, agGridEl);
|
|
@@ -13967,11 +14058,13 @@ let DatoGridControllerComponent = class DatoGridControllerComponent {
|
|
|
13967
14058
|
this.contentInit
|
|
13968
14059
|
.asObservable()
|
|
13969
14060
|
.pipe(switchMap(() => {
|
|
13970
|
-
|
|
13971
|
-
|
|
14061
|
+
// Already normalized when dato-grid-v2 bound them to <ag-grid-angular [gridOptions]>.
|
|
14062
|
+
if (!this.agGridOptions) {
|
|
14063
|
+
return EMPTY;
|
|
14064
|
+
}
|
|
13972
14065
|
const settingsLoader = this.gridOptions.saveSettings === false ? of(null) : this.storageAPI.get(this.gridOptions.gridName);
|
|
13973
|
-
return combineLatest([
|
|
13974
|
-
}),
|
|
14066
|
+
return combineLatest([this.agGridReady, settingsLoader]);
|
|
14067
|
+
}), takeUntil(this.destroy$))
|
|
13975
14068
|
.subscribe(([{ api, columnApi }, savedSettings = {}]) => {
|
|
13976
14069
|
if (!this.gridOptions.rowData) {
|
|
13977
14070
|
api.showLoadingOverlay();
|
|
@@ -14041,7 +14134,7 @@ let DatoGridControllerComponent = class DatoGridControllerComponent {
|
|
|
14041
14134
|
observable = observable.pipe(filter$1(({ source }) => source === 'uiColumnDragged'), tap(() => this.updateOnHoverPos()));
|
|
14042
14135
|
}
|
|
14043
14136
|
observable
|
|
14044
|
-
.pipe(auditTime(100), filter$1(({ finished, source }) => finished && source === 'uiColumnDragged'),
|
|
14137
|
+
.pipe(auditTime(100), filter$1(({ finished, source }) => finished && source === 'uiColumnDragged'), takeUntil(this.destroy$))
|
|
14045
14138
|
.subscribe(e => {
|
|
14046
14139
|
const [column] = e.columns;
|
|
14047
14140
|
let columnsSizes = Object.assign({}, this.gridQuery.getColumnSizes());
|
|
@@ -14059,7 +14152,7 @@ let DatoGridControllerComponent = class DatoGridControllerComponent {
|
|
|
14059
14152
|
merge$1(columnVisible, sortChanged, columnRowGroupChanged, columnPinned, dragStopped, filterChanged)
|
|
14060
14153
|
.pipe(
|
|
14061
14154
|
/* Skip the initial sorting event fired by the grid when adding rows */
|
|
14062
|
-
skip(1),
|
|
14155
|
+
skip(1), takeUntil(this.destroy$))
|
|
14063
14156
|
.subscribe(({ type }) => {
|
|
14064
14157
|
const settingsDiff = this.gridService.getSettingsDiff();
|
|
14065
14158
|
this.gridService.updateSettings(settingsDiff);
|
|
@@ -14075,7 +14168,7 @@ let DatoGridControllerComponent = class DatoGridControllerComponent {
|
|
|
14075
14168
|
listenToStoreSettingsChanges() {
|
|
14076
14169
|
this.gridQuery
|
|
14077
14170
|
.select(state => state.settings)
|
|
14078
|
-
.pipe(skip(1), debounceTime(1000),
|
|
14171
|
+
.pipe(skip(1), debounceTime(1000), takeUntil(this.destroy$))
|
|
14079
14172
|
.subscribe(() => {
|
|
14080
14173
|
const settingsDiff = this.gridService.getSettingsDiff();
|
|
14081
14174
|
this.gridService.saveSettingsToServer(settingsDiff);
|
|
@@ -14100,14 +14193,14 @@ let DatoGridControllerComponent = class DatoGridControllerComponent {
|
|
|
14100
14193
|
return columns.length === 0
|
|
14101
14194
|
? EMPTY
|
|
14102
14195
|
: agGrid.cellClicked.pipe(filter$1(({ value, node }) => value !== undefined && node.group === true));
|
|
14103
|
-
}),
|
|
14196
|
+
}), takeUntil(this.destroy$))
|
|
14104
14197
|
.subscribe(({ node }) => {
|
|
14105
14198
|
node.setExpanded(!node.expanded);
|
|
14106
14199
|
});
|
|
14107
14200
|
/* When closing a grouped row we want to hide the on hover actions */
|
|
14108
14201
|
if (this.onHoverEnabled()) {
|
|
14109
14202
|
agGrid.rowGroupOpened
|
|
14110
|
-
.pipe(filter$1(({ node }) => node.expanded === false),
|
|
14203
|
+
.pipe(filter$1(({ node }) => node.expanded === false), takeUntil(this.destroy$))
|
|
14111
14204
|
.subscribe(() => {
|
|
14112
14205
|
this.lastHoveredRow = null;
|
|
14113
14206
|
this.setOnHoverState(false);
|
|
@@ -14122,7 +14215,7 @@ let DatoGridControllerComponent = class DatoGridControllerComponent {
|
|
|
14122
14215
|
fromEvent(bodyViewport, 'click')
|
|
14123
14216
|
.pipe(filter$1((event) => {
|
|
14124
14217
|
return (event.target === bodyViewport || event.target === centerViewport) && api.getSelectedRows().length > 0;
|
|
14125
|
-
}),
|
|
14218
|
+
}), takeUntil(this.destroy$))
|
|
14126
14219
|
.subscribe(() => api.deselectAll());
|
|
14127
14220
|
}
|
|
14128
14221
|
onHoverEnabled() {
|
|
@@ -14134,7 +14227,7 @@ let DatoGridControllerComponent = class DatoGridControllerComponent {
|
|
|
14134
14227
|
const onHoverEnabled = this.onHoverEnabled();
|
|
14135
14228
|
if (onHoverEnabled) {
|
|
14136
14229
|
fromEvent(centerContainer, 'mouseleave')
|
|
14137
|
-
.pipe(
|
|
14230
|
+
.pipe(takeUntil(this.destroy$))
|
|
14138
14231
|
.subscribe(() => {
|
|
14139
14232
|
this.toggleRowHoverClass(this.lastHoveredRow);
|
|
14140
14233
|
this.lastHoveredRow = null;
|
|
@@ -14142,13 +14235,13 @@ let DatoGridControllerComponent = class DatoGridControllerComponent {
|
|
|
14142
14235
|
lastHoveredCell = null;
|
|
14143
14236
|
});
|
|
14144
14237
|
merge$1(agGrid.bodyScroll.pipe(filter$1(({ direction }) => direction === 'horizontal')), agGrid.rowDataChanged)
|
|
14145
|
-
.pipe(
|
|
14238
|
+
.pipe(takeUntil(this.destroy$))
|
|
14146
14239
|
.subscribe(() => {
|
|
14147
14240
|
this.updateOnHoverPos();
|
|
14148
14241
|
});
|
|
14149
14242
|
this.addOnHoverElement();
|
|
14150
14243
|
}
|
|
14151
|
-
agGrid.cellMouseOver.pipe(
|
|
14244
|
+
agGrid.cellMouseOver.pipe(takeUntil(this.destroy$)).subscribe((event) => {
|
|
14152
14245
|
const { node, column } = event;
|
|
14153
14246
|
if (lastHoveredCell === `${node.id}-${column.getColId()}`) {
|
|
14154
14247
|
clearTimeout(this.cellMouseOutTimer);
|
|
@@ -14165,12 +14258,12 @@ let DatoGridControllerComponent = class DatoGridControllerComponent {
|
|
|
14165
14258
|
}
|
|
14166
14259
|
});
|
|
14167
14260
|
const onTooltipOut = merge$1(fromEvent(bodyViewport, 'scroll'), fromEvent(this.agGridEl, 'mouseleave'));
|
|
14168
|
-
onTooltipOut.pipe(
|
|
14261
|
+
onTooltipOut.pipe(takeUntil(this.destroy$)).subscribe(() => {
|
|
14169
14262
|
lastHoveredCell = null;
|
|
14170
14263
|
this.clearTooltip();
|
|
14171
14264
|
});
|
|
14172
14265
|
agGrid.cellMouseOut
|
|
14173
|
-
.pipe(filter$1(() => !isNil(this.tooltip)),
|
|
14266
|
+
.pipe(filter$1(() => !isNil(this.tooltip)), takeUntil(this.destroy$))
|
|
14174
14267
|
.subscribe(() => {
|
|
14175
14268
|
this.cellMouseOutTimer = window.setTimeout(() => this.clearTooltip());
|
|
14176
14269
|
});
|
|
@@ -14187,9 +14280,13 @@ let DatoGridControllerComponent = class DatoGridControllerComponent {
|
|
|
14187
14280
|
if (cell.tagName === 'SPAN' && cell.scrollWidth === 0) {
|
|
14188
14281
|
cell = cell.parentElement;
|
|
14189
14282
|
}
|
|
14190
|
-
if (event.colDef.editable) {
|
|
14283
|
+
if (event.colDef.editable && cell) {
|
|
14191
14284
|
cell = cell.querySelector('.value-wrapper') || cell;
|
|
14192
14285
|
}
|
|
14286
|
+
// AG Grid 27 can fire cellMouseOver for an element that was already detached by a re-render.
|
|
14287
|
+
if (!cell) {
|
|
14288
|
+
return;
|
|
14289
|
+
}
|
|
14193
14290
|
const textOverflow = cell.offsetWidth < cell.scrollWidth;
|
|
14194
14291
|
if (textOverflow) {
|
|
14195
14292
|
clearTimeout(this.cellMouseOutTimer);
|
|
@@ -14265,14 +14362,14 @@ let DatoGridControllerComponent = class DatoGridControllerComponent {
|
|
|
14265
14362
|
keys: 'meta.a',
|
|
14266
14363
|
ignoreInEditable: true
|
|
14267
14364
|
})
|
|
14268
|
-
.pipe(
|
|
14365
|
+
.pipe(takeUntil(this.destroy$))
|
|
14269
14366
|
.subscribe(() => {
|
|
14270
14367
|
this.gridService.selectAllCurrentPageRows();
|
|
14271
14368
|
});
|
|
14272
14369
|
}
|
|
14273
14370
|
registerWindowResizeListener() {
|
|
14274
14371
|
fromEvent(window, 'resize')
|
|
14275
|
-
.pipe(debounceTime(100), filter$1(() => this.gridQuery.gridAlignment !== 2 /* CUSTOM */),
|
|
14372
|
+
.pipe(debounceTime(100), filter$1(() => this.gridQuery.gridAlignment !== 2 /* CUSTOM */), takeUntil(this.destroy$))
|
|
14276
14373
|
.subscribe(() => {
|
|
14277
14374
|
const fitTo = this.gridQuery.gridAlignment === 0 /* FIT_TO_CONTAINER */ ? 'container' : 'content';
|
|
14278
14375
|
this.gridService.fitGrid(fitTo);
|
|
@@ -14292,7 +14389,7 @@ let DatoGridControllerComponent = class DatoGridControllerComponent {
|
|
|
14292
14389
|
const events$ = this.gridQuery.isServerSide
|
|
14293
14390
|
? merge$1(agGrid.sortChanged, agGrid.filterChanged)
|
|
14294
14391
|
: agGrid.filterChanged;
|
|
14295
|
-
events$.pipe(
|
|
14392
|
+
events$.pipe(takeUntil(this.destroy$)).subscribe(() => {
|
|
14296
14393
|
this.gridService.deselectAllRows();
|
|
14297
14394
|
});
|
|
14298
14395
|
}
|
|
@@ -14300,7 +14397,7 @@ let DatoGridControllerComponent = class DatoGridControllerComponent {
|
|
|
14300
14397
|
if (!this.gridQuery.isServerSide) {
|
|
14301
14398
|
return;
|
|
14302
14399
|
}
|
|
14303
|
-
agGrid.paginationChanged.pipe(
|
|
14400
|
+
agGrid.paginationChanged.pipe(takeUntil(this.destroy$)).subscribe(() => {
|
|
14304
14401
|
if (this.gridQuery.isServerSelectAllRowsEnabled) {
|
|
14305
14402
|
this.gridService.selectAllCurrentPageRows(true, true);
|
|
14306
14403
|
}
|
|
@@ -14373,6 +14470,7 @@ let DatoGridV2Component = class DatoGridV2Component {
|
|
|
14373
14470
|
constructor(controller, host) {
|
|
14374
14471
|
this.controller = controller;
|
|
14375
14472
|
this.host = host;
|
|
14473
|
+
this.hasGridOptions$ = this.controller.hasGridOptions$;
|
|
14376
14474
|
}
|
|
14377
14475
|
set grid(agGrid) {
|
|
14378
14476
|
if (agGrid) {
|
|
@@ -14380,6 +14478,9 @@ let DatoGridV2Component = class DatoGridV2Component {
|
|
|
14380
14478
|
this.controller.initializeGrid(agGrid, agGridEl);
|
|
14381
14479
|
}
|
|
14382
14480
|
}
|
|
14481
|
+
get agGridOptions() {
|
|
14482
|
+
return this.controller.agGridOptions;
|
|
14483
|
+
}
|
|
14383
14484
|
get gridOptions() {
|
|
14384
14485
|
return this.controller ? this.controller.gridOptions : null;
|
|
14385
14486
|
}
|
|
@@ -14392,6 +14493,9 @@ let DatoGridV2Component = class DatoGridV2Component {
|
|
|
14392
14493
|
get isPivotStyle() {
|
|
14393
14494
|
return this.gridOptions && this.gridOptions.usePivotGridStyle;
|
|
14394
14495
|
}
|
|
14496
|
+
onGridReady(event) {
|
|
14497
|
+
this.controller.onAgGridReady(event);
|
|
14498
|
+
}
|
|
14395
14499
|
};
|
|
14396
14500
|
DatoGridV2Component.ctorParameters = () => [
|
|
14397
14501
|
{ type: DatoGridControllerComponent },
|
|
@@ -14405,10 +14509,10 @@ __decorate([
|
|
|
14405
14509
|
DatoGridV2Component = __decorate([
|
|
14406
14510
|
Component({
|
|
14407
14511
|
selector: 'dato-grid-v2',
|
|
14408
|
-
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",
|
|
14512
|
+
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",
|
|
14409
14513
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
14410
14514
|
encapsulation: ViewEncapsulation.None,
|
|
14411
|
-
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-
|
|
14515
|
+
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}"]
|
|
14412
14516
|
}),
|
|
14413
14517
|
__metadata("design:paramtypes", [DatoGridControllerComponent, ElementRef])
|
|
14414
14518
|
], DatoGridV2Component);
|
|
@@ -14590,7 +14694,8 @@ let DatoGridHeaderV2Component = class DatoGridHeaderV2Component {
|
|
|
14590
14694
|
this.displayRowCount = true;
|
|
14591
14695
|
}
|
|
14592
14696
|
get enableBackground() {
|
|
14593
|
-
|
|
14697
|
+
const { gridOptions } = this.controller;
|
|
14698
|
+
return gridOptions ? gridOptions.enableBackground : false;
|
|
14594
14699
|
}
|
|
14595
14700
|
ngOnInit() {
|
|
14596
14701
|
this.rowCount$ = this.gridQuery.gridReady$.pipe(switchMap(() => this.rowsCount()));
|
|
@@ -15032,6 +15137,7 @@ let DatoGridV2ToolbarComponent = class DatoGridV2ToolbarComponent {
|
|
|
15032
15137
|
this.gridService = gridService;
|
|
15033
15138
|
this.MAX_VISIBLE_ROW_ACTIONS = 5;
|
|
15034
15139
|
this.MAX_VISIBLE_GRID_ACTIONS = 2;
|
|
15140
|
+
this.destroy$ = new Subject();
|
|
15035
15141
|
this._maxRowActions = this.MAX_VISIBLE_ROW_ACTIONS;
|
|
15036
15142
|
this.displayExport = true;
|
|
15037
15143
|
this.rowActions = { mainList: [], moreMenu: [] };
|
|
@@ -15064,13 +15170,16 @@ let DatoGridV2ToolbarComponent = class DatoGridV2ToolbarComponent {
|
|
|
15064
15170
|
}
|
|
15065
15171
|
}
|
|
15066
15172
|
get enableV2_1() {
|
|
15067
|
-
|
|
15173
|
+
const { gridOptions } = this.gridController;
|
|
15174
|
+
return gridOptions ? gridOptions.enableV2_1 : false;
|
|
15068
15175
|
}
|
|
15069
15176
|
get enableSearch() {
|
|
15070
|
-
|
|
15177
|
+
const { gridOptions } = this.gridController;
|
|
15178
|
+
return gridOptions ? gridOptions.enableSearch : false;
|
|
15071
15179
|
}
|
|
15072
15180
|
get enableBackground() {
|
|
15073
|
-
|
|
15181
|
+
const { gridOptions } = this.gridController;
|
|
15182
|
+
return gridOptions ? gridOptions.enableBackground : false;
|
|
15074
15183
|
}
|
|
15075
15184
|
get isRowActionsVisible() {
|
|
15076
15185
|
return !this.enableV2_1 || (this.enableV2_1 && this.isSelectedRow);
|
|
@@ -15088,16 +15197,16 @@ let DatoGridV2ToolbarComponent = class DatoGridV2ToolbarComponent {
|
|
|
15088
15197
|
return this.gridController.gridQuery.api;
|
|
15089
15198
|
}
|
|
15090
15199
|
ngOnInit() {
|
|
15091
|
-
const dataChanges = this.gridController.gridQuery.waitForGrid(() => merge$1(this.gridQuery.gridRef.cellValueChanged, this.gridQuery.gridRef.rowDataUpdated, this.gridQuery.rowActionVisibilityChanged$).pipe(debounceTime(100),
|
|
15200
|
+
const dataChanges = this.gridController.gridQuery.waitForGrid(() => merge$1(this.gridQuery.gridRef.cellValueChanged, this.gridQuery.gridRef.rowDataUpdated, this.gridQuery.rowActionVisibilityChanged$).pipe(debounceTime(100), takeUntil(this.destroy$)));
|
|
15092
15201
|
const gridInit = this.gridQuery.gridReady$.pipe(take(1));
|
|
15093
|
-
gridInit.pipe(
|
|
15202
|
+
gridInit.pipe(takeUntil(this.destroy$)).subscribe(() => {
|
|
15094
15203
|
this.groupsAllowed = !this.hideGrouping && !this.gridQuery.getValue().serverSidePagination.enabled;
|
|
15095
15204
|
});
|
|
15096
15205
|
this.initGridActions();
|
|
15097
15206
|
const selectedRowsChanged$ = this.gridQuery.selectedRowsChange$;
|
|
15098
15207
|
const isSelectAllRowsChanged$ = this.gridQuery.selectIsSelectAllRowsEnabled();
|
|
15099
15208
|
merge$1(dataChanges, gridInit, selectedRowsChanged$, isSelectAllRowsChanged$)
|
|
15100
|
-
.pipe(filter$1(() => !!this.api),
|
|
15209
|
+
.pipe(filter$1(() => !!this.api), takeUntil(this.destroy$))
|
|
15101
15210
|
.subscribe(() => {
|
|
15102
15211
|
this.resolveVisibleActions();
|
|
15103
15212
|
this.cdr.detectChanges();
|
|
@@ -15259,7 +15368,7 @@ let DatoGridV2ToolbarComponent = class DatoGridV2ToolbarComponent {
|
|
|
15259
15368
|
const waitForAnimation = this.hasGroups ? 0 : 200;
|
|
15260
15369
|
/** When changing the tables grouping all the rows are automatically expanded, we need to update the icon state */
|
|
15261
15370
|
const expandSubscription = this.gridQuery.gridRef.columnRowGroupChanged
|
|
15262
|
-
.pipe(take(1),
|
|
15371
|
+
.pipe(take(1), takeUntil(this.destroy$))
|
|
15263
15372
|
.subscribe(() => {
|
|
15264
15373
|
this.rowGroupsCollapsed = false;
|
|
15265
15374
|
this.cdr.detectChanges();
|
|
@@ -15276,7 +15385,7 @@ let DatoGridV2ToolbarComponent = class DatoGridV2ToolbarComponent {
|
|
|
15276
15385
|
gridService: this.gridService
|
|
15277
15386
|
}
|
|
15278
15387
|
})
|
|
15279
|
-
.pipe(
|
|
15388
|
+
.pipe(takeUntil(this.destroy$))
|
|
15280
15389
|
.subscribe(() => {
|
|
15281
15390
|
expandSubscription.unsubscribe();
|
|
15282
15391
|
this.openMenus.group = false;
|
|
@@ -15293,7 +15402,10 @@ let DatoGridV2ToolbarComponent = class DatoGridV2ToolbarComponent {
|
|
|
15293
15402
|
clearSelectedRows() {
|
|
15294
15403
|
this.gridService.deselectAllRows();
|
|
15295
15404
|
}
|
|
15296
|
-
ngOnDestroy() {
|
|
15405
|
+
ngOnDestroy() {
|
|
15406
|
+
this.destroy$.next();
|
|
15407
|
+
this.destroy$.complete();
|
|
15408
|
+
}
|
|
15297
15409
|
getCollapseState({ node, api }) {
|
|
15298
15410
|
let collapsed = true;
|
|
15299
15411
|
if (node.rowGroupIndex === 0) {
|
|
@@ -15309,7 +15421,7 @@ let DatoGridV2ToolbarComponent = class DatoGridV2ToolbarComponent {
|
|
|
15309
15421
|
/** Listen to adding or removing row groups from the columns and not the groups menu */
|
|
15310
15422
|
this.gridQuery
|
|
15311
15423
|
.waitForGrid(() => this.gridQuery.gridRef.columnRowGroupChanged)
|
|
15312
|
-
.pipe(filter$1(() => !this.openMenus.group),
|
|
15424
|
+
.pipe(filter$1(() => !this.openMenus.group), takeUntil(this.destroy$))
|
|
15313
15425
|
.subscribe(() => {
|
|
15314
15426
|
this.rowGroupsCollapsed = false;
|
|
15315
15427
|
this.cdr.detectChanges();
|
|
@@ -15317,7 +15429,7 @@ let DatoGridV2ToolbarComponent = class DatoGridV2ToolbarComponent {
|
|
|
15317
15429
|
/** Listen to row collapse state to update the icon */
|
|
15318
15430
|
this.gridQuery
|
|
15319
15431
|
.waitForGrid(() => this.gridQuery.gridRef.rowGroupOpened)
|
|
15320
|
-
.pipe(
|
|
15432
|
+
.pipe(takeUntil(this.destroy$))
|
|
15321
15433
|
.subscribe((event) => {
|
|
15322
15434
|
const collapsed = this.getCollapseState(event);
|
|
15323
15435
|
if (collapsed !== this.rowGroupsCollapsed) {
|
|
@@ -15328,7 +15440,7 @@ let DatoGridV2ToolbarComponent = class DatoGridV2ToolbarComponent {
|
|
|
15328
15440
|
}
|
|
15329
15441
|
subscribeRowsSelectionData() {
|
|
15330
15442
|
this.gridQuery.rowsSelectionData$
|
|
15331
|
-
.pipe(
|
|
15443
|
+
.pipe(takeUntil(this.destroy$))
|
|
15332
15444
|
.subscribe(({ totalRowsCount, selectedRowsCount, selectedPageRowsCount, isAllPageRowsSelected }) => {
|
|
15333
15445
|
this.totalRowsCount = totalRowsCount;
|
|
15334
15446
|
this.selectedRowsCount = selectedRowsCount;
|
|
@@ -22973,7 +23085,7 @@ function fixNgLeaks() {
|
|
|
22973
23085
|
};
|
|
22974
23086
|
}
|
|
22975
23087
|
|
|
22976
|
-
window.coreVersion = '22.15.
|
|
23088
|
+
window.coreVersion = '22.15.3';
|
|
22977
23089
|
|
|
22978
23090
|
/**
|
|
22979
23091
|
* @license
|