angular-slickgrid 4.2.2 → 4.2.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/app/modules/angular-slickgrid/services/container.service.d.ts +1 -0
- package/esm2020/app/modules/angular-slickgrid/components/angular-slickgrid.component.mjs +15 -16
- package/esm2020/app/modules/angular-slickgrid/services/container.service.mjs +4 -1
- package/fesm2015/angular-slickgrid.mjs +17 -15
- package/fesm2015/angular-slickgrid.mjs.map +1 -1
- package/fesm2020/angular-slickgrid.mjs +17 -15
- package/fesm2020/angular-slickgrid.mjs.map +1 -1
- package/package.json +8 -8
|
@@ -11,6 +11,9 @@ export class ContainerService {
|
|
|
11
11
|
}
|
|
12
12
|
return null;
|
|
13
13
|
}
|
|
14
|
+
dispose() {
|
|
15
|
+
this.dependencies = [];
|
|
16
|
+
}
|
|
14
17
|
registerInstance(key, instance) {
|
|
15
18
|
const dependency = this.dependencies.some(dep => dep.key === key);
|
|
16
19
|
if (!dependency) {
|
|
@@ -23,4 +26,4 @@ ContainerService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", ver
|
|
|
23
26
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.4", ngImport: i0, type: ContainerService, decorators: [{
|
|
24
27
|
type: Injectable
|
|
25
28
|
}], ctorParameters: function () { return []; } });
|
|
26
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
29
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29udGFpbmVyLnNlcnZpY2UuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi9zcmMvYXBwL21vZHVsZXMvYW5ndWxhci1zbGlja2dyaWQvc2VydmljZXMvY29udGFpbmVyLnNlcnZpY2UudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLFVBQVUsRUFBRS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dmVyc2FsQ29udGFpbmVyU2VydmljZSB9IGZyb20gJ0BzbGlja2dyaWQtdW5pdmVyc2FsL2NvbW1vbic7XHJcblxyXG5ASW5qZWN0YWJsZSgpXHJcbmV4cG9ydCBjbGFzcyBDb250YWluZXJTZXJ2aWNlIGltcGxlbWVudHMgVW5pdmVyc2FsQ29udGFpbmVyU2VydmljZSB7XHJcbiAgZGVwZW5kZW5jaWVzOiBDb250YWluZXJJbnN0YW5jZVtdID0gW107XHJcblxyXG4gIGNvbnN0cnVjdG9yKCkgeyB9XHJcblxyXG4gIGdldDxUID0gYW55PihrZXk6IHN0cmluZyk6IFQgfCBudWxsIHtcclxuICAgIGNvbnN0IGRlcGVuZGVuY3kgPSB0aGlzLmRlcGVuZGVuY2llcy5maW5kKGRlcCA9PiBkZXAua2V5ID09PSBrZXkpO1xyXG4gICAgaWYgKGRlcGVuZGVuY3k/Lmluc3RhbmNlKSB7XHJcbiAgICAgIHJldHVybiBkZXBlbmRlbmN5Lmluc3RhbmNlO1xyXG4gICAgfVxyXG4gICAgcmV0dXJuIG51bGw7XHJcbiAgfVxyXG5cclxuICBkaXNwb3NlKCkge1xyXG4gICAgdGhpcy5kZXBlbmRlbmNpZXMgPSBbXTtcclxuICB9XHJcblxyXG4gIHJlZ2lzdGVySW5zdGFuY2Uoa2V5OiBzdHJpbmcsIGluc3RhbmNlOiBhbnkpIHtcclxuICAgIGNvbnN0IGRlcGVuZGVuY3kgPSB0aGlzLmRlcGVuZGVuY2llcy5zb21lKGRlcCA9PiBkZXAua2V5ID09PSBrZXkpO1xyXG4gICAgaWYgKCFkZXBlbmRlbmN5KSB7XHJcbiAgICAgIHRoaXMuZGVwZW5kZW5jaWVzLnB1c2goeyBrZXksIGluc3RhbmNlIH0pO1xyXG4gICAgfVxyXG4gIH1cclxufVxyXG4iXX0=
|
|
@@ -179,6 +179,9 @@ class ContainerService {
|
|
|
179
179
|
}
|
|
180
180
|
return null;
|
|
181
181
|
}
|
|
182
|
+
dispose() {
|
|
183
|
+
this.dependencies = [];
|
|
184
|
+
}
|
|
182
185
|
registerInstance(key, instance) {
|
|
183
186
|
const dependency = this.dependencies.some(dep => dep.key === key);
|
|
184
187
|
if (!dependency) {
|
|
@@ -943,6 +946,7 @@ class AngularSlickgridComponent {
|
|
|
943
946
|
this.gridService = (_q = externalServices === null || externalServices === void 0 ? void 0 : externalServices.gridService) !== null && _q !== void 0 ? _q : new GridService(this.gridStateService, this.filterService, this._eventPubSubService, this.paginationService, this.sharedService, this.sortService, this.treeDataService);
|
|
944
947
|
this.groupingService = (_r = externalServices === null || externalServices === void 0 ? void 0 : externalServices.groupingAndColspanService) !== null && _r !== void 0 ? _r : new GroupingAndColspanService(this.extensionUtility, this._eventPubSubService);
|
|
945
948
|
this.serviceList = [
|
|
949
|
+
this.containerService,
|
|
946
950
|
this.extensionService,
|
|
947
951
|
this.filterService,
|
|
948
952
|
this.gridEventService,
|
|
@@ -1147,6 +1151,7 @@ class AngularSlickgridComponent {
|
|
|
1147
1151
|
this.datasetHierarchical = undefined;
|
|
1148
1152
|
this._columnDefinitions = [];
|
|
1149
1153
|
this._angularGridInstances = undefined;
|
|
1154
|
+
this.slickGrid = undefined;
|
|
1150
1155
|
}
|
|
1151
1156
|
emptyGridContainerElm() {
|
|
1152
1157
|
var _a, _b;
|
|
@@ -1258,8 +1263,7 @@ class AngularSlickgridComponent {
|
|
|
1258
1263
|
this.dataView.endUpdate();
|
|
1259
1264
|
// if you don't want the items that are not visible (due to being filtered out or being on a different page)
|
|
1260
1265
|
// to stay selected, pass 'false' to the second arg
|
|
1261
|
-
|
|
1262
|
-
if (selectionModel && this.gridOptions && this.gridOptions.dataView && this.gridOptions.dataView.hasOwnProperty('syncGridSelection')) {
|
|
1266
|
+
if (((_l = this.slickGrid) === null || _l === void 0 ? void 0 : _l.getSelectionModel()) && this.gridOptions && this.gridOptions.dataView && this.gridOptions.dataView.hasOwnProperty('syncGridSelection')) {
|
|
1263
1267
|
// if we are using a Backend Service, we will do an extra flag check, the reason is because it might have some unintended behaviors
|
|
1264
1268
|
// with the BackendServiceApi because technically the data in the page changes the DataView on every page change.
|
|
1265
1269
|
let preservedRowSelectionWithBackend = false;
|
|
@@ -1552,28 +1556,27 @@ class AngularSlickgridComponent {
|
|
|
1552
1556
|
// When data changes in the DataView, we need to refresh the metrics and/or display a warning if the dataset is empty
|
|
1553
1557
|
this._eventHandler.subscribe(dataView.onRowCountChanged, () => {
|
|
1554
1558
|
grid.invalidate();
|
|
1555
|
-
this.handleOnItemCountChanged(
|
|
1559
|
+
this.handleOnItemCountChanged(dataView.getFilteredItemCount() || 0, dataView.getItemCount() || 0);
|
|
1556
1560
|
});
|
|
1557
1561
|
this._eventHandler.subscribe(dataView.onSetItemsCalled, (_e, args) => {
|
|
1558
1562
|
var _a;
|
|
1559
|
-
|
|
1560
|
-
this.handleOnItemCountChanged(this.dataView.getFilteredItemCount(), args.itemCount);
|
|
1563
|
+
this.handleOnItemCountChanged(dataView.getFilteredItemCount() || 0, args.itemCount);
|
|
1561
1564
|
// when user has resize by content enabled, we'll force a full width calculation since we change our entire dataset
|
|
1562
1565
|
if (args.itemCount > 0 && (this.gridOptions.autosizeColumnsByCellContentOnFirstLoad || this.gridOptions.enableAutoResizeColumnsByCellContent)) {
|
|
1563
1566
|
this.resizerService.resizeColumnsByCellContent(!((_a = this.gridOptions) === null || _a === void 0 ? void 0 : _a.resizeByContentOnlyOnFirstLoad));
|
|
1564
1567
|
}
|
|
1565
1568
|
});
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1569
|
+
if ((gridOptions === null || gridOptions === void 0 ? void 0 : gridOptions.enableFiltering) && !gridOptions.enableRowDetailView) {
|
|
1570
|
+
this._eventHandler.subscribe(dataView.onRowsChanged, (_e, args) => {
|
|
1571
|
+
// filtering data with local dataset will not always show correctly unless we call this updateRow/render
|
|
1572
|
+
// also don't use "invalidateRows" since it destroys the entire row and as bad user experience when updating a row
|
|
1573
|
+
// see commit: https://github.com/ghiscoding/aurelia-slickgrid/commit/8c503a4d45fba11cbd8d8cc467fae8d177cc4f60
|
|
1571
1574
|
if ((args === null || args === void 0 ? void 0 : args.rows) && Array.isArray(args.rows)) {
|
|
1572
1575
|
args.rows.forEach((row) => grid.updateRow(row));
|
|
1573
1576
|
grid.render();
|
|
1574
1577
|
}
|
|
1575
|
-
}
|
|
1576
|
-
}
|
|
1578
|
+
});
|
|
1579
|
+
}
|
|
1577
1580
|
}
|
|
1578
1581
|
}
|
|
1579
1582
|
// did the user add a colspan callback? If so, hook it into the DataView getItemMetadata
|
|
@@ -1799,9 +1802,8 @@ class AngularSlickgridComponent {
|
|
|
1799
1802
|
var _a, _b;
|
|
1800
1803
|
// if user entered some Row Selections "presets"
|
|
1801
1804
|
const presets = (_a = this.gridOptions) === null || _a === void 0 ? void 0 : _a.presets;
|
|
1802
|
-
const selectionModel = (_b = this.slickGrid) === null || _b === void 0 ? void 0 : _b.getSelectionModel();
|
|
1803
1805
|
const enableRowSelection = this.gridOptions && (this.gridOptions.enableCheckboxSelector || this.gridOptions.enableRowSelection);
|
|
1804
|
-
if (enableRowSelection &&
|
|
1806
|
+
if (enableRowSelection && ((_b = this.slickGrid) === null || _b === void 0 ? void 0 : _b.getSelectionModel()) && (presets === null || presets === void 0 ? void 0 : presets.rowSelection) && (Array.isArray(presets.rowSelection.gridRowIndexes) || Array.isArray(presets.rowSelection.dataContextIds))) {
|
|
1805
1807
|
let dataContextIds = presets.rowSelection.dataContextIds;
|
|
1806
1808
|
let gridRowIndexes = presets.rowSelection.gridRowIndexes;
|
|
1807
1809
|
// maps the IDs to the Grid Rows and vice versa, the "dataContextIds" has precedence over the other
|
|
@@ -1894,7 +1896,7 @@ class AngularSlickgridComponent {
|
|
|
1894
1896
|
// register all services by executing their init method and providing them with the Grid object
|
|
1895
1897
|
if (Array.isArray(this._registeredResources)) {
|
|
1896
1898
|
for (const resource of this._registeredResources) {
|
|
1897
|
-
if (typeof resource.init === 'function') {
|
|
1899
|
+
if (this.slickGrid && typeof resource.init === 'function') {
|
|
1898
1900
|
resource.init(this.slickGrid, this.containerService);
|
|
1899
1901
|
}
|
|
1900
1902
|
}
|