angular-slickgrid 8.5.0 → 8.5.1

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.
@@ -91,10 +91,10 @@ class AngularUtilService {
91
91
  }
92
92
  return componentOutput;
93
93
  }
94
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.3", ngImport: i0, type: AngularUtilService, deps: [{ token: i0.ViewContainerRef }], target: i0.ɵɵFactoryTarget.Injectable }); }
95
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.1.3", ngImport: i0, type: AngularUtilService }); }
94
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: AngularUtilService, deps: [{ token: i0.ViewContainerRef }], target: i0.ɵɵFactoryTarget.Injectable }); }
95
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: AngularUtilService }); }
96
96
  }
97
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.3", ngImport: i0, type: AngularUtilService, decorators: [{
97
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: AngularUtilService, decorators: [{
98
98
  type: Injectable
99
99
  }], ctorParameters: () => [{ type: i0.ViewContainerRef }] });
100
100
 
@@ -118,10 +118,10 @@ class ContainerService {
118
118
  this.dependencies.push({ key, instance });
119
119
  }
120
120
  }
121
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.3", ngImport: i0, type: ContainerService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
122
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.1.3", ngImport: i0, type: ContainerService }); }
121
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: ContainerService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
122
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: ContainerService }); }
123
123
  }
124
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.3", ngImport: i0, type: ContainerService, decorators: [{
124
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: ContainerService, decorators: [{
125
125
  type: Injectable
126
126
  }] });
127
127
 
@@ -156,10 +156,10 @@ class TranslaterService {
156
156
  translate(translationKey) {
157
157
  return this.translateService?.instant?.(translationKey || ' ');
158
158
  }
159
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.3", ngImport: i0, type: TranslaterService, deps: [{ token: i1.TranslateService, optional: true }], target: i0.ɵɵFactoryTarget.Injectable }); }
160
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.1.3", ngImport: i0, type: TranslaterService }); }
159
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: TranslaterService, deps: [{ token: i1.TranslateService, optional: true }], target: i0.ɵɵFactoryTarget.Injectable }); }
160
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: TranslaterService }); }
161
161
  }
162
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.3", ngImport: i0, type: TranslaterService, decorators: [{
162
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: TranslaterService, decorators: [{
163
163
  type: Injectable
164
164
  }], ctorParameters: () => [{ type: i1.TranslateService, decorators: [{
165
165
  type: Optional
@@ -425,13 +425,13 @@ class SlickRowDetailView extends SlickRowDetailView$1 {
425
425
  const userProcessFn = this._userProcessFn(item);
426
426
  // wait for the "userProcessFn", once resolved we will save it into the "collection"
427
427
  const response = await userProcessFn;
428
- if (response.hasOwnProperty(this.datasetIdPropName)) {
428
+ if (this.datasetIdPropName in response) {
429
429
  awaitedItemDetail = response; // from Promise
430
430
  }
431
431
  else if (response && response instanceof Observable || response instanceof Promise) {
432
432
  awaitedItemDetail = await castObservableToPromise(this.rxjs, response); // from Angular-http-client
433
433
  }
434
- if (!awaitedItemDetail || !awaitedItemDetail.hasOwnProperty(this.datasetIdPropName)) {
434
+ if (!awaitedItemDetail || !(this.datasetIdPropName in awaitedItemDetail)) {
435
435
  throw new Error(`[Angular-Slickgrid] could not process the Row Detail, you must make sure that your "process" callback
436
436
  (a Promise or an HttpClient call returning an Observable) returns an item object that has an "${this.datasetIdPropName}" property`);
437
437
  }
@@ -459,7 +459,7 @@ class SlickRowDetailView extends SlickRowDetailView$1 {
459
459
  else {
460
460
  // collapsing, so dispose of the View/Component
461
461
  const foundViewIndex = this._views.findIndex((view) => view.id === args.item[this.datasetIdPropName]);
462
- if (foundViewIndex >= 0 && this._views.hasOwnProperty(foundViewIndex)) {
462
+ if (foundViewIndex >= 0 && foundViewIndex in this._views) {
463
463
  const compRef = this._views[foundViewIndex].componentRef;
464
464
  if (compRef) {
465
465
  this.appRef.detachView(compRef.hostView);
@@ -1120,8 +1120,8 @@ class AngularSlickgridComponent {
1120
1120
  backendApi.internalPostProcess = (processResult) => {
1121
1121
  const datasetName = (backendApi && backendApiService && typeof backendApiService.getDatasetName === 'function') ? backendApiService.getDatasetName() : '';
1122
1122
  if (processResult?.data[datasetName]) {
1123
- const data = processResult.data[datasetName].hasOwnProperty('nodes') ? processResult.data[datasetName].nodes : processResult.data[datasetName];
1124
- const totalCount = processResult.data[datasetName].hasOwnProperty('totalCount') ? processResult.data[datasetName].totalCount : processResult.data[datasetName].length;
1123
+ const data = 'nodes' in processResult.data[datasetName] ? processResult.data[datasetName].nodes : processResult.data[datasetName];
1124
+ const totalCount = 'totalCount' in processResult.data[datasetName] ? processResult.data[datasetName].totalCount : processResult.data[datasetName].length;
1125
1125
  this.refreshGridData(data, totalCount || 0);
1126
1126
  }
1127
1127
  };
@@ -1222,11 +1222,11 @@ class AngularSlickgridComponent {
1222
1222
  this.dataView.endUpdate();
1223
1223
  // if you don't want the items that are not visible (due to being filtered out or being on a different page)
1224
1224
  // to stay selected, pass 'false' to the second arg
1225
- if (this.slickGrid?.getSelectionModel() && this.gridOptions?.dataView?.hasOwnProperty('syncGridSelection')) {
1225
+ if (this.slickGrid?.getSelectionModel() && this.gridOptions?.dataView && 'syncGridSelection' in this.gridOptions.dataView) {
1226
1226
  // if we are using a Backend Service, we will do an extra flag check, the reason is because it might have some unintended behaviors
1227
1227
  // with the BackendServiceApi because technically the data in the page changes the DataView on every page change.
1228
1228
  let preservedRowSelectionWithBackend = false;
1229
- if (this.gridOptions.backendServiceApi && this.gridOptions.dataView.hasOwnProperty('syncGridSelectionWithBackendService')) {
1229
+ if (this.gridOptions.backendServiceApi && 'syncGridSelectionWithBackendService' in this.gridOptions.dataView) {
1230
1230
  preservedRowSelectionWithBackend = this.gridOptions.dataView.syncGridSelectionWithBackendService;
1231
1231
  }
1232
1232
  const syncGridSelection = this.gridOptions.dataView.syncGridSelection;
@@ -1555,7 +1555,7 @@ class AngularSlickgridComponent {
1555
1555
  const backendApi = gridOptions.backendServiceApi;
1556
1556
  const backendApiService = backendApi && backendApi.service;
1557
1557
  const serviceOptions = backendApiService?.options ?? {};
1558
- const isExecuteCommandOnInit = (!serviceOptions) ? false : ((serviceOptions && serviceOptions.hasOwnProperty('executeProcessCommandOnInit')) ? serviceOptions['executeProcessCommandOnInit'] : true);
1558
+ const isExecuteCommandOnInit = (!serviceOptions) ? false : ((serviceOptions && 'executeProcessCommandOnInit' in serviceOptions) ? serviceOptions['executeProcessCommandOnInit'] : true);
1559
1559
  if (backendApiService) {
1560
1560
  // update backend filters (if need be) BEFORE the query runs (via the onInit command a few lines below)
1561
1561
  // if user entered some any "presets", we need to reflect them all in the grid
@@ -1804,7 +1804,7 @@ class AngularSlickgridComponent {
1804
1804
  this.totalItems = Array.isArray(dataset) ? dataset.length : 0;
1805
1805
  if (this._paginationOptions && this.dataView?.getPagingInfo) {
1806
1806
  const slickPagingInfo = this.dataView.getPagingInfo();
1807
- if (slickPagingInfo?.hasOwnProperty('totalRows') && this._paginationOptions.totalItems !== slickPagingInfo.totalRows) {
1807
+ if (slickPagingInfo && 'totalRows' in slickPagingInfo && this._paginationOptions.totalItems !== slickPagingInfo.totalRows) {
1808
1808
  this.totalItems = slickPagingInfo.totalRows || 0;
1809
1809
  }
1810
1810
  }
@@ -1976,18 +1976,11 @@ class AngularSlickgridComponent {
1976
1976
  flatDatasetOutput = sortedDatasetResult.flat;
1977
1977
  }
1978
1978
  else if (Array.isArray(flatDatasetInput) && flatDatasetInput.length > 0) {
1979
- if (this.gridOptions?.treeDataOptions?.initialSort) {
1980
- // else we need to first convert the flat dataset to a hierarchical dataset and then sort
1981
- sortedDatasetResult = this.treeDataService.convertFlatParentChildToTreeDatasetAndSort(flatDatasetInput, this._columnDefinitions, this.gridOptions);
1982
- this.sharedService.hierarchicalDataset = sortedDatasetResult.hierarchical;
1983
- flatDatasetOutput = sortedDatasetResult.flat;
1984
- }
1985
- else {
1986
- // else we assume that the user provided an array that is already sorted (user's responsability)
1987
- // and so we can simply convert the array to a tree structure and we're done, no need to sort
1988
- this.sharedService.hierarchicalDataset = this.treeDataService.convertFlatParentChildToTreeDataset(flatDatasetInput, this.gridOptions);
1989
- flatDatasetOutput = flatDatasetInput || [];
1990
- }
1979
+ // we need to first convert the flat dataset to a hierarchical dataset and then sort it
1980
+ // we'll also add props, by mutation, required by the TreeDataService on the flat array like `__hasChildren`, `parentId` and anything else to work properly
1981
+ sortedDatasetResult = this.treeDataService.convertFlatParentChildToTreeDatasetAndSort(flatDatasetInput, this._columnDefinitions, this.gridOptions);
1982
+ this.sharedService.hierarchicalDataset = sortedDatasetResult.hierarchical;
1983
+ flatDatasetOutput = sortedDatasetResult.flat;
1991
1984
  }
1992
1985
  // if we add/remove item(s) from the dataset, we need to also refresh our tree data filters
1993
1986
  if (flatDatasetInput.length > 0 && (forceGridRefresh || flatDatasetInput.length !== prevDatasetLn)) {
@@ -2025,15 +2018,15 @@ class AngularSlickgridComponent {
2025
2018
  }
2026
2019
  }
2027
2020
  }
2028
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.3", 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 }); }
2029
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.1.3", type: AngularSlickgridComponent, selector: "angular-slickgrid", inputs: { customDataView: "customDataView", gridId: "gridId", gridOptions: "gridOptions", paginationOptions: "paginationOptions", columnDefinitions: "columnDefinitions", dataset: "dataset", datasetHierarchical: "datasetHierarchical" }, outputs: { columnDefinitionsChange: "columnDefinitionsChange" }, providers: [
2021
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.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 }); }
2022
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.0", type: AngularSlickgridComponent, selector: "angular-slickgrid", inputs: { customDataView: "customDataView", gridId: "gridId", gridOptions: "gridOptions", paginationOptions: "paginationOptions", columnDefinitions: "columnDefinitions", dataset: "dataset", datasetHierarchical: "datasetHierarchical" }, outputs: { columnDefinitionsChange: "columnDefinitionsChange" }, providers: [
2030
2023
  // make everything transient (non-singleton)
2031
2024
  AngularUtilService,
2032
2025
  ApplicationRef,
2033
2026
  TranslaterService,
2034
2027
  ], queries: [{ propertyName: "slickgridHeader", first: true, predicate: ["slickgridHeader"], descendants: true, static: true }, { propertyName: "slickgridFooter", first: true, predicate: ["slickgridFooter"], descendants: true, static: true }], ngImport: i0, template: "<div id=\"slickGridContainer-{{gridId}}\" class=\"gridPane\">\n <ng-container *ngTemplateOutlet=\"slickgridHeader\"></ng-container>\n <div attr.id='{{gridId}}' class=\"slickgrid-container\">\n </div>\n <ng-container *ngTemplateOutlet=\"slickgridFooter\"></ng-container>\n</div>", dependencies: [{ kind: "directive", type: i5.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], preserveWhitespaces: true }); }
2035
2028
  }
2036
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.3", ngImport: i0, type: AngularSlickgridComponent, decorators: [{
2029
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: AngularSlickgridComponent, decorators: [{
2037
2030
  type: Component,
2038
2031
  args: [{ selector: 'angular-slickgrid', providers: [
2039
2032
  // make everything transient (non-singleton)
@@ -2087,13 +2080,13 @@ class AngularSlickgridModule {
2087
2080
  ]
2088
2081
  };
2089
2082
  }
2090
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.3", ngImport: i0, type: AngularSlickgridModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
2091
- static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.1.3", ngImport: i0, type: AngularSlickgridModule, declarations: [AngularSlickgridComponent], imports: [CommonModule,
2083
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: AngularSlickgridModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
2084
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.2.0", ngImport: i0, type: AngularSlickgridModule, declarations: [AngularSlickgridComponent], imports: [CommonModule,
2092
2085
  TranslateModule], exports: [AngularSlickgridComponent] }); }
2093
- static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.1.3", ngImport: i0, type: AngularSlickgridModule, imports: [CommonModule,
2086
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: AngularSlickgridModule, imports: [CommonModule,
2094
2087
  TranslateModule] }); }
2095
2088
  }
2096
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.3", ngImport: i0, type: AngularSlickgridModule, decorators: [{
2089
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: AngularSlickgridModule, decorators: [{
2097
2090
  type: NgModule,
2098
2091
  args: [{
2099
2092
  imports: [