angular-slickgrid 5.2.2 → 5.4.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 +1 -1
- package/app/modules/angular-slickgrid/components/angular-slickgrid.component.d.ts +5 -5
- package/app/modules/angular-slickgrid/services/utilities.d.ts +3 -2
- package/esm2020/app/modules/angular-slickgrid/components/angular-slickgrid.component.mjs +14 -16
- package/esm2020/app/modules/angular-slickgrid/global-grid-options.mjs +6 -2
- package/esm2020/app/modules/angular-slickgrid/services/utilities.mjs +7 -5
- package/fesm2015/angular-slickgrid.mjs +25 -21
- package/fesm2015/angular-slickgrid.mjs.map +1 -1
- package/fesm2020/angular-slickgrid.mjs +24 -20
- package/fesm2020/angular-slickgrid.mjs.map +1 -1
- package/package.json +12 -12
- package/test/cypress/node_modules/qs/README.md +54 -19
|
@@ -7,10 +7,10 @@ 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
9
|
import * as DOMPurify from 'dompurify';
|
|
10
|
-
import 'slickgrid/
|
|
11
|
-
import 'slickgrid/
|
|
12
|
-
import 'slickgrid/
|
|
13
|
-
import 'slickgrid/
|
|
10
|
+
import 'slickgrid/slick.core';
|
|
11
|
+
import 'slickgrid/slick.interactions';
|
|
12
|
+
import 'slickgrid/slick.grid';
|
|
13
|
+
import 'slickgrid/slick.dataview';
|
|
14
14
|
import { EventPubSubService } from '@slickgrid-universal/event-pub-sub';
|
|
15
15
|
import { SlickEmptyWarningComponent } from '@slickgrid-universal/empty-warning-component';
|
|
16
16
|
import { SlickFooterComponent } from '@slickgrid-universal/custom-footer-component';
|
|
@@ -137,13 +137,15 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImpo
|
|
|
137
137
|
*/
|
|
138
138
|
function unsubscribeAllObservables(subscriptions) {
|
|
139
139
|
if (Array.isArray(subscriptions)) {
|
|
140
|
-
subscriptions.
|
|
141
|
-
|
|
140
|
+
let subscription = subscriptions.pop();
|
|
141
|
+
while (subscription) {
|
|
142
|
+
if (typeof subscription.unsubscribe === 'function') {
|
|
142
143
|
subscription.unsubscribe();
|
|
143
144
|
}
|
|
144
|
-
|
|
145
|
-
|
|
145
|
+
subscription = subscriptions.pop();
|
|
146
|
+
}
|
|
146
147
|
}
|
|
148
|
+
// TODO: deprecated, remove the return type in next major version
|
|
147
149
|
return subscriptions;
|
|
148
150
|
}
|
|
149
151
|
|
|
@@ -510,7 +512,11 @@ const GlobalGridOptions = {
|
|
|
510
512
|
}
|
|
511
513
|
},
|
|
512
514
|
dataView: {
|
|
513
|
-
|
|
515
|
+
// when enabled, this will preserve the row selection even after filtering/sorting/grouping
|
|
516
|
+
syncGridSelection: {
|
|
517
|
+
preserveHidden: false,
|
|
518
|
+
preserveHiddenOnSelectionChange: true
|
|
519
|
+
},
|
|
514
520
|
syncGridSelectionWithBackendService: false, // but disable it when using backend services
|
|
515
521
|
},
|
|
516
522
|
datasetIdPropertyName: 'id',
|
|
@@ -1232,11 +1238,11 @@ class AngularSlickgridComponent {
|
|
|
1232
1238
|
}
|
|
1233
1239
|
/**
|
|
1234
1240
|
* On a Pagination changed, we will trigger a Grid State changed with the new pagination info
|
|
1235
|
-
* Also if we use Row Selection or the Checkbox Selector, we need to reset any selection
|
|
1241
|
+
* Also if we use Row Selection or the Checkbox Selector with a Backend Service (Odata, GraphQL), we need to reset any selection
|
|
1236
1242
|
*/
|
|
1237
1243
|
paginationChanged(pagination) {
|
|
1238
1244
|
const isSyncGridSelectionEnabled = this.gridStateService?.needToPreserveRowSelection() ?? false;
|
|
1239
|
-
if (!isSyncGridSelectionEnabled && (this.gridOptions.enableRowSelection || this.gridOptions.enableCheckboxSelector)) {
|
|
1245
|
+
if (this.slickGrid && !isSyncGridSelectionEnabled && this.gridOptions?.backendServiceApi && (this.gridOptions.enableRowSelection || this.gridOptions.enableCheckboxSelector)) {
|
|
1240
1246
|
this.slickGrid.setSelectedRows([]);
|
|
1241
1247
|
}
|
|
1242
1248
|
const { pageNumber, pageSize } = pagination;
|
|
@@ -1693,15 +1699,13 @@ class AngularSlickgridComponent {
|
|
|
1693
1699
|
else if (Array.isArray(gridRowIndexes) && gridRowIndexes.length > 0) {
|
|
1694
1700
|
dataContextIds = this.dataView.mapRowsToIds(gridRowIndexes) || [];
|
|
1695
1701
|
}
|
|
1696
|
-
|
|
1697
|
-
|
|
1698
|
-
|
|
1699
|
-
|
|
1700
|
-
|
|
1701
|
-
|
|
1702
|
-
|
|
1703
|
-
this.slickGrid.setSelectedRows(gridRowIndexes);
|
|
1704
|
-
}
|
|
1702
|
+
// apply row selection when defined as grid presets
|
|
1703
|
+
if (this.slickGrid && Array.isArray(gridRowIndexes)) {
|
|
1704
|
+
this.slickGrid.setSelectedRows(gridRowIndexes);
|
|
1705
|
+
this.dataView.setSelectedIds(dataContextIds || [], {
|
|
1706
|
+
isRowBeingAdded: true,
|
|
1707
|
+
shouldTriggerEvent: false,
|
|
1708
|
+
applyRowSelectionToGrid: true
|
|
1705
1709
|
});
|
|
1706
1710
|
}
|
|
1707
1711
|
}
|