angular-slickgrid 3.3.2 → 4.0.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 +9 -7
- package/angular-slickgrid.d.ts +1 -3
- package/app/modules/angular-slickgrid/components/angular-slickgrid.component.d.ts +8 -4
- package/app/modules/angular-slickgrid/extensions/index.d.ts +1 -1
- package/app/modules/angular-slickgrid/extensions/{rowDetailViewExtension.d.ts → slickRowDetailView.d.ts} +40 -27
- package/app/modules/angular-slickgrid/index.d.ts +1 -1
- package/app/modules/angular-slickgrid/models/angularGridInstance.interface.d.ts +1 -1
- package/app/modules/angular-slickgrid/modules/angular-slickgrid.module.d.ts +7 -0
- package/app/modules/angular-slickgrid/services/angularUtil.service.d.ts +3 -0
- package/app/modules/angular-slickgrid/services/bsDropdown.service.d.ts +3 -0
- package/app/modules/angular-slickgrid/services/container.service.d.ts +3 -0
- package/app/modules/angular-slickgrid/services/translater.service.d.ts +3 -0
- package/docs/assets/lib/multiple-select/README.md +17 -0
- package/esm2020/angular-slickgrid.mjs +5 -0
- package/esm2020/app/modules/angular-slickgrid/components/angular-slickgrid.component.mjs +1168 -0
- package/{esm2015/app/modules/angular-slickgrid/constants.js → esm2020/app/modules/angular-slickgrid/constants.mjs} +0 -0
- package/{esm2015/app/modules/angular-slickgrid/extensions/index.js → esm2020/app/modules/angular-slickgrid/extensions/index.mjs} +2 -2
- package/esm2020/app/modules/angular-slickgrid/extensions/slickRowDetailView.mjs +301 -0
- package/esm2020/app/modules/angular-slickgrid/global-grid-options.mjs +243 -0
- package/{esm2015/app/modules/angular-slickgrid/index.js → esm2020/app/modules/angular-slickgrid/index.mjs} +2 -2
- package/{esm2015/app/modules/angular-slickgrid/models/angularComponentOutput.interface.js → esm2020/app/modules/angular-slickgrid/models/angularComponentOutput.interface.mjs} +0 -0
- package/esm2020/app/modules/angular-slickgrid/models/angularGridInstance.interface.mjs +2 -0
- package/{esm2015/app/modules/angular-slickgrid/models/externalTestingDependencies.interface.js → esm2020/app/modules/angular-slickgrid/models/externalTestingDependencies.interface.mjs} +0 -0
- package/{esm2015/app/modules/angular-slickgrid/models/gridOption.interface.js → esm2020/app/modules/angular-slickgrid/models/gridOption.interface.mjs} +0 -0
- package/{esm2015/app/modules/angular-slickgrid/models/index.js → esm2020/app/modules/angular-slickgrid/models/index.mjs} +0 -0
- package/{esm2015/app/modules/angular-slickgrid/models/rowDetailView.interface.js → esm2020/app/modules/angular-slickgrid/models/rowDetailView.interface.mjs} +0 -0
- package/{esm2015/app/modules/angular-slickgrid/models/slickGrid.interface.js → esm2020/app/modules/angular-slickgrid/models/slickGrid.interface.mjs} +0 -0
- package/esm2020/app/modules/angular-slickgrid/modules/angular-slickgrid.module.mjs +46 -0
- package/esm2020/app/modules/angular-slickgrid/services/angularUtil.service.mjs +46 -0
- package/esm2020/app/modules/angular-slickgrid/services/bsDropdown.service.mjs +103 -0
- package/esm2020/app/modules/angular-slickgrid/services/container.service.mjs +26 -0
- package/{esm2015/app/modules/angular-slickgrid/services/index.js → esm2020/app/modules/angular-slickgrid/services/index.mjs} +0 -0
- package/esm2020/app/modules/angular-slickgrid/services/translater.service.mjs +43 -0
- package/{esm2015/app/modules/angular-slickgrid/services/utilities.js → esm2020/app/modules/angular-slickgrid/services/utilities.mjs} +0 -0
- package/{esm2015/app/modules/angular-slickgrid/slickgrid-config.js → esm2020/app/modules/angular-slickgrid/slickgrid-config.mjs} +0 -0
- package/{esm2015/public_api.js → esm2020/public_api.mjs} +0 -0
- package/fesm2015/{angular-slickgrid.js → angular-slickgrid.mjs} +247 -279
- package/fesm2015/angular-slickgrid.mjs.map +1 -0
- package/fesm2020/angular-slickgrid.mjs +2065 -0
- package/fesm2020/angular-slickgrid.mjs.map +1 -0
- package/package.json +33 -22
- package/angular-slickgrid.metadata.json +0 -1
- package/bundles/angular-slickgrid.umd.js +0 -2642
- package/bundles/angular-slickgrid.umd.js.map +0 -1
- package/esm2015/angular-slickgrid.js +0 -7
- package/esm2015/app/modules/angular-slickgrid/components/angular-slickgrid.component.js +0 -1202
- package/esm2015/app/modules/angular-slickgrid/extensions/rowDetailViewExtension.js +0 -342
- package/esm2015/app/modules/angular-slickgrid/global-grid-options.js +0 -243
- package/esm2015/app/modules/angular-slickgrid/models/angularGridInstance.interface.js +0 -2
- package/esm2015/app/modules/angular-slickgrid/modules/angular-slickgrid.module.js +0 -37
- package/esm2015/app/modules/angular-slickgrid/services/angularUtil.service.js +0 -48
- package/esm2015/app/modules/angular-slickgrid/services/bsDropdown.service.js +0 -103
- package/esm2015/app/modules/angular-slickgrid/services/container.service.js +0 -24
- package/esm2015/app/modules/angular-slickgrid/services/translater.service.js +0 -47
- package/fesm2015/angular-slickgrid.js.map +0 -1
|
@@ -1,13 +1,15 @@
|
|
|
1
|
-
import { castObservableToPromise, addToArrayWhenNotExists,
|
|
1
|
+
import { SlickRowSelectionModel, castObservableToPromise, addToArrayWhenNotExists, Filters, OperatorType, EventNamingStyle, FileType, DelimiterType, SlickgridConfig as SlickgridConfig$1, BackendUtilityService, GridEventService, SharedService, CollectionService, ExtensionUtility, FilterFactory, FilterService, ResizerService, SortService, TreeDataService, PaginationService, ExtensionService, GridStateService, GridService, GroupingAndColspanService, emptyElement, SlickGroupItemMetadataProvider, autoAddEditorFormatterToColumnsWithEditor, GridStateType, ExtensionName } from '@slickgrid-universal/common';
|
|
2
2
|
export * from '@slickgrid-universal/common';
|
|
3
|
-
import
|
|
3
|
+
import * as i0 from '@angular/core';
|
|
4
|
+
import { Injectable, Optional, ApplicationRef, Component, Inject, Input, NgModule } from '@angular/core';
|
|
4
5
|
import { __awaiter } from 'tslib';
|
|
5
|
-
import
|
|
6
|
+
import * as i1 from '@ngx-translate/core';
|
|
7
|
+
import { TranslateModule } from '@ngx-translate/core';
|
|
6
8
|
import 'slickgrid/plugins/slick.rowdetailview';
|
|
7
9
|
import 'slickgrid/plugins/slick.rowselectionmodel';
|
|
8
|
-
import {
|
|
10
|
+
import { SlickRowDetailView as SlickRowDetailView$1 } from '@slickgrid-universal/row-detail-view-plugin';
|
|
9
11
|
import { Observable } from 'rxjs';
|
|
10
|
-
import * as
|
|
12
|
+
import * as DOMPurify from 'dompurify';
|
|
11
13
|
import 'jquery-ui/ui/widgets/draggable';
|
|
12
14
|
import 'jquery-ui/ui/widgets/droppable';
|
|
13
15
|
import 'jquery-ui/ui/widgets/sortable';
|
|
@@ -16,7 +18,7 @@ import 'slickgrid/lib/jquery.mousewheel';
|
|
|
16
18
|
import 'slickgrid/slick.core';
|
|
17
19
|
import 'slickgrid/slick.grid';
|
|
18
20
|
import 'slickgrid/slick.dataview';
|
|
19
|
-
import 'slickgrid/
|
|
21
|
+
import { EventPubSubService } from '@slickgrid-universal/event-pub-sub';
|
|
20
22
|
import { SlickEmptyWarningComponent } from '@slickgrid-universal/empty-warning-component';
|
|
21
23
|
import { SlickFooterComponent } from '@slickgrid-universal/custom-footer-component';
|
|
22
24
|
import { SlickPaginationComponent } from '@slickgrid-universal/pagination-component';
|
|
@@ -62,14 +64,11 @@ class AngularUtilService {
|
|
|
62
64
|
return componentOutput;
|
|
63
65
|
}
|
|
64
66
|
}
|
|
65
|
-
AngularUtilService
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
{ type: ApplicationRef },
|
|
71
|
-
{ type: Injector }
|
|
72
|
-
];
|
|
67
|
+
AngularUtilService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.0", ngImport: i0, type: AngularUtilService, deps: [{ token: i0.ComponentFactoryResolver }, { token: i0.ApplicationRef }, { token: i0.Injector }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
68
|
+
AngularUtilService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.1.0", ngImport: i0, type: AngularUtilService });
|
|
69
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.0", ngImport: i0, type: AngularUtilService, decorators: [{
|
|
70
|
+
type: Injectable
|
|
71
|
+
}], ctorParameters: function () { return [{ type: i0.ComponentFactoryResolver }, { type: i0.ApplicationRef }, { type: i0.Injector }]; } });
|
|
73
72
|
|
|
74
73
|
// Boostrap dropdown service
|
|
75
74
|
class BsDropDownService {
|
|
@@ -165,12 +164,11 @@ class BsDropDownService {
|
|
|
165
164
|
});
|
|
166
165
|
}
|
|
167
166
|
}
|
|
168
|
-
BsDropDownService
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
];
|
|
167
|
+
BsDropDownService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.0", ngImport: i0, type: BsDropDownService, deps: [{ token: AngularUtilService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
168
|
+
BsDropDownService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.1.0", ngImport: i0, type: BsDropDownService });
|
|
169
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.0", ngImport: i0, type: BsDropDownService, decorators: [{
|
|
170
|
+
type: Injectable
|
|
171
|
+
}], ctorParameters: function () { return [{ type: AngularUtilService }]; } });
|
|
174
172
|
|
|
175
173
|
class ContainerService {
|
|
176
174
|
constructor() {
|
|
@@ -190,10 +188,11 @@ class ContainerService {
|
|
|
190
188
|
}
|
|
191
189
|
}
|
|
192
190
|
}
|
|
193
|
-
ContainerService
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
191
|
+
ContainerService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.0", ngImport: i0, type: ContainerService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
192
|
+
ContainerService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.1.0", ngImport: i0, type: ContainerService });
|
|
193
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.0", ngImport: i0, type: ContainerService, decorators: [{
|
|
194
|
+
type: Injectable
|
|
195
|
+
}], ctorParameters: function () { return []; } });
|
|
197
196
|
|
|
198
197
|
/**
|
|
199
198
|
* This is a Translate Service Wrapper for Slickgrid-Universal monorepo lib to work properly,
|
|
@@ -232,12 +231,15 @@ class TranslaterService {
|
|
|
232
231
|
return (_b = (_a = this.translateService) === null || _a === void 0 ? void 0 : _a.instant) === null || _b === void 0 ? void 0 : _b.call(_a, translationKey || ' ');
|
|
233
232
|
}
|
|
234
233
|
}
|
|
235
|
-
TranslaterService
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
234
|
+
TranslaterService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.0", ngImport: i0, type: TranslaterService, deps: [{ token: i1.TranslateService, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
235
|
+
TranslaterService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.1.0", ngImport: i0, type: TranslaterService });
|
|
236
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.0", ngImport: i0, type: TranslaterService, decorators: [{
|
|
237
|
+
type: Injectable
|
|
238
|
+
}], ctorParameters: function () {
|
|
239
|
+
return [{ type: i1.TranslateService, decorators: [{
|
|
240
|
+
type: Optional
|
|
241
|
+
}] }];
|
|
242
|
+
} });
|
|
241
243
|
|
|
242
244
|
/**
|
|
243
245
|
* Unsubscribe all Observables Subscriptions
|
|
@@ -256,19 +258,21 @@ function unsubscribeAllObservables(subscriptions) {
|
|
|
256
258
|
return subscriptions;
|
|
257
259
|
}
|
|
258
260
|
|
|
259
|
-
const DOMPurify = DOMPurify_['default'] || DOMPurify_; // patch to fix rollup to work
|
|
260
261
|
const ROW_DETAIL_CONTAINER_PREFIX = 'container_';
|
|
261
262
|
const PRELOAD_CONTAINER_PREFIX = 'container_loading';
|
|
262
|
-
class
|
|
263
|
-
constructor(angularUtilService, appRef, eventPubSubService,
|
|
263
|
+
class SlickRowDetailView extends SlickRowDetailView$1 {
|
|
264
|
+
constructor(angularUtilService, appRef, eventPubSubService, gridContainerElement, rxjs) {
|
|
265
|
+
super();
|
|
264
266
|
this.angularUtilService = angularUtilService;
|
|
265
267
|
this.appRef = appRef;
|
|
266
268
|
this.eventPubSubService = eventPubSubService;
|
|
267
|
-
this.
|
|
269
|
+
this.gridContainerElement = gridContainerElement;
|
|
268
270
|
this.rxjs = rxjs;
|
|
269
271
|
this._views = [];
|
|
270
272
|
this._subscriptions = [];
|
|
271
|
-
|
|
273
|
+
}
|
|
274
|
+
get addonOptions() {
|
|
275
|
+
return this.getOptions();
|
|
272
276
|
}
|
|
273
277
|
get datasetIdPropName() {
|
|
274
278
|
return this.gridOptions.datasetIdPropertyName || 'id';
|
|
@@ -276,9 +280,13 @@ class RowDetailViewExtension {
|
|
|
276
280
|
get eventHandler() {
|
|
277
281
|
return this._eventHandler;
|
|
278
282
|
}
|
|
283
|
+
set eventHandler(eventHandler) {
|
|
284
|
+
this._eventHandler = eventHandler;
|
|
285
|
+
}
|
|
286
|
+
/** Getter for the Grid Options pulled through the Grid Object */
|
|
279
287
|
get gridOptions() {
|
|
280
|
-
var _a
|
|
281
|
-
return ((
|
|
288
|
+
var _a;
|
|
289
|
+
return (((_a = this._grid) === null || _a === void 0 ? void 0 : _a.getOptions()) || {});
|
|
282
290
|
}
|
|
283
291
|
get rowDetailViewOptions() {
|
|
284
292
|
return this.gridOptions.rowDetailView;
|
|
@@ -288,152 +296,127 @@ class RowDetailViewExtension {
|
|
|
288
296
|
}
|
|
289
297
|
/** Dispose of the RowDetailView Extension */
|
|
290
298
|
dispose() {
|
|
291
|
-
// unsubscribe all SlickGrid events
|
|
292
|
-
this._eventHandler.unsubscribeAll();
|
|
293
|
-
if (this._addon && this._addon.destroy) {
|
|
294
|
-
this._addon.destroy();
|
|
295
|
-
}
|
|
296
|
-
this._addonOptions = null;
|
|
297
|
-
// also unsubscribe all RxJS subscriptions
|
|
298
|
-
this._subscriptions = unsubscribeAllObservables(this._subscriptions);
|
|
299
299
|
this.disposeAllViewComponents();
|
|
300
|
+
this._subscriptions = unsubscribeAllObservables(this._subscriptions); // also unsubscribe all RxJS subscriptions
|
|
301
|
+
super.dispose();
|
|
300
302
|
}
|
|
301
303
|
/** Dispose of all the opened Row Detail Panels Angular View Components */
|
|
302
304
|
disposeAllViewComponents() {
|
|
303
305
|
this._views.forEach((compRef) => this.disposeViewComponent(compRef));
|
|
304
306
|
this._views = [];
|
|
305
307
|
}
|
|
308
|
+
/** Get the instance of the SlickGrid addon (control or plugin). */
|
|
309
|
+
getAddonInstance() {
|
|
310
|
+
return this;
|
|
311
|
+
}
|
|
312
|
+
init(grid) {
|
|
313
|
+
this._grid = grid;
|
|
314
|
+
super.init(this._grid);
|
|
315
|
+
this.register(grid === null || grid === void 0 ? void 0 : grid.getSelectionModel());
|
|
316
|
+
}
|
|
306
317
|
/**
|
|
307
318
|
* Create the plugin before the Grid creation, else it will behave oddly.
|
|
308
319
|
* Mostly because the column definitions might change after the grid creation
|
|
309
320
|
*/
|
|
310
|
-
|
|
311
|
-
var _a, _b;
|
|
312
|
-
if (
|
|
313
|
-
|
|
314
|
-
|
|
321
|
+
register(rowSelectionPlugin) {
|
|
322
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
323
|
+
if (typeof ((_a = this.gridOptions.rowDetailView) === null || _a === void 0 ? void 0 : _a.process) === 'function') {
|
|
324
|
+
// we need to keep the user "process" method and replace it with our own execution method
|
|
325
|
+
// we do this because when we get the item detail, we need to call "onAsyncResponse.notify" for the plugin to work
|
|
326
|
+
this._userProcessFn = this.gridOptions.rowDetailView.process; // keep user's process method
|
|
327
|
+
this.gridOptions.rowDetailView.process = (item) => this.onProcessing(item); // replace process method & run our internal one
|
|
328
|
+
}
|
|
329
|
+
else {
|
|
330
|
+
throw new Error('[Angular-Slickgrid] You need to provide a "process" function for the Row Detail Extension to work properly');
|
|
331
|
+
}
|
|
332
|
+
if (this._grid && ((_b = this.gridOptions) === null || _b === void 0 ? void 0 : _b.rowDetailView)) {
|
|
333
|
+
// load the Preload & RowDetail Templates (could be straight HTML or Angular View/ViewModel)
|
|
334
|
+
// when those are Angular View/ViewModel, we need to create View Component & provide the html containers to the Plugin (preTemplate/postTemplate methods)
|
|
335
|
+
if (!this.gridOptions.rowDetailView.preTemplate) {
|
|
336
|
+
this._preloadComponent = (_d = (_c = this.gridOptions) === null || _c === void 0 ? void 0 : _c.rowDetailView) === null || _d === void 0 ? void 0 : _d.preloadComponent;
|
|
337
|
+
this.gridOptions.rowDetailView.preTemplate = () => DOMPurify.sanitize(`<div class="${PRELOAD_CONTAINER_PREFIX}"></div>`);
|
|
315
338
|
}
|
|
316
|
-
if (gridOptions
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
// we need to keep the user "process" method and replace it with our own execution method
|
|
320
|
-
// we do this because when we get the item detail, we need to call "onAsyncResponse.notify" for the plugin to work
|
|
321
|
-
this._userProcessFn = gridOptions.rowDetailView.process; // keep user's process method
|
|
322
|
-
gridOptions.rowDetailView.process = (item) => this.onProcessing(item); // replace process method & run our internal one
|
|
323
|
-
}
|
|
324
|
-
else {
|
|
325
|
-
throw new Error('You need to provide a "process" function for the Row Detail Extension to work properly');
|
|
326
|
-
}
|
|
327
|
-
// load the Preload & RowDetail Templates (could be straight HTML or Angular View/ViewModel)
|
|
328
|
-
// when those are Angular View/ViewModel, we need to create View Component & provide the html containers to the Plugin (preTemplate/postTemplate methods)
|
|
329
|
-
if (!gridOptions.rowDetailView.preTemplate) {
|
|
330
|
-
this._preloadComponent = (_a = gridOptions === null || gridOptions === void 0 ? void 0 : gridOptions.rowDetailView) === null || _a === void 0 ? void 0 : _a.preloadComponent;
|
|
331
|
-
gridOptions.rowDetailView.preTemplate = () => DOMPurify.sanitize(`<div class="${PRELOAD_CONTAINER_PREFIX}"></div>`);
|
|
332
|
-
}
|
|
333
|
-
if (!gridOptions.rowDetailView.postTemplate) {
|
|
334
|
-
this._viewComponent = (_b = gridOptions === null || gridOptions === void 0 ? void 0 : gridOptions.rowDetailView) === null || _b === void 0 ? void 0 : _b.viewComponent;
|
|
335
|
-
gridOptions.rowDetailView.postTemplate = (itemDetail) => DOMPurify.sanitize(`<div class="${ROW_DETAIL_CONTAINER_PREFIX}${itemDetail[this.datasetIdPropName]}"></div>`);
|
|
336
|
-
}
|
|
337
|
-
// finally register the Row Detail View Plugin
|
|
338
|
-
this._addonOptions = gridOptions.rowDetailView;
|
|
339
|
-
this._addon = new Slick.Plugins.RowDetailView(this._addonOptions);
|
|
340
|
-
}
|
|
341
|
-
const iconColumn = this._addon.getColumnDefinition();
|
|
342
|
-
if (typeof iconColumn === 'object') {
|
|
343
|
-
iconColumn.excludeFromExport = true;
|
|
344
|
-
iconColumn.excludeFromColumnPicker = true;
|
|
345
|
-
iconColumn.excludeFromGridMenu = true;
|
|
346
|
-
iconColumn.excludeFromQuery = true;
|
|
347
|
-
iconColumn.excludeFromHeaderMenu = true;
|
|
348
|
-
// column index position in the grid
|
|
349
|
-
const columnPosition = gridOptions && gridOptions.rowDetailView && gridOptions.rowDetailView.columnIndexPosition || 0;
|
|
350
|
-
if (columnPosition > 0) {
|
|
351
|
-
columnDefinitions.splice(columnPosition, 0, iconColumn);
|
|
352
|
-
}
|
|
353
|
-
else {
|
|
354
|
-
columnDefinitions.unshift(iconColumn);
|
|
355
|
-
}
|
|
356
|
-
}
|
|
339
|
+
if (!this.gridOptions.rowDetailView.postTemplate) {
|
|
340
|
+
this._viewComponent = (_f = (_e = this.gridOptions) === null || _e === void 0 ? void 0 : _e.rowDetailView) === null || _f === void 0 ? void 0 : _f.viewComponent;
|
|
341
|
+
this.gridOptions.rowDetailView.postTemplate = (itemDetail) => DOMPurify.sanitize(`<div class="${ROW_DETAIL_CONTAINER_PREFIX}${itemDetail[this.datasetIdPropName]}"></div>`);
|
|
357
342
|
}
|
|
358
|
-
return this._addon;
|
|
359
|
-
}
|
|
360
|
-
return null;
|
|
361
|
-
}
|
|
362
|
-
/** Get the instance of the SlickGrid addon (control or plugin). */
|
|
363
|
-
getAddonInstance() {
|
|
364
|
-
return this._addon;
|
|
365
|
-
}
|
|
366
|
-
register(rowSelectionPlugin) {
|
|
367
|
-
var _a;
|
|
368
|
-
if (((_a = this.sharedService) === null || _a === void 0 ? void 0 : _a.slickGrid) && this.sharedService.gridOptions) {
|
|
369
|
-
// the plugin has to be created BEFORE the grid (else it behaves oddly), but we can only watch grid events AFTER the grid is created
|
|
370
|
-
this.sharedService.slickGrid.registerPlugin(this._addon);
|
|
371
343
|
// this also requires the Row Selection Model to be registered as well
|
|
372
|
-
if (!rowSelectionPlugin || !this.
|
|
373
|
-
rowSelectionPlugin = new
|
|
374
|
-
this.
|
|
344
|
+
if (!rowSelectionPlugin || !this._grid.getSelectionModel()) {
|
|
345
|
+
rowSelectionPlugin = new SlickRowSelectionModel(this.gridOptions.rowSelectionOptions || { selectActiveRow: true });
|
|
346
|
+
this._grid.setSelectionModel(rowSelectionPlugin);
|
|
375
347
|
}
|
|
376
348
|
// hook all events
|
|
377
|
-
if (this.
|
|
349
|
+
if (this._grid && this.rowDetailViewOptions) {
|
|
378
350
|
if (this.rowDetailViewOptions.onExtensionRegistered) {
|
|
379
|
-
this.rowDetailViewOptions.onExtensionRegistered(this
|
|
351
|
+
this.rowDetailViewOptions.onExtensionRegistered(this);
|
|
352
|
+
}
|
|
353
|
+
if (this.onAsyncResponse) {
|
|
354
|
+
this._eventHandler.subscribe(this.onAsyncResponse, (event, args) => {
|
|
355
|
+
if (this.rowDetailViewOptions && typeof this.rowDetailViewOptions.onAsyncResponse === 'function') {
|
|
356
|
+
this.rowDetailViewOptions.onAsyncResponse(event, args);
|
|
357
|
+
}
|
|
358
|
+
});
|
|
359
|
+
}
|
|
360
|
+
if (this.onAsyncEndUpdate) {
|
|
361
|
+
this._eventHandler.subscribe(this.onAsyncEndUpdate, (e, args) => {
|
|
362
|
+
// triggers after backend called "onAsyncResponse.notify()"
|
|
363
|
+
this.renderViewModel(args === null || args === void 0 ? void 0 : args.item);
|
|
364
|
+
if (this.rowDetailViewOptions && typeof this.rowDetailViewOptions.onAsyncEndUpdate === 'function') {
|
|
365
|
+
this.rowDetailViewOptions.onAsyncEndUpdate(e, args);
|
|
366
|
+
}
|
|
367
|
+
});
|
|
368
|
+
}
|
|
369
|
+
if (this.onAfterRowDetailToggle) {
|
|
370
|
+
this._eventHandler.subscribe(this.onAfterRowDetailToggle, (e, args) => {
|
|
371
|
+
// display preload template & re-render all the other Detail Views after toggling
|
|
372
|
+
// the preload View will eventually go away once the data gets loaded after the "onAsyncEndUpdate" event
|
|
373
|
+
this.renderPreloadView();
|
|
374
|
+
this.renderAllViewComponents();
|
|
375
|
+
if (this.rowDetailViewOptions && typeof this.rowDetailViewOptions.onAfterRowDetailToggle === 'function') {
|
|
376
|
+
this.rowDetailViewOptions.onAfterRowDetailToggle(e, args);
|
|
377
|
+
}
|
|
378
|
+
});
|
|
379
|
+
}
|
|
380
|
+
if (this.onBeforeRowDetailToggle) {
|
|
381
|
+
this._eventHandler.subscribe(this.onBeforeRowDetailToggle, (e, args) => {
|
|
382
|
+
// before toggling row detail, we need to create View Component if it doesn't exist
|
|
383
|
+
this.handleOnBeforeRowDetailToggle(e, args);
|
|
384
|
+
if (this.rowDetailViewOptions && typeof this.rowDetailViewOptions.onBeforeRowDetailToggle === 'function') {
|
|
385
|
+
this.rowDetailViewOptions.onBeforeRowDetailToggle(e, args);
|
|
386
|
+
}
|
|
387
|
+
});
|
|
388
|
+
}
|
|
389
|
+
if (this.onRowBackToViewportRange) {
|
|
390
|
+
this._eventHandler.subscribe(this.onRowBackToViewportRange, (e, args) => {
|
|
391
|
+
// when row is back to viewport range, we will re-render the View Component(s)
|
|
392
|
+
this.handleOnRowBackToViewportRange(e, args);
|
|
393
|
+
if (this.rowDetailViewOptions && typeof this.rowDetailViewOptions.onRowBackToViewportRange === 'function') {
|
|
394
|
+
this.rowDetailViewOptions.onRowBackToViewportRange(e, args);
|
|
395
|
+
}
|
|
396
|
+
});
|
|
397
|
+
}
|
|
398
|
+
if (this.onRowOutOfViewportRange) {
|
|
399
|
+
this._eventHandler.subscribe(this.onRowOutOfViewportRange, (e, args) => {
|
|
400
|
+
if (this.rowDetailViewOptions && typeof this.rowDetailViewOptions.onRowOutOfViewportRange === 'function') {
|
|
401
|
+
this.rowDetailViewOptions.onRowOutOfViewportRange(e, args);
|
|
402
|
+
}
|
|
403
|
+
});
|
|
380
404
|
}
|
|
381
|
-
this._eventHandler.subscribe(this._addon.onAsyncResponse, (e, args) => {
|
|
382
|
-
if (this.rowDetailViewOptions && typeof this.rowDetailViewOptions.onAsyncResponse === 'function') {
|
|
383
|
-
this.rowDetailViewOptions.onAsyncResponse(e, args);
|
|
384
|
-
}
|
|
385
|
-
});
|
|
386
|
-
this._eventHandler.subscribe(this._addon.onAsyncEndUpdate, (e, args) => {
|
|
387
|
-
// triggers after backend called "onAsyncResponse.notify()"
|
|
388
|
-
this.renderViewModel(args && args.item);
|
|
389
|
-
if (this.rowDetailViewOptions && typeof this.rowDetailViewOptions.onAsyncEndUpdate === 'function') {
|
|
390
|
-
this.rowDetailViewOptions.onAsyncEndUpdate(e, args);
|
|
391
|
-
}
|
|
392
|
-
});
|
|
393
|
-
this._eventHandler.subscribe(this._addon.onAfterRowDetailToggle, (e, args) => {
|
|
394
|
-
// display preload template & re-render all the other Detail Views after toggling
|
|
395
|
-
// the preload View will eventually go away once the data gets loaded after the "onAsyncEndUpdate" event
|
|
396
|
-
this.renderPreloadView();
|
|
397
|
-
this.renderAllViewComponents();
|
|
398
|
-
if (this.rowDetailViewOptions && typeof this.rowDetailViewOptions.onAfterRowDetailToggle === 'function') {
|
|
399
|
-
this.rowDetailViewOptions.onAfterRowDetailToggle(e, args);
|
|
400
|
-
}
|
|
401
|
-
});
|
|
402
|
-
this._eventHandler.subscribe(this._addon.onBeforeRowDetailToggle, (e, args) => {
|
|
403
|
-
// before toggling row detail, we need to create View Component if it doesn't exist
|
|
404
|
-
this.onBeforeRowDetailToggle(e, args);
|
|
405
|
-
if (this.rowDetailViewOptions && typeof this.rowDetailViewOptions.onBeforeRowDetailToggle === 'function') {
|
|
406
|
-
this.rowDetailViewOptions.onBeforeRowDetailToggle(e, args);
|
|
407
|
-
}
|
|
408
|
-
});
|
|
409
|
-
this._eventHandler.subscribe(this._addon.onRowBackToViewportRange, (e, args) => {
|
|
410
|
-
// when row is back to viewport range, we will re-render the View Component(s)
|
|
411
|
-
this.onRowBackToViewportRange(e, args);
|
|
412
|
-
if (this.rowDetailViewOptions && typeof this.rowDetailViewOptions.onRowBackToViewportRange === 'function') {
|
|
413
|
-
this.rowDetailViewOptions.onRowBackToViewportRange(e, args);
|
|
414
|
-
}
|
|
415
|
-
});
|
|
416
|
-
this._eventHandler.subscribe(this._addon.onRowOutOfViewportRange, (e, args) => {
|
|
417
|
-
if (this.rowDetailViewOptions && typeof this.rowDetailViewOptions.onRowOutOfViewportRange === 'function') {
|
|
418
|
-
this.rowDetailViewOptions.onRowOutOfViewportRange(e, args);
|
|
419
|
-
}
|
|
420
|
-
});
|
|
421
405
|
// --
|
|
422
406
|
// hook some events needed by the Plugin itself
|
|
423
407
|
// we need to redraw the open detail views if we change column position (column reorder)
|
|
424
|
-
this._eventHandler.subscribe(this.
|
|
408
|
+
this._eventHandler.subscribe(this._grid.onColumnsReordered, this.redrawAllViewComponents.bind(this));
|
|
425
409
|
// on row selection changed, we also need to redraw
|
|
426
410
|
if (this.gridOptions.enableRowSelection || this.gridOptions.enableCheckboxSelector) {
|
|
427
|
-
this._eventHandler.subscribe(this.
|
|
411
|
+
this._eventHandler.subscribe(this._grid.onSelectedRowsChanged, this.redrawAllViewComponents.bind(this));
|
|
428
412
|
}
|
|
429
413
|
// on sort, all row detail are collapsed so we can dispose of all the Views as well
|
|
430
|
-
this._eventHandler.subscribe(this.
|
|
414
|
+
this._eventHandler.subscribe(this._grid.onSort, this.disposeAllViewComponents.bind(this));
|
|
431
415
|
// on filter changed, we need to re-render all Views
|
|
432
|
-
this._subscriptions.push(this.eventPubSubService.subscribe('onFilterChanged', this.redrawAllViewComponents.bind(this)));
|
|
416
|
+
this._subscriptions.push((_g = this.eventPubSubService) === null || _g === void 0 ? void 0 : _g.subscribe('onFilterChanged', this.redrawAllViewComponents.bind(this)), (_h = this.eventPubSubService) === null || _h === void 0 ? void 0 : _h.subscribe('onGridMenuClearAllFilters', () => setTimeout(() => this.redrawAllViewComponents())), (_j = this.eventPubSubService) === null || _j === void 0 ? void 0 : _j.subscribe('onGridMenuClearAllSorting', () => setTimeout(() => this.redrawAllViewComponents())));
|
|
433
417
|
}
|
|
434
|
-
return this._addon;
|
|
435
418
|
}
|
|
436
|
-
return
|
|
419
|
+
return this;
|
|
437
420
|
}
|
|
438
421
|
/** Redraw (re-render) all the expanded row detail View Components */
|
|
439
422
|
redrawAllViewComponents() {
|
|
@@ -451,30 +434,30 @@ class RowDetailViewExtension {
|
|
|
451
434
|
}
|
|
452
435
|
/** Redraw the necessary View Component */
|
|
453
436
|
redrawViewComponent(createdView) {
|
|
454
|
-
const containerElements =
|
|
437
|
+
const containerElements = this.gridContainerElement.getElementsByClassName(`${ROW_DETAIL_CONTAINER_PREFIX}${createdView.id}`);
|
|
455
438
|
if (containerElements && containerElements.length >= 0) {
|
|
456
439
|
this.renderViewModel(createdView.dataContext);
|
|
457
440
|
}
|
|
458
441
|
}
|
|
459
442
|
/** Render (or re-render) the View Component (Row Detail) */
|
|
460
443
|
renderPreloadView() {
|
|
461
|
-
const containerElements =
|
|
444
|
+
const containerElements = this.gridContainerElement.getElementsByClassName(`${PRELOAD_CONTAINER_PREFIX}`);
|
|
462
445
|
if (containerElements && containerElements.length >= 0) {
|
|
463
446
|
this.angularUtilService.createAngularComponentAppendToDom(this._preloadComponent, containerElements[containerElements.length - 1], true);
|
|
464
447
|
}
|
|
465
448
|
}
|
|
466
449
|
/** Render (or re-render) the View Component (Row Detail) */
|
|
467
450
|
renderViewModel(item) {
|
|
468
|
-
const containerElements =
|
|
451
|
+
const containerElements = this.gridContainerElement.getElementsByClassName(`${ROW_DETAIL_CONTAINER_PREFIX}${item[this.datasetIdPropName]}`);
|
|
469
452
|
if (containerElements && containerElements.length > 0) {
|
|
470
453
|
const componentOutput = this.angularUtilService.createAngularComponentAppendToDom(this._viewComponent, containerElements[containerElements.length - 1], true);
|
|
471
454
|
if (componentOutput && componentOutput.componentRef && componentOutput.componentRef.instance) {
|
|
472
455
|
// pass a few properties to the Row Detail template component
|
|
473
456
|
Object.assign(componentOutput.componentRef.instance, {
|
|
474
457
|
model: item,
|
|
475
|
-
addon: this
|
|
476
|
-
grid: this.
|
|
477
|
-
dataView: this.
|
|
458
|
+
addon: this,
|
|
459
|
+
grid: this._grid,
|
|
460
|
+
dataView: this.dataView,
|
|
478
461
|
parent: this.rowDetailViewOptions && this.rowDetailViewOptions.parent,
|
|
479
462
|
});
|
|
480
463
|
const viewObj = this._views.find(obj => obj.id === item[this.datasetIdPropName]);
|
|
@@ -487,7 +470,7 @@ class RowDetailViewExtension {
|
|
|
487
470
|
return undefined;
|
|
488
471
|
}
|
|
489
472
|
// --
|
|
490
|
-
//
|
|
473
|
+
// protected functions
|
|
491
474
|
// ------------------
|
|
492
475
|
disposeViewComponent(expandedView) {
|
|
493
476
|
const compRef = expandedView === null || expandedView === void 0 ? void 0 : expandedView.componentRef;
|
|
@@ -498,7 +481,6 @@ class RowDetailViewExtension {
|
|
|
498
481
|
}
|
|
499
482
|
return expandedView;
|
|
500
483
|
}
|
|
501
|
-
return null;
|
|
502
484
|
}
|
|
503
485
|
/**
|
|
504
486
|
* notify the onAsyncResponse with the "args.item" (required property)
|
|
@@ -506,8 +488,8 @@ class RowDetailViewExtension {
|
|
|
506
488
|
* @param item
|
|
507
489
|
*/
|
|
508
490
|
notifyTemplate(item) {
|
|
509
|
-
if (this.
|
|
510
|
-
this.
|
|
491
|
+
if (this.onAsyncResponse) {
|
|
492
|
+
this.onAsyncResponse.notify({ item }, undefined, this);
|
|
511
493
|
}
|
|
512
494
|
}
|
|
513
495
|
/**
|
|
@@ -542,7 +524,7 @@ class RowDetailViewExtension {
|
|
|
542
524
|
* if it's expanding we will add it to our View Components reference array if we don't already have it
|
|
543
525
|
* or if it's collapsing we will remove it from our View Components reference array
|
|
544
526
|
*/
|
|
545
|
-
|
|
527
|
+
handleOnBeforeRowDetailToggle(e, args) {
|
|
546
528
|
// expanding
|
|
547
529
|
if (args && args.item && args.item.__collapsed) {
|
|
548
530
|
// expanding row detail
|
|
@@ -567,26 +549,12 @@ class RowDetailViewExtension {
|
|
|
567
549
|
}
|
|
568
550
|
}
|
|
569
551
|
/** When Row comes back to Viewport Range, we need to redraw the View */
|
|
570
|
-
|
|
571
|
-
if (args
|
|
572
|
-
this.
|
|
573
|
-
if (view.id === args.item[this.datasetIdPropName]) {
|
|
574
|
-
this.redrawViewComponent(view);
|
|
575
|
-
}
|
|
576
|
-
});
|
|
552
|
+
handleOnRowBackToViewportRange(e, args) {
|
|
553
|
+
if (args === null || args === void 0 ? void 0 : args.item) {
|
|
554
|
+
this.redrawAllViewComponents();
|
|
577
555
|
}
|
|
578
556
|
}
|
|
579
|
-
}
|
|
580
|
-
RowDetailViewExtension.decorators = [
|
|
581
|
-
{ type: Injectable }
|
|
582
|
-
];
|
|
583
|
-
RowDetailViewExtension.ctorParameters = () => [
|
|
584
|
-
{ type: AngularUtilService },
|
|
585
|
-
{ type: ApplicationRef },
|
|
586
|
-
{ type: EventPubSubService },
|
|
587
|
-
{ type: SharedService },
|
|
588
|
-
{ type: RxJsFacade }
|
|
589
|
-
];
|
|
557
|
+
}
|
|
590
558
|
|
|
591
559
|
/** Global Grid Options Defaults */
|
|
592
560
|
const GlobalGridOptions = {
|
|
@@ -637,7 +605,6 @@ const GlobalGridOptions = {
|
|
|
637
605
|
iconExportCsvCommand: 'fa fa-download',
|
|
638
606
|
iconExportExcelCommand: 'fa fa-file-excel-o text-success',
|
|
639
607
|
iconExportTextDelimitedCommand: 'fa fa-download',
|
|
640
|
-
width: 200,
|
|
641
608
|
},
|
|
642
609
|
customFooterOptions: {
|
|
643
610
|
dateFormat: 'YYYY-MM-DD, hh:mm a',
|
|
@@ -722,6 +689,7 @@ const GlobalGridOptions = {
|
|
|
722
689
|
forceFitColumns: false,
|
|
723
690
|
frozenHeaderWidthCalcDifferential: 0,
|
|
724
691
|
gridMenu: {
|
|
692
|
+
dropSide: 'left',
|
|
725
693
|
commandLabels: {
|
|
726
694
|
clearAllFiltersCommandKey: 'CLEAR_ALL_FILTERS',
|
|
727
695
|
clearAllSortingCommandKey: 'CLEAR_ALL_SORTING',
|
|
@@ -756,7 +724,6 @@ const GlobalGridOptions = {
|
|
|
756
724
|
iconTogglePreHeaderCommand: 'fa fa-random',
|
|
757
725
|
menuWidth: 16,
|
|
758
726
|
resizeOnShowHeaderRow: true,
|
|
759
|
-
useClickToRepositionMenu: false,
|
|
760
727
|
headerColumnValueExtractor: pickerHeaderColumnValueExtractor
|
|
761
728
|
},
|
|
762
729
|
headerMenu: {
|
|
@@ -790,6 +757,7 @@ const GlobalGridOptions = {
|
|
|
790
757
|
},
|
|
791
758
|
// technically speaking the Row Detail requires the process & viewComponent but we'll ignore it just to set certain options
|
|
792
759
|
rowDetailView: {
|
|
760
|
+
collapseAllOnSort: true,
|
|
793
761
|
cssClass: 'detail-view-toggle',
|
|
794
762
|
panelRows: 1,
|
|
795
763
|
keyPrefix: '__',
|
|
@@ -965,32 +933,17 @@ class AngularSlickgridComponent {
|
|
|
965
933
|
this.gridEventService = (_c = externalServices === null || externalServices === void 0 ? void 0 : externalServices.gridEventService) !== null && _c !== void 0 ? _c : new GridEventService();
|
|
966
934
|
this.sharedService = (_d = externalServices === null || externalServices === void 0 ? void 0 : externalServices.sharedService) !== null && _d !== void 0 ? _d : new SharedService();
|
|
967
935
|
this.collectionService = (_f = externalServices === null || externalServices === void 0 ? void 0 : externalServices.collectionService) !== null && _f !== void 0 ? _f : new CollectionService(this.translaterService);
|
|
968
|
-
this.extensionUtility = (_g = externalServices === null || externalServices === void 0 ? void 0 : externalServices.extensionUtility) !== null && _g !== void 0 ? _g : new ExtensionUtility(this.sharedService, this.translaterService);
|
|
936
|
+
this.extensionUtility = (_g = externalServices === null || externalServices === void 0 ? void 0 : externalServices.extensionUtility) !== null && _g !== void 0 ? _g : new ExtensionUtility(this.sharedService, this.backendUtilityService, this.translaterService);
|
|
969
937
|
this.filterFactory = new FilterFactory(slickgridConfig, this.translaterService, this.collectionService);
|
|
970
938
|
this.filterService = (_h = externalServices === null || externalServices === void 0 ? void 0 : externalServices.filterService) !== null && _h !== void 0 ? _h : new FilterService(this.filterFactory, this._eventPubSubService, this.sharedService, this.backendUtilityService);
|
|
971
939
|
this.resizerService = (_j = externalServices === null || externalServices === void 0 ? void 0 : externalServices.resizerService) !== null && _j !== void 0 ? _j : new ResizerService(this._eventPubSubService);
|
|
972
940
|
this.sortService = (_k = externalServices === null || externalServices === void 0 ? void 0 : externalServices.sortService) !== null && _k !== void 0 ? _k : new SortService(this.sharedService, this._eventPubSubService, this.backendUtilityService);
|
|
973
941
|
this.treeDataService = (_l = externalServices === null || externalServices === void 0 ? void 0 : externalServices.treeDataService) !== null && _l !== void 0 ? _l : new TreeDataService(this._eventPubSubService, this.sharedService, this.sortService);
|
|
974
942
|
this.paginationService = (_m = externalServices === null || externalServices === void 0 ? void 0 : externalServices.paginationService) !== null && _m !== void 0 ? _m : new PaginationService(this._eventPubSubService, this.sharedService, this.backendUtilityService);
|
|
975
|
-
|
|
976
|
-
const autoTooltipExtension = new AutoTooltipExtension(this.sharedService);
|
|
977
|
-
const cellExternalCopyManagerExtension = new CellExternalCopyManagerExtension(this.extensionUtility, this.sharedService);
|
|
978
|
-
const cellMenuExtension = new CellMenuExtension(this.extensionUtility, this.sharedService, this.translaterService);
|
|
979
|
-
const contextMenuExtension = new ContextMenuExtension(this.extensionUtility, this._eventPubSubService, this.sharedService, this.treeDataService, this.translaterService);
|
|
980
|
-
const columnPickerExtension = new ColumnPickerExtension(this.extensionUtility, this.sharedService);
|
|
981
|
-
const checkboxExtension = new CheckboxSelectorExtension(this.sharedService);
|
|
982
|
-
const draggableGroupingExtension = new DraggableGroupingExtension(this.extensionUtility, this._eventPubSubService, this.sharedService);
|
|
983
|
-
const gridMenuExtension = new GridMenuExtension(this.extensionUtility, this.filterService, this._eventPubSubService, this.sharedService, this.sortService, this.backendUtilityService, this.translaterService);
|
|
984
|
-
const groupItemMetaProviderExtension = new GroupItemMetaProviderExtension(this.sharedService);
|
|
985
|
-
const headerButtonExtension = new HeaderButtonExtension(this.extensionUtility, this.sharedService);
|
|
986
|
-
const headerMenuExtension = new HeaderMenuExtension(this.extensionUtility, this.filterService, this._eventPubSubService, this.sharedService, this.sortService, this.translaterService);
|
|
987
|
-
const rowDetailViewExtension = new RowDetailViewExtension(this.angularUtilService, this.appRef, this._eventPubSubService, this.sharedService, this.rxjs);
|
|
988
|
-
const rowMoveManagerExtension = new RowMoveManagerExtension(this.sharedService);
|
|
989
|
-
const rowSelectionExtension = new RowSelectionExtension(this.sharedService);
|
|
990
|
-
this.extensionService = (_o = externalServices === null || externalServices === void 0 ? void 0 : externalServices.extensionService) !== null && _o !== void 0 ? _o : new ExtensionService(autoTooltipExtension, cellExternalCopyManagerExtension, cellMenuExtension, checkboxExtension, columnPickerExtension, contextMenuExtension, draggableGroupingExtension, gridMenuExtension, groupItemMetaProviderExtension, headerButtonExtension, headerMenuExtension, rowDetailViewExtension, rowMoveManagerExtension, rowSelectionExtension, this.sharedService, this.translaterService);
|
|
943
|
+
this.extensionService = (_o = externalServices === null || externalServices === void 0 ? void 0 : externalServices.extensionService) !== null && _o !== void 0 ? _o : new ExtensionService(this.extensionUtility, this.filterService, this._eventPubSubService, this.sharedService, this.sortService, this.treeDataService, this.translaterService);
|
|
991
944
|
this.gridStateService = (_p = externalServices === null || externalServices === void 0 ? void 0 : externalServices.gridStateService) !== null && _p !== void 0 ? _p : new GridStateService(this.extensionService, this.filterService, this._eventPubSubService, this.sharedService, this.sortService, this.treeDataService);
|
|
992
945
|
this.gridService = (_q = externalServices === null || externalServices === void 0 ? void 0 : externalServices.gridService) !== null && _q !== void 0 ? _q : new GridService(this.gridStateService, this.filterService, this._eventPubSubService, this.paginationService, this.sharedService, this.sortService, this.treeDataService);
|
|
993
|
-
this.groupingService = (_r = externalServices === null || externalServices === void 0 ? void 0 : externalServices.groupingAndColspanService) !== null && _r !== void 0 ? _r : new GroupingAndColspanService(this.extensionUtility, this.
|
|
946
|
+
this.groupingService = (_r = externalServices === null || externalServices === void 0 ? void 0 : externalServices.groupingAndColspanService) !== null && _r !== void 0 ? _r : new GroupingAndColspanService(this.extensionUtility, this._eventPubSubService);
|
|
994
947
|
this.serviceList = [
|
|
995
948
|
this.extensionService,
|
|
996
949
|
this.filterService,
|
|
@@ -1222,7 +1175,7 @@ class AngularSlickgridComponent {
|
|
|
1222
1175
|
}
|
|
1223
1176
|
}
|
|
1224
1177
|
initialization(eventHandler) {
|
|
1225
|
-
var _a, _b, _c, _d, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
|
|
1178
|
+
var _a, _b, _c, _d, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
|
|
1226
1179
|
this.gridOptions.translater = this.translaterService;
|
|
1227
1180
|
this._eventHandler = eventHandler;
|
|
1228
1181
|
// when detecting a frozen grid, we'll automatically enable the mousewheel scroll handler so that we can scroll from both left/right frozen containers
|
|
@@ -1243,7 +1196,7 @@ class AngularSlickgridComponent {
|
|
|
1243
1196
|
const dataviewInlineFilters = this.gridOptions.dataView && this.gridOptions.dataView.inlineFilters || false;
|
|
1244
1197
|
let dataViewOptions = { inlineFilters: dataviewInlineFilters };
|
|
1245
1198
|
if (this.gridOptions.draggableGrouping || this.gridOptions.enableGrouping) {
|
|
1246
|
-
this.groupItemMetadataProvider = new
|
|
1199
|
+
this.groupItemMetadataProvider = new SlickGroupItemMetadataProvider();
|
|
1247
1200
|
this.sharedService.groupItemMetadataProvider = this.groupItemMetadataProvider;
|
|
1248
1201
|
dataViewOptions = Object.assign(Object.assign({}, dataViewOptions), { groupItemMetadataProvider: this.groupItemMetadataProvider });
|
|
1249
1202
|
}
|
|
@@ -1274,6 +1227,7 @@ class AngularSlickgridComponent {
|
|
|
1274
1227
|
this.slickGrid = new Slick.Grid(`#${this.gridId}`, this.customDataView || this.dataView, this._columnDefinitions, this.gridOptions);
|
|
1275
1228
|
this.sharedService.dataView = this.dataView;
|
|
1276
1229
|
this.sharedService.slickGrid = this.slickGrid;
|
|
1230
|
+
this.sharedService.gridContainerElement = this.elm.nativeElement;
|
|
1277
1231
|
this.extensionService.bindDifferentExtensions();
|
|
1278
1232
|
this.bindDifferentHooks(this.slickGrid, this.gridOptions, this.dataView);
|
|
1279
1233
|
// 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
|
|
@@ -1303,7 +1257,7 @@ class AngularSlickgridComponent {
|
|
|
1303
1257
|
this.dataView.endUpdate();
|
|
1304
1258
|
// if you don't want the items that are not visible (due to being filtered out or being on a different page)
|
|
1305
1259
|
// to stay selected, pass 'false' to the second arg
|
|
1306
|
-
const selectionModel = this.slickGrid
|
|
1260
|
+
const selectionModel = (_l = this.slickGrid) === null || _l === void 0 ? void 0 : _l.getSelectionModel();
|
|
1307
1261
|
if (selectionModel && this.gridOptions && this.gridOptions.dataView && this.gridOptions.dataView.hasOwnProperty('syncGridSelection')) {
|
|
1308
1262
|
// if we are using a Backend Service, we will do an extra flag check, the reason is because it might have some unintended behaviors
|
|
1309
1263
|
// with the BackendServiceApi because technically the data in the page changes the DataView on every page change.
|
|
@@ -1349,13 +1303,13 @@ class AngularSlickgridComponent {
|
|
|
1349
1303
|
this.bindResizeHook(this.slickGrid, this.gridOptions);
|
|
1350
1304
|
// bind the Backend Service API callback functions only after the grid is initialized
|
|
1351
1305
|
// because the preProcess() and onInit() might get triggered
|
|
1352
|
-
if ((
|
|
1306
|
+
if ((_m = this.gridOptions) === null || _m === void 0 ? void 0 : _m.backendServiceApi) {
|
|
1353
1307
|
this.bindBackendCallbackFunctions(this.gridOptions);
|
|
1354
1308
|
}
|
|
1355
1309
|
// local grid, check if we need to show the Pagination
|
|
1356
1310
|
// if so then also check if there's any presets and finally initialize the PaginationService
|
|
1357
1311
|
// a local grid with Pagination presets will potentially have a different total of items, we'll need to get it from the DataView and update our total
|
|
1358
|
-
if (((
|
|
1312
|
+
if (((_o = this.gridOptions) === null || _o === void 0 ? void 0 : _o.enablePagination) && this._isLocalGrid) {
|
|
1359
1313
|
this.showPagination = true;
|
|
1360
1314
|
this.loadLocalGridPagination(this.dataset);
|
|
1361
1315
|
}
|
|
@@ -1363,11 +1317,11 @@ class AngularSlickgridComponent {
|
|
|
1363
1317
|
// Slick Grid & DataView objects
|
|
1364
1318
|
dataView: this.dataView,
|
|
1365
1319
|
slickGrid: this.slickGrid,
|
|
1366
|
-
extensions: (
|
|
1320
|
+
extensions: (_p = this.extensionService) === null || _p === void 0 ? void 0 : _p.extensionList,
|
|
1367
1321
|
// public methods
|
|
1368
1322
|
destroy: this.destroy.bind(this),
|
|
1369
1323
|
// return all available Services (non-singleton)
|
|
1370
|
-
backendService: (
|
|
1324
|
+
backendService: (_r = (_q = this.gridOptions) === null || _q === void 0 ? void 0 : _q.backendServiceApi) === null || _r === void 0 ? void 0 : _r.service,
|
|
1371
1325
|
filterService: this.filterService,
|
|
1372
1326
|
gridEventService: this.gridEventService,
|
|
1373
1327
|
gridStateService: this.gridStateService,
|
|
@@ -1522,6 +1476,7 @@ class AngularSlickgridComponent {
|
|
|
1522
1476
|
if ((_a = this.translate) === null || _a === void 0 ? void 0 : _a.onLangChange) {
|
|
1523
1477
|
// translate some of them on first load, then on each language change
|
|
1524
1478
|
if (gridOptions.enableTranslate) {
|
|
1479
|
+
this.extensionService.translateAllExtensions();
|
|
1525
1480
|
this.translateColumnHeaderTitleKeys();
|
|
1526
1481
|
this.translateColumnGroupKeys();
|
|
1527
1482
|
}
|
|
@@ -1529,12 +1484,7 @@ class AngularSlickgridComponent {
|
|
|
1529
1484
|
// publish event of the same name that Slickgrid-Universal uses on a language change event
|
|
1530
1485
|
this._eventPubSubService.publish('onLanguageChange');
|
|
1531
1486
|
if (gridOptions.enableTranslate) {
|
|
1532
|
-
this.extensionService.
|
|
1533
|
-
this.extensionService.translateColumnHeaders();
|
|
1534
|
-
this.extensionService.translateColumnPicker();
|
|
1535
|
-
this.extensionService.translateContextMenu();
|
|
1536
|
-
this.extensionService.translateGridMenu();
|
|
1537
|
-
this.extensionService.translateHeaderMenu();
|
|
1487
|
+
this.extensionService.translateAllExtensions();
|
|
1538
1488
|
this.translateColumnHeaderTitleKeys();
|
|
1539
1489
|
this.translateColumnGroupKeys();
|
|
1540
1490
|
if (gridOptions.createPreHeaderPanel && !gridOptions.enableDraggableGrouping) {
|
|
@@ -1555,9 +1505,8 @@ class AngularSlickgridComponent {
|
|
|
1555
1505
|
// expose all Slick Grid Events through dispatch
|
|
1556
1506
|
for (const prop in grid) {
|
|
1557
1507
|
if (grid.hasOwnProperty(prop) && prop.startsWith('on')) {
|
|
1558
|
-
const gridEventHandler = grid[prop];
|
|
1559
1508
|
const gridEventName = this._eventPubSubService.getEventNameByNamingConvention(prop, slickgridEventPrefix);
|
|
1560
|
-
this._eventHandler.subscribe(
|
|
1509
|
+
this._eventHandler.subscribe(grid[prop], (event, args) => {
|
|
1561
1510
|
return this._eventPubSubService.dispatchCustomEvent(gridEventName, { eventData: event, args });
|
|
1562
1511
|
});
|
|
1563
1512
|
}
|
|
@@ -1565,8 +1514,7 @@ class AngularSlickgridComponent {
|
|
|
1565
1514
|
// expose all Slick DataView Events through dispatch
|
|
1566
1515
|
for (const prop in dataView) {
|
|
1567
1516
|
if (dataView.hasOwnProperty(prop) && prop.startsWith('on')) {
|
|
1568
|
-
|
|
1569
|
-
this._eventHandler.subscribe(dataViewEventHandler, (event, args) => {
|
|
1517
|
+
this._eventHandler.subscribe(dataView[prop], (event, args) => {
|
|
1570
1518
|
const dataViewEventName = this._eventPubSubService.getEventNameByNamingConvention(prop, slickgridEventPrefix);
|
|
1571
1519
|
return this._eventPubSubService.dispatchCustomEvent(dataViewEventName, { eventData: event, args });
|
|
1572
1520
|
});
|
|
@@ -1601,13 +1549,11 @@ class AngularSlickgridComponent {
|
|
|
1601
1549
|
this.loadColumnPresetsWhenDatasetInitialized();
|
|
1602
1550
|
this.loadFilterPresetsWhenDatasetInitialized();
|
|
1603
1551
|
// When data changes in the DataView, we need to refresh the metrics and/or display a warning if the dataset is empty
|
|
1604
|
-
|
|
1605
|
-
this._eventHandler.subscribe(onRowCountChangedHandler, (_e, args) => {
|
|
1552
|
+
this._eventHandler.subscribe(dataView.onRowCountChanged, () => {
|
|
1606
1553
|
grid.invalidate();
|
|
1607
1554
|
this.handleOnItemCountChanged(this.dataView.getFilteredItemCount() || 0, dataView.getItemCount());
|
|
1608
1555
|
});
|
|
1609
|
-
|
|
1610
|
-
this._eventHandler.subscribe(onSetItemsCalledHandler, (_e, args) => {
|
|
1556
|
+
this._eventHandler.subscribe(dataView.onSetItemsCalled, (_e, args) => {
|
|
1611
1557
|
var _a;
|
|
1612
1558
|
grid.invalidate();
|
|
1613
1559
|
this.handleOnItemCountChanged(this.dataView.getFilteredItemCount(), args.itemCount);
|
|
@@ -1616,8 +1562,7 @@ class AngularSlickgridComponent {
|
|
|
1616
1562
|
this.resizerService.resizeColumnsByCellContent(!((_a = this.gridOptions) === null || _a === void 0 ? void 0 : _a.resizeByContentOnlyOnFirstLoad));
|
|
1617
1563
|
}
|
|
1618
1564
|
});
|
|
1619
|
-
|
|
1620
|
-
this._eventHandler.subscribe(onRowsChangedHandler, (_e, args) => {
|
|
1565
|
+
this._eventHandler.subscribe(dataView.onRowsChanged, (_e, args) => {
|
|
1621
1566
|
// filtering data with local dataset will not always show correctly unless we call this updateRow/render
|
|
1622
1567
|
// also don't use "invalidateRows" since it destroys the entire row and as bad user experience when updating a row
|
|
1623
1568
|
// see commit: https://github.com/ghiscoding/aurelia-slickgrid/commit/8c503a4d45fba11cbd8d8cc467fae8d177cc4f60
|
|
@@ -1850,10 +1795,10 @@ class AngularSlickgridComponent {
|
|
|
1850
1795
|
}
|
|
1851
1796
|
/** Load any Row Selections into the DataView that were presets by the user */
|
|
1852
1797
|
loadRowSelectionPresetWhenExists() {
|
|
1853
|
-
var _a, _b
|
|
1798
|
+
var _a, _b;
|
|
1854
1799
|
// if user entered some Row Selections "presets"
|
|
1855
1800
|
const presets = (_a = this.gridOptions) === null || _a === void 0 ? void 0 : _a.presets;
|
|
1856
|
-
const selectionModel = (
|
|
1801
|
+
const selectionModel = (_b = this.slickGrid) === null || _b === void 0 ? void 0 : _b.getSelectionModel();
|
|
1857
1802
|
const enableRowSelection = this.gridOptions && (this.gridOptions.enableCheckboxSelector || this.gridOptions.enableRowSelection);
|
|
1858
1803
|
if (enableRowSelection && selectionModel && presets && presets.rowSelection && (Array.isArray(presets.rowSelection.gridRowIndexes) || Array.isArray(presets.rowSelection.dataContextIds))) {
|
|
1859
1804
|
let dataContextIds = presets.rowSelection.dataContextIds;
|
|
@@ -1933,6 +1878,12 @@ class AngularSlickgridComponent {
|
|
|
1933
1878
|
if (this.gridOptions.enableTranslate) {
|
|
1934
1879
|
this.extensionService.translateColumnHeaders();
|
|
1935
1880
|
}
|
|
1881
|
+
if (this.gridOptions.enableRowDetailView) {
|
|
1882
|
+
this.slickRowDetailView = new SlickRowDetailView(this.angularUtilService, this.appRef, this._eventPubSubService, this.elm.nativeElement, this.rxjs);
|
|
1883
|
+
this.slickRowDetailView.create(this.columnDefinitions, this.gridOptions);
|
|
1884
|
+
this._registeredResources.push(this.slickRowDetailView);
|
|
1885
|
+
this.extensionService.addExtensionToList(ExtensionName.rowDetailView, { name: ExtensionName.rowDetailView, instance: this.slickRowDetailView });
|
|
1886
|
+
}
|
|
1936
1887
|
// also initialize (render) the empty warning component
|
|
1937
1888
|
this.slickEmptyWarning = new SlickEmptyWarningComponent();
|
|
1938
1889
|
this._registeredResources.push(this.slickEmptyWarning);
|
|
@@ -2063,39 +2014,48 @@ class AngularSlickgridComponent {
|
|
|
2063
2014
|
}
|
|
2064
2015
|
}
|
|
2065
2016
|
}
|
|
2066
|
-
AngularSlickgridComponent
|
|
2067
|
-
|
|
2068
|
-
|
|
2069
|
-
|
|
2070
|
-
|
|
2071
|
-
|
|
2072
|
-
|
|
2073
|
-
|
|
2074
|
-
|
|
2075
|
-
|
|
2076
|
-
|
|
2077
|
-
|
|
2078
|
-
|
|
2079
|
-
|
|
2080
|
-
|
|
2081
|
-
|
|
2082
|
-
|
|
2083
|
-
|
|
2084
|
-
|
|
2085
|
-
|
|
2086
|
-
|
|
2087
|
-
|
|
2088
|
-
|
|
2089
|
-
]
|
|
2090
|
-
|
|
2091
|
-
|
|
2092
|
-
|
|
2093
|
-
|
|
2094
|
-
|
|
2095
|
-
|
|
2096
|
-
|
|
2097
|
-
|
|
2098
|
-
|
|
2017
|
+
AngularSlickgridComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.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 });
|
|
2018
|
+
AngularSlickgridComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.0", type: AngularSlickgridComponent, selector: "angular-slickgrid", inputs: { customDataView: "customDataView", gridId: "gridId", gridOptions: "gridOptions", paginationOptions: "paginationOptions", columnDefinitions: "columnDefinitions", dataset: "dataset", datasetHierarchical: "datasetHierarchical" }, providers: [
|
|
2019
|
+
// make everything transient (non-singleton)
|
|
2020
|
+
AngularUtilService,
|
|
2021
|
+
ApplicationRef,
|
|
2022
|
+
TranslaterService,
|
|
2023
|
+
], 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>" });
|
|
2024
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.0", ngImport: i0, type: AngularSlickgridComponent, decorators: [{
|
|
2025
|
+
type: Component,
|
|
2026
|
+
args: [{ selector: 'angular-slickgrid', providers: [
|
|
2027
|
+
// make everything transient (non-singleton)
|
|
2028
|
+
AngularUtilService,
|
|
2029
|
+
ApplicationRef,
|
|
2030
|
+
TranslaterService,
|
|
2031
|
+
], 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>" }]
|
|
2032
|
+
}], ctorParameters: function () {
|
|
2033
|
+
return [{ type: AngularUtilService }, { type: i0.ApplicationRef }, { type: i0.ChangeDetectorRef }, { type: ContainerService }, { type: i0.ElementRef }, { type: i1.TranslateService, decorators: [{
|
|
2034
|
+
type: Optional
|
|
2035
|
+
}] }, { type: TranslaterService, decorators: [{
|
|
2036
|
+
type: Optional
|
|
2037
|
+
}] }, { type: undefined, decorators: [{
|
|
2038
|
+
type: Inject,
|
|
2039
|
+
args: ['config']
|
|
2040
|
+
}] }, { type: undefined, decorators: [{
|
|
2041
|
+
type: Inject,
|
|
2042
|
+
args: ['externalService']
|
|
2043
|
+
}] }];
|
|
2044
|
+
}, propDecorators: { customDataView: [{
|
|
2045
|
+
type: Input
|
|
2046
|
+
}], gridId: [{
|
|
2047
|
+
type: Input
|
|
2048
|
+
}], gridOptions: [{
|
|
2049
|
+
type: Input
|
|
2050
|
+
}], paginationOptions: [{
|
|
2051
|
+
type: Input
|
|
2052
|
+
}], columnDefinitions: [{
|
|
2053
|
+
type: Input
|
|
2054
|
+
}], dataset: [{
|
|
2055
|
+
type: Input
|
|
2056
|
+
}], datasetHierarchical: [{
|
|
2057
|
+
type: Input
|
|
2058
|
+
}] } });
|
|
2099
2059
|
|
|
2100
2060
|
class AngularSlickgridModule {
|
|
2101
2061
|
static forRoot(config = {}) {
|
|
@@ -2111,25 +2071,33 @@ class AngularSlickgridModule {
|
|
|
2111
2071
|
};
|
|
2112
2072
|
}
|
|
2113
2073
|
}
|
|
2114
|
-
AngularSlickgridModule
|
|
2115
|
-
|
|
2116
|
-
|
|
2117
|
-
|
|
2118
|
-
|
|
2119
|
-
|
|
2120
|
-
|
|
2121
|
-
|
|
2122
|
-
|
|
2123
|
-
|
|
2124
|
-
|
|
2125
|
-
|
|
2126
|
-
|
|
2127
|
-
|
|
2128
|
-
|
|
2074
|
+
AngularSlickgridModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.0", ngImport: i0, type: AngularSlickgridModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
2075
|
+
AngularSlickgridModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.1.0", ngImport: i0, type: AngularSlickgridModule, declarations: [AngularSlickgridComponent], imports: [CommonModule,
|
|
2076
|
+
TranslateModule], exports: [AngularSlickgridComponent] });
|
|
2077
|
+
AngularSlickgridModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.1.0", ngImport: i0, type: AngularSlickgridModule, imports: [[
|
|
2078
|
+
CommonModule,
|
|
2079
|
+
TranslateModule
|
|
2080
|
+
]] });
|
|
2081
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.0", ngImport: i0, type: AngularSlickgridModule, decorators: [{
|
|
2082
|
+
type: NgModule,
|
|
2083
|
+
args: [{
|
|
2084
|
+
imports: [
|
|
2085
|
+
CommonModule,
|
|
2086
|
+
TranslateModule
|
|
2087
|
+
],
|
|
2088
|
+
declarations: [
|
|
2089
|
+
AngularSlickgridComponent,
|
|
2090
|
+
],
|
|
2091
|
+
exports: [
|
|
2092
|
+
AngularSlickgridComponent,
|
|
2093
|
+
],
|
|
2094
|
+
entryComponents: [AngularSlickgridComponent]
|
|
2095
|
+
}]
|
|
2096
|
+
}] });
|
|
2129
2097
|
|
|
2130
2098
|
/**
|
|
2131
2099
|
* Generated bundle index. Do not edit.
|
|
2132
2100
|
*/
|
|
2133
2101
|
|
|
2134
|
-
export { AngularSlickgridComponent, AngularSlickgridModule, AngularUtilService, BsDropDownService,
|
|
2135
|
-
//# sourceMappingURL=angular-slickgrid.
|
|
2102
|
+
export { AngularSlickgridComponent, AngularSlickgridModule, AngularUtilService, BsDropDownService, SlickRowDetailView, SlickgridConfig, unsubscribeAllObservables };
|
|
2103
|
+
//# sourceMappingURL=angular-slickgrid.mjs.map
|