angular-slickgrid 4.2.2 → 4.2.5

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.
@@ -61,9 +61,9 @@ class AngularUtilService {
61
61
  return componentOutput;
62
62
  }
63
63
  }
64
- AngularUtilService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.4", ngImport: i0, type: AngularUtilService, deps: [{ token: i0.ComponentFactoryResolver }, { token: i0.ApplicationRef }, { token: i0.Injector }], target: i0.ɵɵFactoryTarget.Injectable });
65
- AngularUtilService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.4", ngImport: i0, type: AngularUtilService });
66
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.4", ngImport: i0, type: AngularUtilService, decorators: [{
64
+ AngularUtilService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.0", ngImport: i0, type: AngularUtilService, deps: [{ token: i0.ComponentFactoryResolver }, { token: i0.ApplicationRef }, { token: i0.Injector }], target: i0.ɵɵFactoryTarget.Injectable });
65
+ AngularUtilService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.1.0", ngImport: i0, type: AngularUtilService });
66
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0", ngImport: i0, type: AngularUtilService, decorators: [{
67
67
  type: Injectable
68
68
  }], ctorParameters: function () { return [{ type: i0.ComponentFactoryResolver }, { type: i0.ApplicationRef }, { type: i0.Injector }]; } });
69
69
 
@@ -161,9 +161,9 @@ class BsDropDownService {
161
161
  });
162
162
  }
163
163
  }
164
- BsDropDownService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.4", ngImport: i0, type: BsDropDownService, deps: [{ token: AngularUtilService }], target: i0.ɵɵFactoryTarget.Injectable });
165
- BsDropDownService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.4", ngImport: i0, type: BsDropDownService });
166
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.4", ngImport: i0, type: BsDropDownService, decorators: [{
164
+ BsDropDownService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.0", ngImport: i0, type: BsDropDownService, deps: [{ token: AngularUtilService }], target: i0.ɵɵFactoryTarget.Injectable });
165
+ BsDropDownService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.1.0", ngImport: i0, type: BsDropDownService });
166
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0", ngImport: i0, type: BsDropDownService, decorators: [{
167
167
  type: Injectable
168
168
  }], ctorParameters: function () { return [{ type: AngularUtilService }]; } });
169
169
 
@@ -178,6 +178,9 @@ class ContainerService {
178
178
  }
179
179
  return null;
180
180
  }
181
+ dispose() {
182
+ this.dependencies = [];
183
+ }
181
184
  registerInstance(key, instance) {
182
185
  const dependency = this.dependencies.some(dep => dep.key === key);
183
186
  if (!dependency) {
@@ -185,9 +188,9 @@ class ContainerService {
185
188
  }
186
189
  }
187
190
  }
188
- ContainerService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.4", ngImport: i0, type: ContainerService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
189
- ContainerService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.4", ngImport: i0, type: ContainerService });
190
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.4", ngImport: i0, type: ContainerService, decorators: [{
191
+ ContainerService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.0", ngImport: i0, type: ContainerService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
192
+ ContainerService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.1.0", ngImport: i0, type: ContainerService });
193
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0", ngImport: i0, type: ContainerService, decorators: [{
191
194
  type: Injectable
192
195
  }], ctorParameters: function () { return []; } });
193
196
 
@@ -223,9 +226,9 @@ class TranslaterService {
223
226
  return this.translateService?.instant?.(translationKey || ' ');
224
227
  }
225
228
  }
226
- TranslaterService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.4", ngImport: i0, type: TranslaterService, deps: [{ token: i1.TranslateService, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
227
- TranslaterService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.4", ngImport: i0, type: TranslaterService });
228
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.4", ngImport: i0, type: TranslaterService, decorators: [{
229
+ TranslaterService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.0", ngImport: i0, type: TranslaterService, deps: [{ token: i1.TranslateService, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
230
+ TranslaterService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.1.0", ngImport: i0, type: TranslaterService });
231
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0", ngImport: i0, type: TranslaterService, decorators: [{
229
232
  type: Injectable
230
233
  }], ctorParameters: function () { return [{ type: i1.TranslateService, decorators: [{
231
234
  type: Optional
@@ -930,6 +933,7 @@ class AngularSlickgridComponent {
930
933
  this.gridService = externalServices?.gridService ?? new GridService(this.gridStateService, this.filterService, this._eventPubSubService, this.paginationService, this.sharedService, this.sortService, this.treeDataService);
931
934
  this.groupingService = externalServices?.groupingAndColspanService ?? new GroupingAndColspanService(this.extensionUtility, this._eventPubSubService);
932
935
  this.serviceList = [
936
+ this.containerService,
933
937
  this.extensionService,
934
938
  this.filterService,
935
939
  this.gridEventService,
@@ -1129,6 +1133,7 @@ class AngularSlickgridComponent {
1129
1133
  this.datasetHierarchical = undefined;
1130
1134
  this._columnDefinitions = [];
1131
1135
  this._angularGridInstances = undefined;
1136
+ this.slickGrid = undefined;
1132
1137
  }
1133
1138
  emptyGridContainerElm() {
1134
1139
  const gridContainerId = this.gridOptions?.gridContainerId ?? 'grid1';
@@ -1238,8 +1243,7 @@ class AngularSlickgridComponent {
1238
1243
  this.dataView.endUpdate();
1239
1244
  // if you don't want the items that are not visible (due to being filtered out or being on a different page)
1240
1245
  // to stay selected, pass 'false' to the second arg
1241
- const selectionModel = this.slickGrid?.getSelectionModel();
1242
- if (selectionModel && this.gridOptions && this.gridOptions.dataView && this.gridOptions.dataView.hasOwnProperty('syncGridSelection')) {
1246
+ if (this.slickGrid?.getSelectionModel() && this.gridOptions && this.gridOptions.dataView && this.gridOptions.dataView.hasOwnProperty('syncGridSelection')) {
1243
1247
  // if we are using a Backend Service, we will do an extra flag check, the reason is because it might have some unintended behaviors
1244
1248
  // with the BackendServiceApi because technically the data in the page changes the DataView on every page change.
1245
1249
  let preservedRowSelectionWithBackend = false;
@@ -1526,27 +1530,26 @@ class AngularSlickgridComponent {
1526
1530
  // When data changes in the DataView, we need to refresh the metrics and/or display a warning if the dataset is empty
1527
1531
  this._eventHandler.subscribe(dataView.onRowCountChanged, () => {
1528
1532
  grid.invalidate();
1529
- this.handleOnItemCountChanged(this.dataView.getFilteredItemCount() || 0, dataView.getItemCount());
1533
+ this.handleOnItemCountChanged(dataView.getFilteredItemCount() || 0, dataView.getItemCount() || 0);
1530
1534
  });
1531
1535
  this._eventHandler.subscribe(dataView.onSetItemsCalled, (_e, args) => {
1532
- grid.invalidate();
1533
- this.handleOnItemCountChanged(this.dataView.getFilteredItemCount(), args.itemCount);
1536
+ this.handleOnItemCountChanged(dataView.getFilteredItemCount() || 0, args.itemCount);
1534
1537
  // when user has resize by content enabled, we'll force a full width calculation since we change our entire dataset
1535
1538
  if (args.itemCount > 0 && (this.gridOptions.autosizeColumnsByCellContentOnFirstLoad || this.gridOptions.enableAutoResizeColumnsByCellContent)) {
1536
1539
  this.resizerService.resizeColumnsByCellContent(!this.gridOptions?.resizeByContentOnlyOnFirstLoad);
1537
1540
  }
1538
1541
  });
1539
- this._eventHandler.subscribe(dataView.onRowsChanged, (_e, args) => {
1540
- // filtering data with local dataset will not always show correctly unless we call this updateRow/render
1541
- // also don't use "invalidateRows" since it destroys the entire row and as bad user experience when updating a row
1542
- // see commit: https://github.com/ghiscoding/aurelia-slickgrid/commit/8c503a4d45fba11cbd8d8cc467fae8d177cc4f60
1543
- if (gridOptions?.enableFiltering && !gridOptions.enableRowDetailView) {
1542
+ if (gridOptions?.enableFiltering && !gridOptions.enableRowDetailView) {
1543
+ this._eventHandler.subscribe(dataView.onRowsChanged, (_e, args) => {
1544
+ // filtering data with local dataset will not always show correctly unless we call this updateRow/render
1545
+ // also don't use "invalidateRows" since it destroys the entire row and as bad user experience when updating a row
1546
+ // see commit: https://github.com/ghiscoding/aurelia-slickgrid/commit/8c503a4d45fba11cbd8d8cc467fae8d177cc4f60
1544
1547
  if (args?.rows && Array.isArray(args.rows)) {
1545
1548
  args.rows.forEach((row) => grid.updateRow(row));
1546
1549
  grid.render();
1547
1550
  }
1548
- }
1549
- });
1551
+ });
1552
+ }
1550
1553
  }
1551
1554
  }
1552
1555
  // did the user add a colspan callback? If so, hook it into the DataView getItemMetadata
@@ -1765,9 +1768,8 @@ class AngularSlickgridComponent {
1765
1768
  loadRowSelectionPresetWhenExists() {
1766
1769
  // if user entered some Row Selections "presets"
1767
1770
  const presets = this.gridOptions?.presets;
1768
- const selectionModel = this.slickGrid?.getSelectionModel();
1769
1771
  const enableRowSelection = this.gridOptions && (this.gridOptions.enableCheckboxSelector || this.gridOptions.enableRowSelection);
1770
- if (enableRowSelection && selectionModel && presets && presets.rowSelection && (Array.isArray(presets.rowSelection.gridRowIndexes) || Array.isArray(presets.rowSelection.dataContextIds))) {
1772
+ if (enableRowSelection && this.slickGrid?.getSelectionModel() && presets?.rowSelection && (Array.isArray(presets.rowSelection.gridRowIndexes) || Array.isArray(presets.rowSelection.dataContextIds))) {
1771
1773
  let dataContextIds = presets.rowSelection.dataContextIds;
1772
1774
  let gridRowIndexes = presets.rowSelection.gridRowIndexes;
1773
1775
  // maps the IDs to the Grid Rows and vice versa, the "dataContextIds" has precedence over the other
@@ -1859,7 +1861,7 @@ class AngularSlickgridComponent {
1859
1861
  // register all services by executing their init method and providing them with the Grid object
1860
1862
  if (Array.isArray(this._registeredResources)) {
1861
1863
  for (const resource of this._registeredResources) {
1862
- if (typeof resource.init === 'function') {
1864
+ if (this.slickGrid && typeof resource.init === 'function') {
1863
1865
  resource.init(this.slickGrid, this.containerService);
1864
1866
  }
1865
1867
  }
@@ -1980,14 +1982,14 @@ class AngularSlickgridComponent {
1980
1982
  }
1981
1983
  }
1982
1984
  }
1983
- AngularSlickgridComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.4", ngImport: i0, type: AngularSlickgridComponent, deps: [{ token: AngularUtilService }, { token: i0.ApplicationRef }, { token: i0.ChangeDetectorRef }, { token: ContainerService }, { token: i0.ElementRef }, { token: i1.TranslateService, optional: true }, { token: TranslaterService, optional: true }, { token: 'config' }, { token: 'externalService' }], target: i0.ɵɵFactoryTarget.Component });
1984
- AngularSlickgridComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.4", type: AngularSlickgridComponent, selector: "angular-slickgrid", inputs: { customDataView: "customDataView", gridId: "gridId", gridOptions: "gridOptions", paginationOptions: "paginationOptions", columnDefinitions: "columnDefinitions", dataset: "dataset", datasetHierarchical: "datasetHierarchical" }, providers: [
1985
+ AngularSlickgridComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.0", ngImport: i0, type: AngularSlickgridComponent, deps: [{ token: AngularUtilService }, { token: i0.ApplicationRef }, { token: i0.ChangeDetectorRef }, { token: ContainerService }, { token: i0.ElementRef }, { token: i1.TranslateService, optional: true }, { token: TranslaterService, optional: true }, { token: 'config' }, { token: 'externalService' }], target: i0.ɵɵFactoryTarget.Component });
1986
+ AngularSlickgridComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.1.0", type: AngularSlickgridComponent, selector: "angular-slickgrid", inputs: { customDataView: "customDataView", gridId: "gridId", gridOptions: "gridOptions", paginationOptions: "paginationOptions", columnDefinitions: "columnDefinitions", dataset: "dataset", datasetHierarchical: "datasetHierarchical" }, providers: [
1985
1987
  // make everything transient (non-singleton)
1986
1988
  AngularUtilService,
1987
1989
  ApplicationRef,
1988
1990
  TranslaterService,
1989
1991
  ], ngImport: i0, template: "<div id=\"slickGridContainer-{{gridId}}\" class=\"gridPane\">\r\n <div attr.id='{{gridId}}' class=\"slickgrid-container\" style=\"width: 100%\">\r\n </div>\r\n</div>" });
1990
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.4", ngImport: i0, type: AngularSlickgridComponent, decorators: [{
1992
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0", ngImport: i0, type: AngularSlickgridComponent, decorators: [{
1991
1993
  type: Component,
1992
1994
  args: [{ selector: 'angular-slickgrid', providers: [
1993
1995
  // make everything transient (non-singleton)
@@ -2035,12 +2037,12 @@ class AngularSlickgridModule {
2035
2037
  };
2036
2038
  }
2037
2039
  }
2038
- AngularSlickgridModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.4", ngImport: i0, type: AngularSlickgridModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
2039
- AngularSlickgridModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.0.4", ngImport: i0, type: AngularSlickgridModule, declarations: [AngularSlickgridComponent], imports: [CommonModule,
2040
+ AngularSlickgridModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.0", ngImport: i0, type: AngularSlickgridModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
2041
+ AngularSlickgridModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.1.0", ngImport: i0, type: AngularSlickgridModule, declarations: [AngularSlickgridComponent], imports: [CommonModule,
2040
2042
  TranslateModule], exports: [AngularSlickgridComponent] });
2041
- AngularSlickgridModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.0.4", ngImport: i0, type: AngularSlickgridModule, imports: [CommonModule,
2043
+ AngularSlickgridModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.1.0", ngImport: i0, type: AngularSlickgridModule, imports: [CommonModule,
2042
2044
  TranslateModule] });
2043
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.4", ngImport: i0, type: AngularSlickgridModule, decorators: [{
2045
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0", ngImport: i0, type: AngularSlickgridModule, decorators: [{
2044
2046
  type: NgModule,
2045
2047
  args: [{
2046
2048
  imports: [