@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
package/fesm5/datorama-core.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { __extends, __assign, __decorate, __metadata, __values, __param, __spread, __read, __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';
|
|
@@ -5695,10 +5695,10 @@ var DatoGridComponent = /** @class */ (function (_super) {
|
|
|
5695
5695
|
_this.onChange(selectedRows);
|
|
5696
5696
|
},
|
|
5697
5697
|
rowSelection: 'multiple',
|
|
5698
|
-
rowDeselection: true
|
|
5698
|
+
// rowDeselection removed: true by default in AG Grid 27 (suppress with suppressRowDeselection).
|
|
5699
5699
|
unSortIcon: true,
|
|
5700
|
-
animateRows: true
|
|
5701
|
-
rememberGroupStateWhenNewData:
|
|
5700
|
+
animateRows: true
|
|
5701
|
+
// rememberGroupStateWhenNewData removed: no-op since AG Grid 24 (transaction updates keep group state).
|
|
5702
5702
|
};
|
|
5703
5703
|
_this.infinitePagination = false;
|
|
5704
5704
|
_this.isRowsCollapsed = true;
|
|
@@ -11157,7 +11157,12 @@ function getGridModel(gridName) {
|
|
|
11157
11157
|
*/
|
|
11158
11158
|
function getSortModel(columnApi) {
|
|
11159
11159
|
var sortIndexes = {};
|
|
11160
|
-
|
|
11160
|
+
// AG Grid 27: getColumnState() returns undefined before the grid's columns are initialized.
|
|
11161
|
+
// getSortModel() is reached via getCurrentGridSettings()/onFilterSortChanged() on resize/data
|
|
11162
|
+
// events that can fire before that point, so guard against undefined to avoid
|
|
11163
|
+
// "Cannot read properties of undefined (reading 'filter')".
|
|
11164
|
+
var columnState = columnApi.getColumnState() || [];
|
|
11165
|
+
var sortedColumns = columnState.filter(function (state) { return state.sort != null; });
|
|
11161
11166
|
sortedColumns.forEach(function (columnState) {
|
|
11162
11167
|
sortIndexes[columnState.colId] = columnState.sortIndex;
|
|
11163
11168
|
});
|
|
@@ -11372,6 +11377,32 @@ function tryParsePivotValue(str) {
|
|
|
11372
11377
|
}
|
|
11373
11378
|
return value;
|
|
11374
11379
|
}
|
|
11380
|
+
/** ag-grid's colId prefix for pivotRowTotals columns (PivotColDefService.PIVOT_ROW_TOTAL_PREFIX, not exported) */
|
|
11381
|
+
var PIVOT_ROW_TOTAL_COL_ID_PREFIX = 'PivotRowTotal_';
|
|
11382
|
+
/**
|
|
11383
|
+
* ag-grid 22 nested each pivot row total column in one group per pivot level, and the innermost group gets the "Total" header,
|
|
11384
|
+
* but ag-grid 27 adds the column without groups.
|
|
11385
|
+
* Turn the column def into those groups in place, as processSecondaryColDef can't replace it in its parent's children.
|
|
11386
|
+
* This relies on ag-grid checking for children before it calls processSecondaryColDef, so re-check it when moving to processPivotResultColDef.
|
|
11387
|
+
*/
|
|
11388
|
+
function wrapPivotRowTotalColDef(colDef, headerName, pivotLevels) {
|
|
11389
|
+
if (!colDef.colId || !colDef.colId.startsWith(PIVOT_ROW_TOTAL_COL_ID_PREFIX)) {
|
|
11390
|
+
return;
|
|
11391
|
+
}
|
|
11392
|
+
var totalColDef = __assign({}, colDef);
|
|
11393
|
+
// A 'group_' prefix can't match a pivot column id, which starts with 'pivot_' or 'PivotRowTotal_'
|
|
11394
|
+
var groupDef = {
|
|
11395
|
+
groupId: "group_" + totalColDef.colId,
|
|
11396
|
+
headerName: headerName,
|
|
11397
|
+
headerClass: ['total-pivot-cell'],
|
|
11398
|
+
children: [totalColDef]
|
|
11399
|
+
};
|
|
11400
|
+
for (var level = 1; level < pivotLevels; level++) {
|
|
11401
|
+
groupDef = { groupId: "group_" + totalColDef.colId + "_" + level, children: [groupDef] };
|
|
11402
|
+
}
|
|
11403
|
+
Object.keys(colDef).forEach(function (key) { return delete colDef[key]; });
|
|
11404
|
+
Object.assign(colDef, groupDef);
|
|
11405
|
+
}
|
|
11375
11406
|
function isHtmlAllowedForCol(gridOptions, colDef) {
|
|
11376
11407
|
return (!gridOptions.disabledHTMLRenderingFields || !gridOptions.disabledHTMLRenderingFields.includes(getColField(colDef)));
|
|
11377
11408
|
}
|
|
@@ -11452,9 +11483,13 @@ var GridQuery = /** @class */ (function (_super) {
|
|
|
11452
11483
|
GridQuery.prototype.getCurrentGridSettings = function () {
|
|
11453
11484
|
var toColId = function (column) { return column.getColId(); };
|
|
11454
11485
|
var columns = this.api.columns;
|
|
11455
|
-
|
|
11456
|
-
|
|
11457
|
-
|
|
11486
|
+
// AG Grid 27: getAllColumns() returns Column[] | null (and the grouped/grid column getters can
|
|
11487
|
+
// likewise be empty) before the grid's columns are initialized. getCurrentGridSettings() is
|
|
11488
|
+
// reached via fitGrid -> updateSettings on window resize, which can fire before that point, so
|
|
11489
|
+
// guard against null to avoid "Cannot read properties of undefined (reading 'filter')".
|
|
11490
|
+
var groupedColumns = columns.getRowGroupColumns() || [];
|
|
11491
|
+
var columnsOrder = columns.getAllColumns() || [];
|
|
11492
|
+
var allGridColumns = columns.getAllGridColumns() || [];
|
|
11458
11493
|
var hiddenColumns = columnsOrder
|
|
11459
11494
|
.filter(function (column) { return !column.isVisible() && !groupedColumns.includes(column); })
|
|
11460
11495
|
.map(toColId);
|
|
@@ -11465,7 +11500,7 @@ var GridQuery = /** @class */ (function (_super) {
|
|
|
11465
11500
|
hiddenColumns: hiddenColumns,
|
|
11466
11501
|
groupedColumns: groupedColumns.map(toColId),
|
|
11467
11502
|
filter: this.getFilter(),
|
|
11468
|
-
pinnedColumns: columns.getDisplayedLeftColumns().map(toColId),
|
|
11503
|
+
pinnedColumns: (columns.getDisplayedLeftColumns() || []).map(toColId),
|
|
11469
11504
|
columnsOrder: allGridColumns.map(toColId),
|
|
11470
11505
|
columnsSizes: null,
|
|
11471
11506
|
searchTerm: null
|
|
@@ -13611,7 +13646,27 @@ var defaultGridOptions = __assign({
|
|
|
13611
13646
|
comparator: function (a, b) { return getTime$1(a) - getTime$1(b); }
|
|
13612
13647
|
},
|
|
13613
13648
|
_a$3[DatoGridColumnTypes.Number] = {
|
|
13614
|
-
filter: DatoGridFilterTypes.Number
|
|
13649
|
+
filter: DatoGridFilterTypes.Number,
|
|
13650
|
+
// AG Grid resolves a column's sort comparator only from its merged colDef.comparator.
|
|
13651
|
+
// Number columns had none, so they fell back to AG Grid's default comparator, which sorts
|
|
13652
|
+
// string-typed values lexicographically ("10" before "2"). Provide an explicit numeric
|
|
13653
|
+
// comparator. Map null/empty/non-numeric to -Infinity so we never return NaN (AG Grid's
|
|
13654
|
+
// sorter skips a NaN result). Ascending-sense only — AG Grid flips the sign for descending.
|
|
13655
|
+
comparator: function (a, b) {
|
|
13656
|
+
var toNum = function (v) {
|
|
13657
|
+
var n = v == null || v === '' ? NaN : Number(v);
|
|
13658
|
+
return isNaN(n) ? -Infinity : n;
|
|
13659
|
+
};
|
|
13660
|
+
var na = toNum(a);
|
|
13661
|
+
var nb = toNum(b);
|
|
13662
|
+
// Compare relationally (not by subtraction): two missing/non-numeric values both map to
|
|
13663
|
+
// -Infinity, and -Infinity - (-Infinity) === NaN, which AG Grid's sorter skips. Returning
|
|
13664
|
+
// 0 / -1 / 1 avoids NaN entirely. Ascending sense — AG Grid flips the sign for descending.
|
|
13665
|
+
if (na === nb) {
|
|
13666
|
+
return 0;
|
|
13667
|
+
}
|
|
13668
|
+
return na < nb ? -1 : 1;
|
|
13669
|
+
}
|
|
13615
13670
|
},
|
|
13616
13671
|
_a$3[DatoGridColumnTypes.String] = stringColDef,
|
|
13617
13672
|
_a$3[DatoGridColumnTypes.Status] = __assign(__assign({}, stringColDef), { cellRenderer: 'DatoGridStatusCellComponent' }),
|
|
@@ -13619,14 +13674,20 @@ var defaultGridOptions = __assign({
|
|
|
13619
13674
|
_a$3[DatoGridColumnTypes.ItemsCount] = __assign(__assign({}, stringColDef), { cellRenderer: 'DatoGridItemsCountCellComponent' }),
|
|
13620
13675
|
_a$3[DatoGridColumnTypes.Initials] = __assign(__assign({}, stringColDef), { cellRenderer: 'DatoGridInitialsCellComponent' }),
|
|
13621
13676
|
_a$3[DatoGridColumnTypes.Avatar] = __assign(__assign({}, stringColDef), { cellRenderer: 'DatoGridAvatarCellComponent' }),
|
|
13622
|
-
_a$3), multiSortKey: 'ctrl', suppressPaginationPanel: true, pagination: true, paginateChildRows: true,
|
|
13677
|
+
_a$3), multiSortKey: 'ctrl', suppressPaginationPanel: true, pagination: true, paginateChildRows: true,
|
|
13678
|
+
// deltaColumnMode removed: deprecated in AG Grid 27, delta column updates are the default now.
|
|
13679
|
+
loadingOverlayComponentFramework: DatoGridV2LoaderComponent, noRowsOverlayComponentFramework: DatoGridV2NoDataOverlayComponent, defaultColDef: {
|
|
13623
13680
|
minWidth: GridMinWidths.Default,
|
|
13624
13681
|
sortable: true,
|
|
13625
13682
|
resizable: true,
|
|
13626
13683
|
type: DatoGridColumnTypes.String,
|
|
13627
13684
|
menuTabs: ['filterMenuTab'],
|
|
13628
13685
|
headerComponentFramework: DatoGridColumnHeaderComponent
|
|
13629
|
-
},
|
|
13686
|
+
}, suppressCellFocus: true, suppressPropertyNamesCheck: true, rowHeight: 35, headerHeight: 30, rowSelection: GridRowSelectionType.MULTIPLE,
|
|
13687
|
+
// rowDeselection removed: true by default in AG Grid 27 (suppress with suppressRowDeselection).
|
|
13688
|
+
unSortIcon: true, animateRows: true,
|
|
13689
|
+
// rememberGroupStateWhenNewData removed: no-op since AG Grid 24 (transaction updates keep group state).
|
|
13690
|
+
groupDisplayType: 'multipleColumns', groupDefaultExpanded: -1, usePivotGridStyle: false, disabledHTMLRenderingFields: [] }, (isTestEnv() ? { suppressColumnVirtualisation: true, rowBuffer: 99999 } : {}));
|
|
13630
13691
|
var DEFAULT_GRID_SEARCH_DEBOUNCE_TIME = {
|
|
13631
13692
|
CLIENT: 200,
|
|
13632
13693
|
SERVER: 250
|
|
@@ -15087,6 +15148,7 @@ var GridService = /** @class */ (function () {
|
|
|
15087
15148
|
return (parsedKey && parsedKey.value) || '';
|
|
15088
15149
|
});
|
|
15089
15150
|
}
|
|
15151
|
+
wrapPivotRowTotalColDef(colDef, _this.translate.transform('core.total'), _this.api ? _this.api.columns.getPivotColumns().length : 1);
|
|
15090
15152
|
};
|
|
15091
15153
|
/** Use processPivotResultColGroupDe from ver 28 */
|
|
15092
15154
|
gridOptions.processSecondaryColGroupDef = function (colGroupDef) {
|
|
@@ -15596,18 +15658,30 @@ var DatoGridControllerComponent = /** @class */ (function () {
|
|
|
15596
15658
|
this.gridActions = [];
|
|
15597
15659
|
this.gridReady$ = this.gridQuery.gridReady$;
|
|
15598
15660
|
this.contentInit = new Subject();
|
|
15661
|
+
// ngx-take-until-destroy patches ngOnDestroy on the instance, which Ivy never calls (it uses the
|
|
15662
|
+
// prototype hook), so listeners outlived the grid and hit the destroyed AG Grid API.
|
|
15663
|
+
this.destroy$ = new Subject();
|
|
15664
|
+
this.hasGridOptions = new BehaviorSubject(false);
|
|
15665
|
+
this.agGridReady = new ReplaySubject(1);
|
|
15599
15666
|
this.gridElements = {
|
|
15600
15667
|
centerViewport: null,
|
|
15601
15668
|
centerContainer: null,
|
|
15602
15669
|
bodyViewport: null
|
|
15603
15670
|
};
|
|
15604
15671
|
this.treeGridClass = 'tree';
|
|
15672
|
+
this.hasGridOptions$ = this.hasGridOptions.asObservable();
|
|
15605
15673
|
}
|
|
15606
15674
|
Object.defineProperty(DatoGridControllerComponent.prototype, "gridOptions", {
|
|
15607
15675
|
get: function () {
|
|
15608
15676
|
return this._gridOptions;
|
|
15609
15677
|
},
|
|
15610
15678
|
set: function (gridOptions) {
|
|
15679
|
+
// The [gridOptions] binding can resolve to undefined during the host's initial change-detection
|
|
15680
|
+
// pass (before the consumer computes its options). Ignore it instead of throwing
|
|
15681
|
+
// "Cannot read properties of undefined" from initGridOptions() and aborting the view render.
|
|
15682
|
+
if (!gridOptions) {
|
|
15683
|
+
return;
|
|
15684
|
+
}
|
|
15611
15685
|
this._gridOptions = this.gridService.initGridOptions(gridOptions);
|
|
15612
15686
|
this.gridService.treeData = gridOptions.treeData;
|
|
15613
15687
|
this.gridService.isPivotMode = gridOptions.pivotMode;
|
|
@@ -15619,16 +15693,37 @@ var DatoGridControllerComponent = /** @class */ (function () {
|
|
|
15619
15693
|
this.agGridEl.classList.add(this.treeGridClass);
|
|
15620
15694
|
}
|
|
15621
15695
|
}
|
|
15696
|
+
!this.hasGridOptions.value && this.hasGridOptions.next(true);
|
|
15697
|
+
},
|
|
15698
|
+
enumerable: true,
|
|
15699
|
+
configurable: true
|
|
15700
|
+
});
|
|
15701
|
+
Object.defineProperty(DatoGridControllerComponent.prototype, "agGridOptions", {
|
|
15702
|
+
/* @internal */
|
|
15703
|
+
get: function () {
|
|
15704
|
+
if (!this._agGridOptions && this._gridOptions) {
|
|
15705
|
+
this.gridOptions = this.normalizeOptions();
|
|
15706
|
+
this._agGridOptions = this.gridOptions;
|
|
15707
|
+
}
|
|
15708
|
+
return this._agGridOptions;
|
|
15622
15709
|
},
|
|
15623
15710
|
enumerable: true,
|
|
15624
15711
|
configurable: true
|
|
15625
15712
|
});
|
|
15626
15713
|
DatoGridControllerComponent.prototype.ngOnDestroy = function () {
|
|
15714
|
+
this.destroy$.next();
|
|
15715
|
+
this.destroy$.complete();
|
|
15627
15716
|
this.contentInit.complete();
|
|
15717
|
+
this.hasGridOptions.complete();
|
|
15718
|
+
this.agGridReady.complete();
|
|
15628
15719
|
this.clearTooltip();
|
|
15629
15720
|
this.rowHoverComponent && this.rowHoverComponent.destroy();
|
|
15630
15721
|
this.rowHoverComponent = null;
|
|
15631
15722
|
};
|
|
15723
|
+
/* @internal */
|
|
15724
|
+
DatoGridControllerComponent.prototype.onAgGridReady = function (event) {
|
|
15725
|
+
this.agGridReady.next(event);
|
|
15726
|
+
};
|
|
15632
15727
|
DatoGridControllerComponent.prototype.initializeGrid = function (agGrid, agGridEl) {
|
|
15633
15728
|
if (!this.contentInit.isStopped) {
|
|
15634
15729
|
this._initializeGrid(agGrid, agGridEl);
|
|
@@ -15643,11 +15738,13 @@ var DatoGridControllerComponent = /** @class */ (function () {
|
|
|
15643
15738
|
this.contentInit
|
|
15644
15739
|
.asObservable()
|
|
15645
15740
|
.pipe(switchMap(function () {
|
|
15646
|
-
|
|
15647
|
-
|
|
15741
|
+
// Already normalized when dato-grid-v2 bound them to <ag-grid-angular [gridOptions]>.
|
|
15742
|
+
if (!_this.agGridOptions) {
|
|
15743
|
+
return EMPTY;
|
|
15744
|
+
}
|
|
15648
15745
|
var settingsLoader = _this.gridOptions.saveSettings === false ? of(null) : _this.storageAPI.get(_this.gridOptions.gridName);
|
|
15649
|
-
return combineLatest([
|
|
15650
|
-
}),
|
|
15746
|
+
return combineLatest([_this.agGridReady, settingsLoader]);
|
|
15747
|
+
}), takeUntil(this.destroy$))
|
|
15651
15748
|
.subscribe(function (_a) {
|
|
15652
15749
|
var _b = __read(_a, 2), _c = _b[0], api = _c.api, columnApi = _c.columnApi, _d = _b[1], savedSettings = _d === void 0 ? {} : _d;
|
|
15653
15750
|
if (!_this.gridOptions.rowData) {
|
|
@@ -15726,7 +15823,7 @@ var DatoGridControllerComponent = /** @class */ (function () {
|
|
|
15726
15823
|
.pipe(auditTime(100), filter$1(function (_a) {
|
|
15727
15824
|
var finished = _a.finished, source = _a.source;
|
|
15728
15825
|
return finished && source === 'uiColumnDragged';
|
|
15729
|
-
}),
|
|
15826
|
+
}), takeUntil(this.destroy$))
|
|
15730
15827
|
.subscribe(function (e) {
|
|
15731
15828
|
var _a = __read(e.columns, 1), column = _a[0];
|
|
15732
15829
|
var columnsSizes = __assign({}, _this.gridQuery.getColumnSizes());
|
|
@@ -15745,7 +15842,7 @@ var DatoGridControllerComponent = /** @class */ (function () {
|
|
|
15745
15842
|
merge$1(columnVisible, sortChanged, columnRowGroupChanged, columnPinned, dragStopped, filterChanged)
|
|
15746
15843
|
.pipe(
|
|
15747
15844
|
/* Skip the initial sorting event fired by the grid when adding rows */
|
|
15748
|
-
skip(1),
|
|
15845
|
+
skip(1), takeUntil(this.destroy$))
|
|
15749
15846
|
.subscribe(function (_a) {
|
|
15750
15847
|
var type = _a.type;
|
|
15751
15848
|
var settingsDiff = _this.gridService.getSettingsDiff();
|
|
@@ -15763,7 +15860,7 @@ var DatoGridControllerComponent = /** @class */ (function () {
|
|
|
15763
15860
|
var _this = this;
|
|
15764
15861
|
this.gridQuery
|
|
15765
15862
|
.select(function (state) { return state.settings; })
|
|
15766
|
-
.pipe(skip(1), debounceTime(1000),
|
|
15863
|
+
.pipe(skip(1), debounceTime(1000), takeUntil(this.destroy$))
|
|
15767
15864
|
.subscribe(function () {
|
|
15768
15865
|
var settingsDiff = _this.gridService.getSettingsDiff();
|
|
15769
15866
|
_this.gridService.saveSettingsToServer(settingsDiff);
|
|
@@ -15793,7 +15890,7 @@ var DatoGridControllerComponent = /** @class */ (function () {
|
|
|
15793
15890
|
var value = _a.value, node = _a.node;
|
|
15794
15891
|
return value !== undefined && node.group === true;
|
|
15795
15892
|
}));
|
|
15796
|
-
}),
|
|
15893
|
+
}), takeUntil(this.destroy$))
|
|
15797
15894
|
.subscribe(function (_a) {
|
|
15798
15895
|
var node = _a.node;
|
|
15799
15896
|
node.setExpanded(!node.expanded);
|
|
@@ -15804,7 +15901,7 @@ var DatoGridControllerComponent = /** @class */ (function () {
|
|
|
15804
15901
|
.pipe(filter$1(function (_a) {
|
|
15805
15902
|
var node = _a.node;
|
|
15806
15903
|
return node.expanded === false;
|
|
15807
|
-
}),
|
|
15904
|
+
}), takeUntil(this.destroy$))
|
|
15808
15905
|
.subscribe(function () {
|
|
15809
15906
|
_this.lastHoveredRow = null;
|
|
15810
15907
|
_this.setOnHoverState(false);
|
|
@@ -15819,7 +15916,7 @@ var DatoGridControllerComponent = /** @class */ (function () {
|
|
|
15819
15916
|
fromEvent(bodyViewport, 'click')
|
|
15820
15917
|
.pipe(filter$1(function (event) {
|
|
15821
15918
|
return (event.target === bodyViewport || event.target === centerViewport) && api.getSelectedRows().length > 0;
|
|
15822
|
-
}),
|
|
15919
|
+
}), takeUntil(this.destroy$))
|
|
15823
15920
|
.subscribe(function () { return api.deselectAll(); });
|
|
15824
15921
|
};
|
|
15825
15922
|
DatoGridControllerComponent.prototype.onHoverEnabled = function () {
|
|
@@ -15832,7 +15929,7 @@ var DatoGridControllerComponent = /** @class */ (function () {
|
|
|
15832
15929
|
var onHoverEnabled = this.onHoverEnabled();
|
|
15833
15930
|
if (onHoverEnabled) {
|
|
15834
15931
|
fromEvent(centerContainer, 'mouseleave')
|
|
15835
|
-
.pipe(
|
|
15932
|
+
.pipe(takeUntil(this.destroy$))
|
|
15836
15933
|
.subscribe(function () {
|
|
15837
15934
|
_this.toggleRowHoverClass(_this.lastHoveredRow);
|
|
15838
15935
|
_this.lastHoveredRow = null;
|
|
@@ -15843,13 +15940,13 @@ var DatoGridControllerComponent = /** @class */ (function () {
|
|
|
15843
15940
|
var direction = _a.direction;
|
|
15844
15941
|
return direction === 'horizontal';
|
|
15845
15942
|
})), agGrid.rowDataChanged)
|
|
15846
|
-
.pipe(
|
|
15943
|
+
.pipe(takeUntil(this.destroy$))
|
|
15847
15944
|
.subscribe(function () {
|
|
15848
15945
|
_this.updateOnHoverPos();
|
|
15849
15946
|
});
|
|
15850
15947
|
this.addOnHoverElement();
|
|
15851
15948
|
}
|
|
15852
|
-
agGrid.cellMouseOver.pipe(
|
|
15949
|
+
agGrid.cellMouseOver.pipe(takeUntil(this.destroy$)).subscribe(function (event) {
|
|
15853
15950
|
var node = event.node, column = event.column;
|
|
15854
15951
|
if (lastHoveredCell === node.id + "-" + column.getColId()) {
|
|
15855
15952
|
clearTimeout(_this.cellMouseOutTimer);
|
|
@@ -15866,12 +15963,12 @@ var DatoGridControllerComponent = /** @class */ (function () {
|
|
|
15866
15963
|
}
|
|
15867
15964
|
});
|
|
15868
15965
|
var onTooltipOut = merge$1(fromEvent(bodyViewport, 'scroll'), fromEvent(this.agGridEl, 'mouseleave'));
|
|
15869
|
-
onTooltipOut.pipe(
|
|
15966
|
+
onTooltipOut.pipe(takeUntil(this.destroy$)).subscribe(function () {
|
|
15870
15967
|
lastHoveredCell = null;
|
|
15871
15968
|
_this.clearTooltip();
|
|
15872
15969
|
});
|
|
15873
15970
|
agGrid.cellMouseOut
|
|
15874
|
-
.pipe(filter$1(function () { return !isNil(_this.tooltip); }),
|
|
15971
|
+
.pipe(filter$1(function () { return !isNil(_this.tooltip); }), takeUntil(this.destroy$))
|
|
15875
15972
|
.subscribe(function () {
|
|
15876
15973
|
_this.cellMouseOutTimer = window.setTimeout(function () { return _this.clearTooltip(); });
|
|
15877
15974
|
});
|
|
@@ -15888,9 +15985,13 @@ var DatoGridControllerComponent = /** @class */ (function () {
|
|
|
15888
15985
|
if (cell.tagName === 'SPAN' && cell.scrollWidth === 0) {
|
|
15889
15986
|
cell = cell.parentElement;
|
|
15890
15987
|
}
|
|
15891
|
-
if (event.colDef.editable) {
|
|
15988
|
+
if (event.colDef.editable && cell) {
|
|
15892
15989
|
cell = cell.querySelector('.value-wrapper') || cell;
|
|
15893
15990
|
}
|
|
15991
|
+
// AG Grid 27 can fire cellMouseOver for an element that was already detached by a re-render.
|
|
15992
|
+
if (!cell) {
|
|
15993
|
+
return;
|
|
15994
|
+
}
|
|
15894
15995
|
var textOverflow = cell.offsetWidth < cell.scrollWidth;
|
|
15895
15996
|
if (textOverflow) {
|
|
15896
15997
|
clearTimeout(this.cellMouseOutTimer);
|
|
@@ -15974,7 +16075,7 @@ var DatoGridControllerComponent = /** @class */ (function () {
|
|
|
15974
16075
|
keys: 'meta.a',
|
|
15975
16076
|
ignoreInEditable: true
|
|
15976
16077
|
})
|
|
15977
|
-
.pipe(
|
|
16078
|
+
.pipe(takeUntil(this.destroy$))
|
|
15978
16079
|
.subscribe(function () {
|
|
15979
16080
|
_this.gridService.selectAllCurrentPageRows();
|
|
15980
16081
|
});
|
|
@@ -15982,7 +16083,7 @@ var DatoGridControllerComponent = /** @class */ (function () {
|
|
|
15982
16083
|
DatoGridControllerComponent.prototype.registerWindowResizeListener = function () {
|
|
15983
16084
|
var _this = this;
|
|
15984
16085
|
fromEvent(window, 'resize')
|
|
15985
|
-
.pipe(debounceTime(100), filter$1(function () { return _this.gridQuery.gridAlignment !== 2 /* CUSTOM */; }),
|
|
16086
|
+
.pipe(debounceTime(100), filter$1(function () { return _this.gridQuery.gridAlignment !== 2 /* CUSTOM */; }), takeUntil(this.destroy$))
|
|
15986
16087
|
.subscribe(function () {
|
|
15987
16088
|
var fitTo = _this.gridQuery.gridAlignment === 0 /* FIT_TO_CONTAINER */ ? 'container' : 'content';
|
|
15988
16089
|
_this.gridService.fitGrid(fitTo);
|
|
@@ -16006,7 +16107,7 @@ var DatoGridControllerComponent = /** @class */ (function () {
|
|
|
16006
16107
|
var events$ = this.gridQuery.isServerSide
|
|
16007
16108
|
? merge$1(agGrid.sortChanged, agGrid.filterChanged)
|
|
16008
16109
|
: agGrid.filterChanged;
|
|
16009
|
-
events$.pipe(
|
|
16110
|
+
events$.pipe(takeUntil(this.destroy$)).subscribe(function () {
|
|
16010
16111
|
_this.gridService.deselectAllRows();
|
|
16011
16112
|
});
|
|
16012
16113
|
};
|
|
@@ -16015,7 +16116,7 @@ var DatoGridControllerComponent = /** @class */ (function () {
|
|
|
16015
16116
|
if (!this.gridQuery.isServerSide) {
|
|
16016
16117
|
return;
|
|
16017
16118
|
}
|
|
16018
|
-
agGrid.paginationChanged.pipe(
|
|
16119
|
+
agGrid.paginationChanged.pipe(takeUntil(this.destroy$)).subscribe(function () {
|
|
16019
16120
|
if (_this.gridQuery.isServerSelectAllRowsEnabled) {
|
|
16020
16121
|
_this.gridService.selectAllCurrentPageRows(true, true);
|
|
16021
16122
|
}
|
|
@@ -16087,6 +16188,7 @@ var DatoGridV2Component = /** @class */ (function () {
|
|
|
16087
16188
|
function DatoGridV2Component(controller, host) {
|
|
16088
16189
|
this.controller = controller;
|
|
16089
16190
|
this.host = host;
|
|
16191
|
+
this.hasGridOptions$ = this.controller.hasGridOptions$;
|
|
16090
16192
|
}
|
|
16091
16193
|
Object.defineProperty(DatoGridV2Component.prototype, "grid", {
|
|
16092
16194
|
set: function (agGrid) {
|
|
@@ -16098,6 +16200,13 @@ var DatoGridV2Component = /** @class */ (function () {
|
|
|
16098
16200
|
enumerable: true,
|
|
16099
16201
|
configurable: true
|
|
16100
16202
|
});
|
|
16203
|
+
Object.defineProperty(DatoGridV2Component.prototype, "agGridOptions", {
|
|
16204
|
+
get: function () {
|
|
16205
|
+
return this.controller.agGridOptions;
|
|
16206
|
+
},
|
|
16207
|
+
enumerable: true,
|
|
16208
|
+
configurable: true
|
|
16209
|
+
});
|
|
16101
16210
|
Object.defineProperty(DatoGridV2Component.prototype, "gridOptions", {
|
|
16102
16211
|
get: function () {
|
|
16103
16212
|
return this.controller ? this.controller.gridOptions : null;
|
|
@@ -16126,6 +16235,9 @@ var DatoGridV2Component = /** @class */ (function () {
|
|
|
16126
16235
|
enumerable: true,
|
|
16127
16236
|
configurable: true
|
|
16128
16237
|
});
|
|
16238
|
+
DatoGridV2Component.prototype.onGridReady = function (event) {
|
|
16239
|
+
this.controller.onAgGridReady(event);
|
|
16240
|
+
};
|
|
16129
16241
|
DatoGridV2Component.ctorParameters = function () { return [
|
|
16130
16242
|
{ type: DatoGridControllerComponent },
|
|
16131
16243
|
{ type: ElementRef }
|
|
@@ -16138,10 +16250,10 @@ var DatoGridV2Component = /** @class */ (function () {
|
|
|
16138
16250
|
DatoGridV2Component = __decorate([
|
|
16139
16251
|
Component({
|
|
16140
16252
|
selector: 'dato-grid-v2',
|
|
16141
|
-
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",
|
|
16253
|
+
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",
|
|
16142
16254
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
16143
16255
|
encapsulation: ViewEncapsulation.None,
|
|
16144
|
-
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-
|
|
16256
|
+
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}"]
|
|
16145
16257
|
}),
|
|
16146
16258
|
__metadata("design:paramtypes", [DatoGridControllerComponent, ElementRef])
|
|
16147
16259
|
], DatoGridV2Component);
|
|
@@ -16340,7 +16452,8 @@ var DatoGridHeaderV2Component = /** @class */ (function () {
|
|
|
16340
16452
|
}
|
|
16341
16453
|
Object.defineProperty(DatoGridHeaderV2Component.prototype, "enableBackground", {
|
|
16342
16454
|
get: function () {
|
|
16343
|
-
|
|
16455
|
+
var gridOptions = this.controller.gridOptions;
|
|
16456
|
+
return gridOptions ? gridOptions.enableBackground : false;
|
|
16344
16457
|
},
|
|
16345
16458
|
enumerable: true,
|
|
16346
16459
|
configurable: true
|
|
@@ -16822,6 +16935,7 @@ var DatoGridV2ToolbarComponent = /** @class */ (function () {
|
|
|
16822
16935
|
this.gridService = gridService;
|
|
16823
16936
|
this.MAX_VISIBLE_ROW_ACTIONS = 5;
|
|
16824
16937
|
this.MAX_VISIBLE_GRID_ACTIONS = 2;
|
|
16938
|
+
this.destroy$ = new Subject();
|
|
16825
16939
|
this._maxRowActions = this.MAX_VISIBLE_ROW_ACTIONS;
|
|
16826
16940
|
this.displayExport = true;
|
|
16827
16941
|
this.rowActions = { mainList: [], moreMenu: [] };
|
|
@@ -16859,21 +16973,24 @@ var DatoGridV2ToolbarComponent = /** @class */ (function () {
|
|
|
16859
16973
|
});
|
|
16860
16974
|
Object.defineProperty(DatoGridV2ToolbarComponent.prototype, "enableV2_1", {
|
|
16861
16975
|
get: function () {
|
|
16862
|
-
|
|
16976
|
+
var gridOptions = this.gridController.gridOptions;
|
|
16977
|
+
return gridOptions ? gridOptions.enableV2_1 : false;
|
|
16863
16978
|
},
|
|
16864
16979
|
enumerable: true,
|
|
16865
16980
|
configurable: true
|
|
16866
16981
|
});
|
|
16867
16982
|
Object.defineProperty(DatoGridV2ToolbarComponent.prototype, "enableSearch", {
|
|
16868
16983
|
get: function () {
|
|
16869
|
-
|
|
16984
|
+
var gridOptions = this.gridController.gridOptions;
|
|
16985
|
+
return gridOptions ? gridOptions.enableSearch : false;
|
|
16870
16986
|
},
|
|
16871
16987
|
enumerable: true,
|
|
16872
16988
|
configurable: true
|
|
16873
16989
|
});
|
|
16874
16990
|
Object.defineProperty(DatoGridV2ToolbarComponent.prototype, "enableBackground", {
|
|
16875
16991
|
get: function () {
|
|
16876
|
-
|
|
16992
|
+
var gridOptions = this.gridController.gridOptions;
|
|
16993
|
+
return gridOptions ? gridOptions.enableBackground : false;
|
|
16877
16994
|
},
|
|
16878
16995
|
enumerable: true,
|
|
16879
16996
|
configurable: true
|
|
@@ -16919,17 +17036,17 @@ var DatoGridV2ToolbarComponent = /** @class */ (function () {
|
|
|
16919
17036
|
DatoGridV2ToolbarComponent.prototype.ngOnInit = function () {
|
|
16920
17037
|
var _this = this;
|
|
16921
17038
|
var dataChanges = this.gridController.gridQuery.waitForGrid(function () {
|
|
16922
|
-
return merge$1(_this.gridQuery.gridRef.cellValueChanged, _this.gridQuery.gridRef.rowDataUpdated, _this.gridQuery.rowActionVisibilityChanged$).pipe(debounceTime(100),
|
|
17039
|
+
return merge$1(_this.gridQuery.gridRef.cellValueChanged, _this.gridQuery.gridRef.rowDataUpdated, _this.gridQuery.rowActionVisibilityChanged$).pipe(debounceTime(100), takeUntil(_this.destroy$));
|
|
16923
17040
|
});
|
|
16924
17041
|
var gridInit = this.gridQuery.gridReady$.pipe(take(1));
|
|
16925
|
-
gridInit.pipe(
|
|
17042
|
+
gridInit.pipe(takeUntil(this.destroy$)).subscribe(function () {
|
|
16926
17043
|
_this.groupsAllowed = !_this.hideGrouping && !_this.gridQuery.getValue().serverSidePagination.enabled;
|
|
16927
17044
|
});
|
|
16928
17045
|
this.initGridActions();
|
|
16929
17046
|
var selectedRowsChanged$ = this.gridQuery.selectedRowsChange$;
|
|
16930
17047
|
var isSelectAllRowsChanged$ = this.gridQuery.selectIsSelectAllRowsEnabled();
|
|
16931
17048
|
merge$1(dataChanges, gridInit, selectedRowsChanged$, isSelectAllRowsChanged$)
|
|
16932
|
-
.pipe(filter$1(function () { return !!_this.api; }),
|
|
17049
|
+
.pipe(filter$1(function () { return !!_this.api; }), takeUntil(this.destroy$))
|
|
16933
17050
|
.subscribe(function () {
|
|
16934
17051
|
_this.resolveVisibleActions();
|
|
16935
17052
|
_this.cdr.detectChanges();
|
|
@@ -17105,7 +17222,7 @@ var DatoGridV2ToolbarComponent = /** @class */ (function () {
|
|
|
17105
17222
|
var waitForAnimation = this.hasGroups ? 0 : 200;
|
|
17106
17223
|
/** When changing the tables grouping all the rows are automatically expanded, we need to update the icon state */
|
|
17107
17224
|
var expandSubscription = this.gridQuery.gridRef.columnRowGroupChanged
|
|
17108
|
-
.pipe(take(1),
|
|
17225
|
+
.pipe(take(1), takeUntil(this.destroy$))
|
|
17109
17226
|
.subscribe(function () {
|
|
17110
17227
|
_this.rowGroupsCollapsed = false;
|
|
17111
17228
|
_this.cdr.detectChanges();
|
|
@@ -17122,7 +17239,7 @@ var DatoGridV2ToolbarComponent = /** @class */ (function () {
|
|
|
17122
17239
|
gridService: _this.gridService
|
|
17123
17240
|
}
|
|
17124
17241
|
})
|
|
17125
|
-
.pipe(
|
|
17242
|
+
.pipe(takeUntil(_this.destroy$))
|
|
17126
17243
|
.subscribe(function () {
|
|
17127
17244
|
expandSubscription.unsubscribe();
|
|
17128
17245
|
_this.openMenus.group = false;
|
|
@@ -17139,7 +17256,10 @@ var DatoGridV2ToolbarComponent = /** @class */ (function () {
|
|
|
17139
17256
|
DatoGridV2ToolbarComponent.prototype.clearSelectedRows = function () {
|
|
17140
17257
|
this.gridService.deselectAllRows();
|
|
17141
17258
|
};
|
|
17142
|
-
DatoGridV2ToolbarComponent.prototype.ngOnDestroy = function () {
|
|
17259
|
+
DatoGridV2ToolbarComponent.prototype.ngOnDestroy = function () {
|
|
17260
|
+
this.destroy$.next();
|
|
17261
|
+
this.destroy$.complete();
|
|
17262
|
+
};
|
|
17143
17263
|
DatoGridV2ToolbarComponent.prototype.getCollapseState = function (_a) {
|
|
17144
17264
|
var node = _a.node, api = _a.api;
|
|
17145
17265
|
var collapsed = true;
|
|
@@ -17158,7 +17278,7 @@ var DatoGridV2ToolbarComponent = /** @class */ (function () {
|
|
|
17158
17278
|
/** Listen to adding or removing row groups from the columns and not the groups menu */
|
|
17159
17279
|
this.gridQuery
|
|
17160
17280
|
.waitForGrid(function () { return _this.gridQuery.gridRef.columnRowGroupChanged; })
|
|
17161
|
-
.pipe(filter$1(function () { return !_this.openMenus.group; }),
|
|
17281
|
+
.pipe(filter$1(function () { return !_this.openMenus.group; }), takeUntil(this.destroy$))
|
|
17162
17282
|
.subscribe(function () {
|
|
17163
17283
|
_this.rowGroupsCollapsed = false;
|
|
17164
17284
|
_this.cdr.detectChanges();
|
|
@@ -17166,7 +17286,7 @@ var DatoGridV2ToolbarComponent = /** @class */ (function () {
|
|
|
17166
17286
|
/** Listen to row collapse state to update the icon */
|
|
17167
17287
|
this.gridQuery
|
|
17168
17288
|
.waitForGrid(function () { return _this.gridQuery.gridRef.rowGroupOpened; })
|
|
17169
|
-
.pipe(
|
|
17289
|
+
.pipe(takeUntil(this.destroy$))
|
|
17170
17290
|
.subscribe(function (event) {
|
|
17171
17291
|
var collapsed = _this.getCollapseState(event);
|
|
17172
17292
|
if (collapsed !== _this.rowGroupsCollapsed) {
|
|
@@ -17178,7 +17298,7 @@ var DatoGridV2ToolbarComponent = /** @class */ (function () {
|
|
|
17178
17298
|
DatoGridV2ToolbarComponent.prototype.subscribeRowsSelectionData = function () {
|
|
17179
17299
|
var _this = this;
|
|
17180
17300
|
this.gridQuery.rowsSelectionData$
|
|
17181
|
-
.pipe(
|
|
17301
|
+
.pipe(takeUntil(this.destroy$))
|
|
17182
17302
|
.subscribe(function (_a) {
|
|
17183
17303
|
var totalRowsCount = _a.totalRowsCount, selectedRowsCount = _a.selectedRowsCount, selectedPageRowsCount = _a.selectedPageRowsCount, isAllPageRowsSelected = _a.isAllPageRowsSelected;
|
|
17184
17304
|
_this.totalRowsCount = totalRowsCount;
|
|
@@ -25554,7 +25674,7 @@ function fixNgLeaks() {
|
|
|
25554
25674
|
};
|
|
25555
25675
|
}
|
|
25556
25676
|
|
|
25557
|
-
window.coreVersion = '22.15.
|
|
25677
|
+
window.coreVersion = '22.15.3';
|
|
25558
25678
|
|
|
25559
25679
|
/**
|
|
25560
25680
|
* @license
|