angular-slickgrid 9.8.0 → 9.10.0

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/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # Angular-Slickgrid
1
+ # [![Angular](https://avatars.githubusercontent.com/u/139426?s=50&v=4)](https://angular.io/) Angular-Slickgrid
2
2
 
3
3
  [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
4
4
  [![TypeScript](https://img.shields.io/badge/%3C%2F%3E-TypeScript-%230074c1.svg)](http://www.typescriptlang.org/)
@@ -1,4 +1,4 @@
1
- import { unsubscribeAll, createDomElement, SlickRowSelectionModel, SlickEventData, castObservableToPromise, addToArrayWhenNotExists, DelimiterType, EventNamingStyle, Filters, SlickEventHandler, SlickgridConfig as SlickgridConfig$1, BackendUtilityService, GridEventService, SharedService, CollectionService, ExtensionUtility, FilterFactory, FilterService, ResizerService, SortService, TreeDataService, PaginationService, ExtensionService, GridStateService, GridService, HeaderGroupingService, emptyElement, SlickGroupItemMetadataProvider, SlickDataView, autoAddEditorFormatterToColumnsWithEditor, SlickGrid, ExtensionName, isColumnDateType } from '@slickgrid-universal/common';
1
+ import { unsubscribeAll, createDomElement, SlickHybridSelectionModel, SlickRowSelectionModel, SlickEventData, castObservableToPromise, addToArrayWhenNotExists, DelimiterType, EventNamingStyle, Filters, SlickEventHandler, SlickgridConfig as SlickgridConfig$1, BackendUtilityService, GridEventService, SharedService, CollectionService, ExtensionUtility, FilterFactory, FilterService, ResizerService, SortService, TreeDataService, PaginationService, ExtensionService, GridStateService, GridService, HeaderGroupingService, emptyElement, SlickGroupItemMetadataProvider, SlickDataView, autoAddEditorFormatterToColumnsWithEditor, SlickGrid, ExtensionName, isColumnDateType } from '@slickgrid-universal/common';
2
2
  export * from '@slickgrid-universal/common';
3
3
  import * as i0 from '@angular/core';
4
4
  import { Injectable, Optional, EventEmitter, ContentChild, Input, Output, Inject, Component, NgModule } from '@angular/core';
@@ -6,9 +6,9 @@ import * as i1 from '@ngx-translate/core';
6
6
  import { TranslateModule } from '@ngx-translate/core';
7
7
  import { SlickRowDetailView as SlickRowDetailView$1 } from '@slickgrid-universal/row-detail-view-plugin';
8
8
  import { Observable } from 'rxjs';
9
- import { EventPubSubService } from '@slickgrid-universal/event-pub-sub';
10
- import { SlickEmptyWarningComponent } from '@slickgrid-universal/empty-warning-component';
11
9
  import { SlickFooterComponent } from '@slickgrid-universal/custom-footer-component';
10
+ import { SlickEmptyWarningComponent } from '@slickgrid-universal/empty-warning-component';
11
+ import { EventPubSubService } from '@slickgrid-universal/event-pub-sub';
12
12
  import { SlickPaginationComponent } from '@slickgrid-universal/pagination-component';
13
13
  import { RxJsResource } from '@slickgrid-universal/rxjs-observable';
14
14
  import { extend } from '@slickgrid-universal/utils';
@@ -93,10 +93,10 @@ class AngularUtilService {
93
93
  }
94
94
  return componentOutput;
95
95
  }
96
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: AngularUtilService, deps: [{ token: i0.ViewContainerRef }], target: i0.ɵɵFactoryTarget.Injectable });
97
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: AngularUtilService });
96
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: AngularUtilService, deps: [{ token: i0.ViewContainerRef }], target: i0.ɵɵFactoryTarget.Injectable });
97
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: AngularUtilService });
98
98
  }
99
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: AngularUtilService, decorators: [{
99
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: AngularUtilService, decorators: [{
100
100
  type: Injectable
101
101
  }], ctorParameters: () => [{ type: i0.ViewContainerRef }] });
102
102
 
@@ -118,10 +118,10 @@ class ContainerService {
118
118
  this.dependencies.push({ key, instance });
119
119
  }
120
120
  }
121
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: ContainerService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
122
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: ContainerService });
121
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: ContainerService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
122
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: ContainerService });
123
123
  }
124
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: ContainerService, decorators: [{
124
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: ContainerService, decorators: [{
125
125
  type: Injectable
126
126
  }] });
127
127
 
@@ -157,10 +157,10 @@ class TranslaterService {
157
157
  translate(translationKey) {
158
158
  return this.translateService?.instant?.(translationKey || ' ');
159
159
  }
160
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: TranslaterService, deps: [{ token: i1.TranslateService, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
161
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: TranslaterService });
160
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TranslaterService, deps: [{ token: i1.TranslateService, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
161
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TranslaterService });
162
162
  }
163
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: TranslaterService, decorators: [{
163
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TranslaterService, decorators: [{
164
164
  type: Injectable
165
165
  }], ctorParameters: () => [{ type: i1.TranslateService, decorators: [{
166
166
  type: Optional
@@ -245,8 +245,8 @@ class SlickRowDetailView extends SlickRowDetailView$1 {
245
245
  }
246
246
  init(grid) {
247
247
  this._grid = grid;
248
- super.init(this._grid);
249
- this.register(grid?.getSelectionModel());
248
+ super.init(grid);
249
+ this.register(grid.getSelectionModel());
250
250
  }
251
251
  /**
252
252
  * Create the plugin before the Grid creation, else it will behave oddly.
@@ -266,16 +266,17 @@ class SlickRowDetailView extends SlickRowDetailView$1 {
266
266
  // load the Preload & RowDetail Templates (could be straight HTML or Angular View/ViewModel)
267
267
  // when those are Angular View/ViewModel, we need to create View Component & provide the html containers to the Plugin (preTemplate/postTemplate methods)
268
268
  if (!this.gridOptions.rowDetailView.preTemplate) {
269
- this._preloadComponent = this.gridOptions?.rowDetailView?.preloadComponent;
269
+ this._preloadComponent = this.gridOptions.rowDetailView.preloadComponent;
270
270
  this.addonOptions.preTemplate = () => createDomElement('div', { className: `${PRELOAD_CONTAINER_PREFIX}` });
271
271
  }
272
272
  if (!this.gridOptions.rowDetailView.postTemplate) {
273
- this._viewComponent = this.gridOptions?.rowDetailView?.viewComponent;
273
+ this._viewComponent = this.gridOptions.rowDetailView.viewComponent;
274
274
  this.addonOptions.postTemplate = (itemDetail) => createDomElement('div', { className: `${ROW_DETAIL_CONTAINER_PREFIX}${itemDetail[this.datasetIdPropName]}` });
275
275
  }
276
276
  // this also requires the Row Selection Model to be registered as well
277
277
  if (!rowSelectionPlugin || !this._grid.getSelectionModel()) {
278
- rowSelectionPlugin = new SlickRowSelectionModel(this.gridOptions.rowSelectionOptions || { selectActiveRow: true });
278
+ const SelectionModelClass = this.gridOptions.enableHybridSelection ? SlickHybridSelectionModel : SlickRowSelectionModel;
279
+ rowSelectionPlugin = new SelectionModelClass(this.gridOptions.rowSelectionOptions || { selectActiveRow: true });
279
280
  this._grid.setSelectionModel(rowSelectionPlugin);
280
281
  }
281
282
  // hook all events
@@ -339,7 +340,7 @@ class SlickRowDetailView extends SlickRowDetailView$1 {
339
340
  // we need to redraw the open detail views if we change column position (column reorder)
340
341
  this.eventHandler.subscribe(this._grid.onColumnsReordered, this.redrawAllViewComponents.bind(this, false));
341
342
  // on row selection changed, we also need to redraw
342
- if (this.gridOptions.enableRowSelection || this.gridOptions.enableCheckboxSelector) {
343
+ if (this.gridOptions.enableRowSelection || this.gridOptions.enableHybridSelection || this.gridOptions.enableCheckboxSelector) {
343
344
  this.eventHandler.subscribe(this._grid.onSelectedRowsChanged, this.redrawAllViewComponents.bind(this, false));
344
345
  }
345
346
  // on sort, all row detail are collapsed so we can dispose of all the Views as well
@@ -1287,10 +1288,7 @@ class AngularSlickgridComponent {
1287
1288
  this.extensionService.bindDifferentExtensions();
1288
1289
  this.bindDifferentHooks(this.slickGrid, this.options, this.dataView);
1289
1290
  // when it's a frozen grid, we need to keep the frozen column id for reference if we ever show/hide column from ColumnPicker/GridMenu afterward
1290
- const frozenColumnIndex = this.options.frozenColumn !== undefined ? this.options.frozenColumn : -1;
1291
- if (frozenColumnIndex >= 0 && frozenColumnIndex <= this.sharedService.visibleColumns.length) {
1292
- this.sharedService.frozenVisibleColumnId = this.sharedService.visibleColumns[frozenColumnIndex].id || '';
1293
- }
1291
+ this.sharedService.frozenVisibleColumnId = this.slickGrid.getFrozenColumnId();
1294
1292
  // get any possible Services that user want to register
1295
1293
  this.registerResources();
1296
1294
  // initialize the SlickGrid grid
@@ -1335,7 +1333,8 @@ class AngularSlickgridComponent {
1335
1333
  }
1336
1334
  const datasetLn = this.dataView.getLength() || this._dataset?.length || 0;
1337
1335
  if (datasetLn > 0) {
1338
- if (!this._isDatasetInitialized && (this.options.enableCheckboxSelector || this.options.enableRowSelection)) {
1336
+ if (!this._isDatasetInitialized &&
1337
+ (this.options.enableCheckboxSelector || this.options.enableRowSelection || this.options.enableHybridSelection)) {
1339
1338
  this.loadRowSelectionPresetWhenExists();
1340
1339
  }
1341
1340
  this.loadFilterPresetsWhenDatasetInitialized();
@@ -1402,7 +1401,7 @@ class AngularSlickgridComponent {
1402
1401
  if (this.slickGrid &&
1403
1402
  !isSyncGridSelectionEnabled &&
1404
1403
  this.options?.backendServiceApi &&
1405
- (this.options.enableRowSelection || this.options.enableCheckboxSelector)) {
1404
+ (this.options.enableRowSelection || this.options.enableHybridSelection || this.options.enableCheckboxSelector)) {
1406
1405
  this.slickGrid.setSelectedRows([]);
1407
1406
  }
1408
1407
  const { pageNumber, pageSize } = pagination;
@@ -1920,7 +1919,7 @@ class AngularSlickgridComponent {
1920
1919
  loadRowSelectionPresetWhenExists() {
1921
1920
  // if user entered some Row Selections "presets"
1922
1921
  const presets = this.options?.presets;
1923
- const enableRowSelection = this.options && (this.options.enableCheckboxSelector || this.options.enableRowSelection);
1922
+ const enableRowSelection = this.options && (this.options.enableCheckboxSelector || this.options.enableRowSelection || this.options.enableHybridSelection);
1924
1923
  if (enableRowSelection &&
1925
1924
  this.slickGrid?.getSelectionModel() &&
1926
1925
  presets?.rowSelection &&
@@ -2156,20 +2155,12 @@ class AngularSlickgridComponent {
2156
2155
  }
2157
2156
  }
2158
2157
  }
2159
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", 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 });
2160
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.14", type: AngularSlickgridComponent, isStandalone: false, selector: "angular-slickgrid", inputs: { customDataView: "customDataView", gridId: "gridId", options: "options", paginationOptions: "paginationOptions", columns: "columns", dataset: "dataset", datasetHierarchical: "datasetHierarchical" }, outputs: { columnsChange: "columnsChange" }, providers: [
2161
- // make everything transient (non-singleton)
2162
- AngularUtilService,
2163
- TranslaterService,
2164
- ], 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\"></div>\n <ng-container *ngTemplateOutlet=\"slickgridFooter\"></ng-container>\n</div>\n", dependencies: [{ kind: "directive", type: i5.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], preserveWhitespaces: true });
2158
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", 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 });
2159
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.15", type: AngularSlickgridComponent, isStandalone: false, selector: "angular-slickgrid", inputs: { customDataView: "customDataView", gridId: "gridId", options: "options", paginationOptions: "paginationOptions", columns: "columns", dataset: "dataset", datasetHierarchical: "datasetHierarchical" }, outputs: { columnsChange: "columnsChange" }, providers: [AngularUtilService, TranslaterService], 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\"></div>\n <ng-container *ngTemplateOutlet=\"slickgridFooter\"></ng-container>\n</div>\n", dependencies: [{ kind: "directive", type: i5.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], preserveWhitespaces: true });
2165
2160
  }
2166
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: AngularSlickgridComponent, decorators: [{
2161
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: AngularSlickgridComponent, decorators: [{
2167
2162
  type: Component,
2168
- args: [{ selector: 'angular-slickgrid', providers: [
2169
- // make everything transient (non-singleton)
2170
- AngularUtilService,
2171
- TranslaterService,
2172
- ], standalone: false, template: "<div id=\"slickGridContainer-{{ gridId }}\" class=\"gridPane\">\n <ng-container *ngTemplateOutlet=\"slickgridHeader\"></ng-container>\n <div attr.id=\"{{ gridId }}\" class=\"slickgrid-container\"></div>\n <ng-container *ngTemplateOutlet=\"slickgridFooter\"></ng-container>\n</div>\n" }]
2163
+ args: [{ selector: 'angular-slickgrid', providers: [AngularUtilService, TranslaterService], standalone: false, template: "<div id=\"slickGridContainer-{{ gridId }}\" class=\"gridPane\">\n <ng-container *ngTemplateOutlet=\"slickgridHeader\"></ng-container>\n <div attr.id=\"{{ gridId }}\" class=\"slickgrid-container\"></div>\n <ng-container *ngTemplateOutlet=\"slickgridFooter\"></ng-container>\n</div>\n" }]
2173
2164
  }], ctorParameters: () => [{ type: AngularUtilService }, { type: i0.ApplicationRef }, { type: i0.ChangeDetectorRef }, { type: ContainerService }, { type: i0.ElementRef }, { type: i1.TranslateService, decorators: [{
2174
2165
  type: Optional
2175
2166
  }] }, { type: TranslaterService, decorators: [{
@@ -2216,11 +2207,11 @@ class AngularSlickgridModule {
2216
2207
  ],
2217
2208
  };
2218
2209
  }
2219
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: AngularSlickgridModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
2220
- static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.2.14", ngImport: i0, type: AngularSlickgridModule, declarations: [AngularSlickgridComponent], imports: [CommonModule, TranslateModule], exports: [AngularSlickgridComponent] });
2221
- static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: AngularSlickgridModule, imports: [CommonModule, TranslateModule] });
2210
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: AngularSlickgridModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
2211
+ static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.2.15", ngImport: i0, type: AngularSlickgridModule, declarations: [AngularSlickgridComponent], imports: [CommonModule, TranslateModule], exports: [AngularSlickgridComponent] });
2212
+ static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: AngularSlickgridModule, imports: [CommonModule, TranslateModule] });
2222
2213
  }
2223
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: AngularSlickgridModule, decorators: [{
2214
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: AngularSlickgridModule, decorators: [{
2224
2215
  type: NgModule,
2225
2216
  args: [{
2226
2217
  imports: [CommonModule, TranslateModule],