angular-slickgrid 7.5.0 → 7.6.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.
@@ -92,10 +92,10 @@ class AngularUtilService {
92
92
  }
93
93
  return componentOutput;
94
94
  }
95
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.2.3", ngImport: i0, type: AngularUtilService, deps: [{ token: i0.ViewContainerRef }], target: i0.ɵɵFactoryTarget.Injectable }); }
96
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.2.3", ngImport: i0, type: AngularUtilService }); }
95
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.1", ngImport: i0, type: AngularUtilService, deps: [{ token: i0.ViewContainerRef }], target: i0.ɵɵFactoryTarget.Injectable }); }
96
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.1", ngImport: i0, type: AngularUtilService }); }
97
97
  }
98
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.2.3", ngImport: i0, type: AngularUtilService, decorators: [{
98
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.1", ngImport: i0, type: AngularUtilService, decorators: [{
99
99
  type: Injectable
100
100
  }], ctorParameters: () => [{ type: i0.ViewContainerRef }] });
101
101
 
@@ -119,10 +119,10 @@ class ContainerService {
119
119
  this.dependencies.push({ key, instance });
120
120
  }
121
121
  }
122
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.2.3", ngImport: i0, type: ContainerService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
123
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.2.3", ngImport: i0, type: ContainerService }); }
122
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.1", ngImport: i0, type: ContainerService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
123
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.1", ngImport: i0, type: ContainerService }); }
124
124
  }
125
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.2.3", ngImport: i0, type: ContainerService, decorators: [{
125
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.1", ngImport: i0, type: ContainerService, decorators: [{
126
126
  type: Injectable
127
127
  }] });
128
128
 
@@ -157,10 +157,10 @@ class TranslaterService {
157
157
  translate(translationKey) {
158
158
  return this.translateService?.instant?.(translationKey || ' ');
159
159
  }
160
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.2.3", ngImport: i0, type: TranslaterService, deps: [{ token: i1.TranslateService, optional: true }], target: i0.ɵɵFactoryTarget.Injectable }); }
161
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.2.3", ngImport: i0, type: TranslaterService }); }
160
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.1", ngImport: i0, type: TranslaterService, deps: [{ token: i1.TranslateService, optional: true }], target: i0.ɵɵFactoryTarget.Injectable }); }
161
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.1", ngImport: i0, type: TranslaterService }); }
162
162
  }
163
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.2.3", ngImport: i0, type: TranslaterService, decorators: [{
163
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.1", ngImport: i0, type: TranslaterService, decorators: [{
164
164
  type: Injectable
165
165
  }], ctorParameters: () => [{ type: i1.TranslateService, decorators: [{
166
166
  type: Optional
@@ -568,8 +568,8 @@ const GlobalGridOptions = {
568
568
  enableColumnResizeOnDoubleClick: true,
569
569
  enableContextMenu: true,
570
570
  enableExcelExport: false,
571
- enableTextExport: false,
572
- enableFilterTrimWhiteSpace: false,
571
+ enableTextExport: false, // CSV/Text with Tab Delimited
572
+ enableFilterTrimWhiteSpace: false, // do we want to trim white spaces on all Filters?
573
573
  enableGridMenu: true,
574
574
  enableHeaderMenu: true,
575
575
  enableEmptyDataWarningMessage: true,
@@ -623,18 +623,20 @@ const GlobalGridOptions = {
623
623
  exportExcelCommandKey: 'EXPORT_TO_EXCEL',
624
624
  exportTextDelimitedCommandKey: 'EXPORT_TO_TAB_DELIMITED',
625
625
  refreshDatasetCommandKey: 'REFRESH_DATASET',
626
+ toggleDarkModeCommandKey: 'TOGGLE_DARK_MODE',
626
627
  toggleFilterCommandKey: 'TOGGLE_FILTER_ROW',
627
628
  togglePreHeaderCommandKey: 'TOGGLE_PRE_HEADER_ROW',
628
629
  },
629
630
  hideClearAllFiltersCommand: false,
630
631
  hideClearAllSortingCommand: false,
631
- hideClearFrozenColumnsCommand: true,
632
+ hideClearFrozenColumnsCommand: true, // opt-in command
632
633
  hideExportCsvCommand: false,
633
634
  hideExportExcelCommand: false,
634
635
  hideExportTextDelimitedCommand: true,
635
636
  hideForceFitButton: false,
636
637
  hideRefreshDatasetCommand: false,
637
638
  hideSyncResizeButton: true,
639
+ hideToggleDarkModeCommand: true,
638
640
  hideToggleFilterCommand: false,
639
641
  hideTogglePreHeaderCommand: false,
640
642
  iconCssClass: 'fa fa-bars',
@@ -645,6 +647,7 @@ const GlobalGridOptions = {
645
647
  iconExportExcelCommand: 'fa fa-file-excel-o text-success',
646
648
  iconExportTextDelimitedCommand: 'fa fa-download',
647
649
  iconRefreshDatasetCommand: 'fa fa-refresh',
650
+ iconToggleDarkModeCommand: 'fa fa-moon-o mdi mdi-brightness-4',
648
651
  iconToggleFilterCommand: 'fa fa-random',
649
652
  iconTogglePreHeaderCommand: 'fa fa-random',
650
653
  menuWidth: 16,
@@ -666,7 +669,7 @@ const GlobalGridOptions = {
666
669
  hideColumnHideCommand: false,
667
670
  hideClearFilterCommand: false,
668
671
  hideClearSortCommand: false,
669
- hideFreezeColumnsCommand: true,
672
+ hideFreezeColumnsCommand: true, // opt-in command
670
673
  hideSortCommands: false
671
674
  },
672
675
  headerRowHeight: 35,
@@ -790,6 +793,7 @@ class Constants {
790
793
  TEXT_SORT_ASCENDING: 'Sort Ascending',
791
794
  TEXT_SORT_DESCENDING: 'Sort Descending',
792
795
  TEXT_STARTS_WITH: 'Starts With',
796
+ TEXT_TOGGLE_DARK_MODE: 'Toggle Dark Mode',
793
797
  TEXT_TOGGLE_FILTER_ROW: 'Toggle Filter Row',
794
798
  TEXT_TOGGLE_PRE_HEADER_ROW: 'Toggle Pre-Header Row',
795
799
  TEXT_X_OF_Y_SELECTED: '# of % selected',
@@ -1654,18 +1658,21 @@ class AngularSlickgridComponent {
1654
1658
  }
1655
1659
  /** Load the Editor Collection asynchronously and replace the "collection" property when Observable resolves */
1656
1660
  loadEditorCollectionAsync(column) {
1657
- const collectionAsync = column && column.editor && column.editor.collectionAsync;
1658
- if (collectionAsync instanceof Observable) {
1659
- this.subscriptions.push(collectionAsync.subscribe((resolvedCollection) => this.updateEditorCollection(column, resolvedCollection)));
1660
- }
1661
- else if (collectionAsync instanceof Promise) {
1662
- // wait for the "collectionAsync", once resolved we will save it into the "collection"
1663
- // the collectionAsync can be of 3 types HttpClient, HttpFetch or a Promise
1664
- collectionAsync.then((response) => {
1665
- if (Array.isArray(response)) {
1666
- this.updateEditorCollection(column, response); // from Promise
1667
- }
1668
- });
1661
+ if (column?.editor) {
1662
+ const collectionAsync = column.editor.collectionAsync;
1663
+ column.editor.disabled = true; // disable the Editor DOM element, we'll re-enable it after receiving the collection with "updateEditorCollection()"
1664
+ if (collectionAsync instanceof Observable) {
1665
+ this.subscriptions.push(collectionAsync.subscribe((resolvedCollection) => this.updateEditorCollection(column, resolvedCollection)));
1666
+ }
1667
+ else if (collectionAsync instanceof Promise) {
1668
+ // wait for the "collectionAsync", once resolved we will save it into the "collection"
1669
+ // the collectionAsync can be of 3 types HttpClient, HttpFetch or a Promise
1670
+ collectionAsync.then((response) => {
1671
+ if (Array.isArray(response)) {
1672
+ this.updateEditorCollection(column, response); // from Promise
1673
+ }
1674
+ });
1675
+ }
1669
1676
  }
1670
1677
  }
1671
1678
  insertDynamicPresetColumns(columnId, gridPresetColumns) {
@@ -1759,7 +1766,7 @@ class AngularSlickgridComponent {
1759
1766
  this.slickGrid.setSelectedRows(gridRowIndexes);
1760
1767
  this.dataView.setSelectedIds(dataContextIds || [], {
1761
1768
  isRowBeingAdded: true,
1762
- shouldTriggerEvent: false,
1769
+ shouldTriggerEvent: false, // do not trigger when presetting the grid
1763
1770
  applyRowSelectionToGrid: true
1764
1771
  });
1765
1772
  }
@@ -1933,7 +1940,7 @@ class AngularSlickgridComponent {
1933
1940
  if (column?.editor?.collectionAsync) {
1934
1941
  this.loadEditorCollectionAsync(column);
1935
1942
  }
1936
- return { ...column, editor: column.editor?.model, internalColumnEditor: { ...column.editor } };
1943
+ return { ...column, editorClass: column.editor?.model, internalColumnEditor: { ...column.editor } };
1937
1944
  });
1938
1945
  }
1939
1946
  /**
@@ -1942,32 +1949,34 @@ class AngularSlickgridComponent {
1942
1949
  * Once we found the new pointer, we will reassign the "editor" and "collection" to the "internalColumnEditor" so it has newest collection
1943
1950
  */
1944
1951
  updateEditorCollection(column, newCollection) {
1945
- column.editor.collection = newCollection;
1946
- column.editor.disabled = false;
1947
- // find the new column reference pointer & re-assign the new editor to the internalColumnEditor
1948
- if (Array.isArray(this.columnDefinitions)) {
1949
- const columnRef = this.columnDefinitions.find((col) => col.id === column.id);
1950
- if (columnRef) {
1951
- columnRef.internalColumnEditor = column.editor;
1952
+ if (this.slickGrid && column.editor) {
1953
+ column.editor.collection = newCollection;
1954
+ column.editor.disabled = false;
1955
+ // find the new column reference pointer & re-assign the new editor to the internalColumnEditor
1956
+ if (Array.isArray(this.columnDefinitions)) {
1957
+ const columnRef = this.columnDefinitions.find((col) => col.id === column.id);
1958
+ if (columnRef) {
1959
+ columnRef.internalColumnEditor = column.editor;
1960
+ }
1961
+ }
1962
+ // get current Editor, remove it from the DOM then re-enable it and re-render it with the new collection.
1963
+ const currentEditor = this.slickGrid.getCellEditor();
1964
+ if (currentEditor?.disable && currentEditor?.renderDomElement) {
1965
+ currentEditor.destroy();
1966
+ currentEditor.disable(false);
1967
+ currentEditor.renderDomElement(newCollection);
1952
1968
  }
1953
- }
1954
- // get current Editor, remove it from the DOM then re-enable it and re-render it with the new collection.
1955
- const currentEditor = this.slickGrid.getCellEditor();
1956
- if (currentEditor?.disable && currentEditor?.renderDomElement) {
1957
- currentEditor.destroy();
1958
- currentEditor.disable(false);
1959
- currentEditor.renderDomElement(newCollection);
1960
1969
  }
1961
1970
  }
1962
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.2.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 }); }
1963
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.2.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: [
1971
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.1", 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 }); }
1972
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.1", type: AngularSlickgridComponent, selector: "angular-slickgrid", inputs: { customDataView: "customDataView", gridId: "gridId", gridOptions: "gridOptions", paginationOptions: "paginationOptions", columnDefinitions: "columnDefinitions", dataset: "dataset", datasetHierarchical: "datasetHierarchical" }, outputs: { columnDefinitionsChange: "columnDefinitionsChange" }, providers: [
1964
1973
  // make everything transient (non-singleton)
1965
1974
  AngularUtilService,
1966
1975
  ApplicationRef,
1967
1976
  TranslaterService,
1968
1977
  ], 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 }); }
1969
1978
  }
1970
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.2.3", ngImport: i0, type: AngularSlickgridComponent, decorators: [{
1979
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.1", ngImport: i0, type: AngularSlickgridComponent, decorators: [{
1971
1980
  type: Component,
1972
1981
  args: [{ selector: 'angular-slickgrid', providers: [
1973
1982
  // make everything transient (non-singleton)
@@ -2021,13 +2030,13 @@ class AngularSlickgridModule {
2021
2030
  ]
2022
2031
  };
2023
2032
  }
2024
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.2.3", ngImport: i0, type: AngularSlickgridModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
2025
- static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.2.3", ngImport: i0, type: AngularSlickgridModule, declarations: [AngularSlickgridComponent], imports: [CommonModule,
2033
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.1", ngImport: i0, type: AngularSlickgridModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
2034
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.3.1", ngImport: i0, type: AngularSlickgridModule, declarations: [AngularSlickgridComponent], imports: [CommonModule,
2026
2035
  TranslateModule], exports: [AngularSlickgridComponent] }); }
2027
- static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.2.3", ngImport: i0, type: AngularSlickgridModule, imports: [CommonModule,
2036
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.3.1", ngImport: i0, type: AngularSlickgridModule, imports: [CommonModule,
2028
2037
  TranslateModule] }); }
2029
2038
  }
2030
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.2.3", ngImport: i0, type: AngularSlickgridModule, decorators: [{
2039
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.1", ngImport: i0, type: AngularSlickgridModule, decorators: [{
2031
2040
  type: NgModule,
2032
2041
  args: [{
2033
2042
  imports: [