@genesislcap/grid-pro 14.348.0 → 14.350.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/dist/custom-elements.json +2293 -1443
- package/dist/dts/cell-renderers/boolean.renderer.d.ts.map +1 -1
- package/dist/dts/datasource/base.datasource.d.ts +20 -15
- package/dist/dts/datasource/base.datasource.d.ts.map +1 -1
- package/dist/dts/datasource/index.d.ts +1 -0
- package/dist/dts/datasource/index.d.ts.map +1 -1
- package/dist/dts/datasource/server-side.datasource.d.ts +9 -9
- package/dist/dts/datasource/server-side.datasource.d.ts.map +1 -1
- package/dist/dts/grid-pro-genesis-datasource/datasource-events.types.d.ts +101 -0
- package/dist/dts/grid-pro-genesis-datasource/datasource-events.types.d.ts.map +1 -0
- package/dist/dts/grid-pro-genesis-datasource/grid-pro-genesis-datasource.d.ts +24 -9
- package/dist/dts/grid-pro-genesis-datasource/grid-pro-genesis-datasource.d.ts.map +1 -1
- package/dist/dts/grid-pro-v34.d.ts +862 -0
- package/dist/dts/grid-pro-v34.d.ts.map +1 -0
- package/dist/dts/grid-pro.d.ts +88 -1
- package/dist/dts/grid-pro.d.ts.map +1 -1
- package/dist/dts/grid-pro.definitions.d.ts.map +1 -1
- package/dist/dts/index.d.ts +1 -0
- package/dist/dts/index.d.ts.map +1 -1
- package/dist/dts/status-bar-components/label-value.status-bar.d.ts +1 -1
- package/dist/dts/status-bar-components/label-value.status-bar.d.ts.map +1 -1
- package/dist/dts/status-bar-components/load-more.status-bar.d.ts +1 -1
- package/dist/dts/status-bar-components/load-more.status-bar.d.ts.map +1 -1
- package/dist/dts/status-bar-components/pagination.status-bar.d.ts +1 -1
- package/dist/dts/status-bar-components/pagination.status-bar.d.ts.map +1 -1
- package/dist/dts/status-bar-components/reload.status-bar.d.ts +1 -1
- package/dist/dts/status-bar-components/reload.status-bar.d.ts.map +1 -1
- package/dist/esm/cell-renderers/boolean.renderer.js +6 -7
- package/dist/esm/datasource/base.datasource.js +68 -95
- package/dist/esm/datasource/index.js +1 -0
- package/dist/esm/datasource/server-side.datasource.js +127 -149
- package/dist/esm/grid-pro-genesis-datasource/datasource-events.types.js +33 -0
- package/dist/esm/grid-pro-genesis-datasource/grid-pro-genesis-datasource.js +83 -78
- package/dist/esm/grid-pro-v34.js +1034 -0
- package/dist/esm/grid-pro.definitions.js +1 -1
- package/dist/esm/grid-pro.js +283 -8
- package/dist/esm/grid-pro.template.js +1 -1
- package/dist/esm/index.js +1 -0
- package/dist/esm/status-bar-components/pagination.status-bar.js +18 -11
- package/dist/grid-pro.api.json +3188 -698
- package/dist/grid-pro.d.ts +1171 -118
- package/docs/api/grid-pro.errorhandlerdialogstyles.md +11 -0
- package/docs/api/grid-pro.genesisgriddatasourceelement.md +0 -21
- package/docs/api/grid-pro.geterrorhandlerdialogtemplate.md +64 -0
- package/docs/api/grid-pro.gridpro.md +17 -0
- package/docs/api/grid-pro.gridpro.thememode.md +11 -0
- package/docs/api/{grid-pro.gridprobasedatasource.applyallagtransactions.md → grid-pro.gridprobasedatasource.applyalltransactions.md} +3 -3
- package/docs/api/grid-pro.gridprobasedatasource.applytransaction.md +3 -3
- package/docs/api/grid-pro.gridprobasedatasource.getdatasourcestatusbarpanels.md +15 -1
- package/docs/api/grid-pro.gridprobasedatasource.isdisconnected.md +1 -1
- package/docs/api/{grid-pro.gridprobasedatasource.agtransaction.md → grid-pro.gridprobasedatasource.keepcoldefsonclearrowdata.md} +3 -3
- package/docs/api/grid-pro.gridprobasedatasource.md +17 -55
- package/docs/api/grid-pro.gridprobasedatasource.pagination.md +1 -1
- package/docs/api/grid-pro.gridprobasedatasource.setdisconnected.md +1 -1
- package/docs/api/{grid-pro.gridprobasedatasource.applyfuncname.md → grid-pro.gridprobasedatasource.transactiondata.md} +3 -3
- package/docs/api/grid-pro.gridprogenesisdatasource.applytransaction.md +4 -4
- package/docs/api/grid-pro.gridprogenesisdatasource.init.md +4 -20
- package/docs/api/grid-pro.gridprogenesisdatasource.md +7 -34
- package/docs/api/{grid-pro.gridprogenesisdatasource.applyfuncname.md → grid-pro.gridprogenesisdatasource.transactiondata.md} +3 -3
- package/docs/api/grid-pro.gridproserversidedatasource.applytransaction.md +4 -4
- package/docs/api/grid-pro.gridproserversidedatasource.md +1 -74
- package/docs/api/grid-pro.gridproserversidedatasource.onpaginationchanged.md +2 -2
- package/docs/api/{grid-pro.gridproserversidedatasource.rowmodel.md → grid-pro.gridprov34._constructor_.md} +5 -3
- package/docs/api/grid-pro.gridprov34.addeventlistener.md +89 -0
- package/docs/api/{grid-pro.gridproserversidedatasource.applyfuncname.md → grid-pro.gridprov34.aggrid.md} +3 -3
- package/docs/api/{grid-pro.gridproserversidedatasource.applyasyncfuncname.md → grid-pro.gridprov34.aggridoptions.md} +3 -3
- package/docs/api/grid-pro.gridprov34.autocellrendererbytype.md +14 -0
- package/docs/api/grid-pro.gridprov34.cachefilterconfig.md +18 -0
- package/docs/api/grid-pro.gridprov34.classnames.md +14 -0
- package/docs/api/grid-pro.gridprov34.clearlocalgridoptions.md +17 -0
- package/docs/api/grid-pro.gridprov34.columncomponentname.md +14 -0
- package/docs/api/grid-pro.gridprov34.combineallgridcomponents.md +53 -0
- package/docs/api/grid-pro.gridprov34.connectedcallback.md +18 -0
- package/docs/api/grid-pro.gridprov34.customerrorhandlertemplate.md +21 -0
- package/docs/api/grid-pro.gridprov34.disconnectedcallback.md +18 -0
- package/docs/api/grid-pro.gridprov34.enablecellflashing.md +21 -0
- package/docs/api/grid-pro.gridprov34.enablerowflashing.md +16 -0
- package/docs/api/grid-pro.gridprov34.eventsandcallbacks.md +14 -0
- package/docs/api/grid-pro.gridprov34.getfiltermodel.md +20 -0
- package/docs/api/grid-pro.gridprov34.getsavedcolumnstate.md +21 -0
- package/docs/api/grid-pro.gridprov34.getselectedrows.md +19 -0
- package/docs/api/{grid-pro.gridproserversidedatasource.applytransactionasync.md → grid-pro.gridprov34.globaleventlistener.md} +7 -9
- package/docs/api/grid-pro.gridprov34.gridapi.md +14 -0
- package/docs/api/grid-pro.gridprov34.gridautosizingenabled.md +16 -0
- package/docs/api/grid-pro.gridprov34.gridcomponents.md +16 -0
- package/docs/api/grid-pro.gridprov34.griderroritems.md +14 -0
- package/docs/api/grid-pro.gridprov34.gridoptions.md +14 -0
- package/docs/api/grid-pro.gridprov34.gridoptionsconfig.md +28 -0
- package/docs/api/grid-pro.gridprov34.gridparams.md +12 -0
- package/docs/api/grid-pro.gridprov34.gridprodatasource.md +18 -0
- package/docs/api/grid-pro.gridprov34.gridslot.md +14 -0
- package/docs/api/grid-pro.gridprov34.hasselectedrows.md +19 -0
- package/docs/api/grid-pro.gridprov34.headercasetype.md +18 -0
- package/docs/api/grid-pro.gridprov34.headerheight.md +14 -0
- package/docs/api/grid-pro.gridprov34.hidedatasourceerror.md +18 -0
- package/docs/api/grid-pro.gridprov34.initialised.md +14 -0
- package/docs/api/grid-pro.gridprov34.isserverside.md +12 -0
- package/docs/api/grid-pro.gridprov34.md +1008 -0
- package/docs/api/grid-pro.gridprov34.mergeallcolumndefsandstates.md +230 -0
- package/docs/api/grid-pro.gridprov34.onlytemplatecoldefs.md +14 -0
- package/docs/api/grid-pro.gridprov34.pagination.md +21 -0
- package/docs/api/grid-pro.gridprov34.paginationpagesize.md +25 -0
- package/docs/api/grid-pro.gridprov34.persistcolumnstatekey.md +16 -0
- package/docs/api/grid-pro.gridprov34.persistfiltermodelkey.md +16 -0
- package/docs/api/grid-pro.gridprov34.provider.md +14 -0
- package/docs/api/grid-pro.gridprov34.restorecachedfilterconfig.md +18 -0
- package/docs/api/grid-pro.gridprov34.rowdata.md +18 -0
- package/docs/api/grid-pro.gridprov34.rowdatachanged.md +67 -0
- package/docs/api/grid-pro.gridprov34.rowheight.md +14 -0
- package/docs/api/grid-pro.gridprov34.setfiltermodel.md +55 -0
- package/docs/api/grid-pro.gridprov34.setuppaginationandstatusbar.md +53 -0
- package/docs/api/grid-pro.gridprov34.statepersistanceenabled.md +18 -0
- package/docs/api/grid-pro.gridprov34.statepersistence.md +14 -0
- package/docs/api/grid-pro.gridprov34.statusbarconfig.md +21 -0
- package/docs/api/grid-pro.gridprov34.thememode.md +14 -0
- package/docs/api/grid-pro.gridprov34.withstatusbar.md +21 -0
- package/docs/api/grid-pro.md +29 -1
- package/docs/api-report.md.api.md +377 -41
- package/package.json +16 -14
- package/docs/api/grid-pro.genesisgriddatasourceelement.aggrid.md +0 -11
- package/docs/api/grid-pro.gridprobasedatasource.applyasyncfuncname.md +0 -11
- package/docs/api/grid-pro.gridprobasedatasource.applytransactionasync.md +0 -66
- package/docs/api/grid-pro.gridprogenesisdatasource.applyasyncfuncname.md +0 -11
- package/docs/api/grid-pro.gridprogenesisdatasource.applytransactionasync.md +0 -66
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { __awaiter, __decorate } from "tslib";
|
|
2
|
-
import { Events, } from '@ag-grid-community/core';
|
|
3
2
|
import { MessageType, ResourceType, dataServerResultFilter, normaliseCriteria, } from '@genesislcap/foundation-comms';
|
|
4
3
|
import { LifecycleMixin } from '@genesislcap/foundation-utils';
|
|
5
4
|
import { DOM, attr, customElement } from '@microsoft/fast-element';
|
|
@@ -7,8 +6,8 @@ import { BehaviorSubject, EMPTY } from 'rxjs';
|
|
|
7
6
|
import { catchError, debounceTime, skip, tap } from 'rxjs/operators';
|
|
8
7
|
import { criteriaDelimiter, GridProBaseDatasource } from '../datasource/base.datasource';
|
|
9
8
|
import { getClientSideFilterParamsByFieldType } from '../datasource/client-side.grid-definitions';
|
|
10
|
-
import { GridProStatusBarTypes } from '../grid-pro.types';
|
|
11
9
|
import { logger } from '../utils/logger';
|
|
10
|
+
import { datasourceEventNames, } from './datasource-events.types';
|
|
12
11
|
import { gridProGenesisDatasourceEventNames } from './grid-pro-genesis-datasource.config';
|
|
13
12
|
const withoutFullInit = null;
|
|
14
13
|
const withoutColumnDefs = null;
|
|
@@ -20,10 +19,15 @@ const withoutColumnDefs = null;
|
|
|
20
19
|
let GridProGenesisDatasource = class GridProGenesisDatasource extends LifecycleMixin(GridProBaseDatasource) {
|
|
21
20
|
constructor() {
|
|
22
21
|
super(...arguments);
|
|
23
|
-
this.applyFuncName = 'applyTransaction';
|
|
24
|
-
this.applyAsyncFuncName = 'applyTransactionAsync';
|
|
25
22
|
// Cache for rowData array to avoid repeated Array.from() calls
|
|
26
23
|
this.cachedRowArray = [];
|
|
24
|
+
// Transaction data for grid operations
|
|
25
|
+
this.transactionData = {
|
|
26
|
+
add: [],
|
|
27
|
+
remove: [],
|
|
28
|
+
update: [],
|
|
29
|
+
addIndex: 0,
|
|
30
|
+
};
|
|
27
31
|
this.keepColDefsOnClearRowData = false;
|
|
28
32
|
this.requiresFullRowDataAndColDefs = true;
|
|
29
33
|
this._lastMoreRows = false;
|
|
@@ -113,27 +117,26 @@ let GridProGenesisDatasource = class GridProGenesisDatasource extends LifecycleM
|
|
|
113
117
|
* @param columnStates - Optionally set the grid up with column state
|
|
114
118
|
* @remarks This method is called automatically when the element is connected to the DOM.
|
|
115
119
|
*/
|
|
116
|
-
init(
|
|
120
|
+
init(keepColDefsOnClearRowData) {
|
|
117
121
|
return __awaiter(this, void 0, void 0, function* () {
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
}
|
|
136
|
-
this.handleErrors('Application not connected or invalid resource name, datasource will not work.', 'unknown');
|
|
122
|
+
// Emit event to initialize datasource with options
|
|
123
|
+
const options = Object.assign({ getRowId: (params) => params.data[this.rowId] }, this.deferredGridOptions);
|
|
124
|
+
this.$emit(datasourceEventNames.initialize, {
|
|
125
|
+
keepColDefsOnClearRowData,
|
|
126
|
+
options,
|
|
127
|
+
});
|
|
128
|
+
// TODO: instead of listening to ready event, we should only render the datasource slot when the grid is ready
|
|
129
|
+
this.addEventListener(datasourceEventNames.ready, (event) => __awaiter(this, void 0, void 0, function* () {
|
|
130
|
+
const { pagination } = event.detail;
|
|
131
|
+
this.pagination = pagination;
|
|
132
|
+
yield this.loadResourceData();
|
|
133
|
+
}), { once: true });
|
|
134
|
+
const filterDebounceTime = 600;
|
|
135
|
+
this.updateSub = this.update
|
|
136
|
+
.pipe(skip(1), debounceTime(filterDebounceTime), tap((f) => logger.debug('filters (debounced): ', f)))
|
|
137
|
+
.subscribe((_) => {
|
|
138
|
+
this.reloadResourceData();
|
|
139
|
+
});
|
|
137
140
|
});
|
|
138
141
|
}
|
|
139
142
|
/**
|
|
@@ -161,7 +164,6 @@ let GridProGenesisDatasource = class GridProGenesisDatasource extends LifecycleM
|
|
|
161
164
|
this._isMoreRowsResult = false;
|
|
162
165
|
this._nextOffset = 0;
|
|
163
166
|
this._loadMoreCount = 0;
|
|
164
|
-
this.agGrid.clearLocalGridOptions();
|
|
165
167
|
this.requiresFullRowDataAndColDefs = true;
|
|
166
168
|
this.dataSubWasLoggedOff = false;
|
|
167
169
|
this.criteriaFromFilters = new Map();
|
|
@@ -195,14 +197,8 @@ let GridProGenesisDatasource = class GridProGenesisDatasource extends LifecycleM
|
|
|
195
197
|
*/
|
|
196
198
|
restart() {
|
|
197
199
|
return __awaiter(this, void 0, void 0, function* () {
|
|
198
|
-
let columnDefinitions;
|
|
199
|
-
let columnStates;
|
|
200
|
-
if (this.keepColDefsOnClearRowData) {
|
|
201
|
-
columnDefinitions = this.agGrid.gridApi.getColumnDefs();
|
|
202
|
-
columnStates = this.agGrid.columnApi.getColumnState();
|
|
203
|
-
}
|
|
204
200
|
this.destroy();
|
|
205
|
-
yield this.init(
|
|
201
|
+
yield this.init(this.keepColDefsOnClearRowData);
|
|
206
202
|
});
|
|
207
203
|
}
|
|
208
204
|
/**
|
|
@@ -210,7 +206,7 @@ let GridProGenesisDatasource = class GridProGenesisDatasource extends LifecycleM
|
|
|
210
206
|
*/
|
|
211
207
|
refreshRows() {
|
|
212
208
|
this.updateCachedRowArray(); // Ensure the cache is up-to-date
|
|
213
|
-
this.
|
|
209
|
+
this.emitDataLoaded(this.cachedRowArray);
|
|
214
210
|
}
|
|
215
211
|
/**
|
|
216
212
|
* Clears the rowData and columnDefs for the grid.
|
|
@@ -219,29 +215,23 @@ let GridProGenesisDatasource = class GridProGenesisDatasource extends LifecycleM
|
|
|
219
215
|
* @internal
|
|
220
216
|
*/
|
|
221
217
|
clearRowData(withColumnDefs = true) {
|
|
222
|
-
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
223
|
-
if (this.agGrid.asyncAdd || this.agGrid.asyncUpdate || this.agGrid.asyncRemove) {
|
|
224
|
-
(_b = (_a = this.agGrid) === null || _a === void 0 ? void 0 : _a.gridApi) === null || _b === void 0 ? void 0 : _b.flushAsyncTransactions();
|
|
225
|
-
}
|
|
226
218
|
this.rowData = new Map();
|
|
227
219
|
this.cachedRowArray = []; // Clear the cached array
|
|
228
|
-
this.
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
(_h = (_g = this.agGrid) === null || _g === void 0 ? void 0 : _g.gridApi) === null || _h === void 0 ? void 0 : _h.refreshCells({ force: true });
|
|
220
|
+
this.transactionData = { add: [], remove: [], update: [], addIndex: 0 };
|
|
221
|
+
// Emit event to clear data
|
|
222
|
+
this.$emit(datasourceEventNames.dataCleared, {
|
|
223
|
+
includeSchema: withColumnDefs && !this.keepColDefsOnClearRowData,
|
|
224
|
+
});
|
|
234
225
|
}
|
|
235
226
|
/**
|
|
236
227
|
* Sets the columnDefs and rowData for the grid.
|
|
237
|
-
* @remarks This should only happen once, when the grid is first initialized. Follow up updates will use
|
|
228
|
+
* @remarks This should only happen once, when the grid is first initialized. Follow up updates will use transactions.
|
|
238
229
|
* @internal
|
|
239
230
|
*/
|
|
240
231
|
setRowData(rowData) {
|
|
241
232
|
return __awaiter(this, void 0, void 0, function* () {
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
if (!preSetColumnDefs || preSetColumnDefs.length === 0) {
|
|
233
|
+
// Check if we need to set column definitions first
|
|
234
|
+
if (this.requiresFullRowDataAndColDefs) {
|
|
245
235
|
const agColumnDefs = yield this.getAgColumnDefs(this.datasource.fieldMetadata);
|
|
246
236
|
if (agColumnDefs) {
|
|
247
237
|
// AG's internals will check if group/pivot are NOT NULL to trigger module registration warning for `row-grouping`.
|
|
@@ -255,14 +245,17 @@ let GridProGenesisDatasource = class GridProGenesisDatasource extends LifecycleM
|
|
|
255
245
|
col.pivot = null;
|
|
256
246
|
}
|
|
257
247
|
});
|
|
258
|
-
this.
|
|
248
|
+
this.$emit(datasourceEventNames.schemaUpdated, {
|
|
249
|
+
schema: agColumnDefs,
|
|
250
|
+
metadata: this.datasource.fieldMetadata,
|
|
251
|
+
});
|
|
259
252
|
}
|
|
260
253
|
}
|
|
261
254
|
const data = this.rowDataMapper ? this.rowDataMapper(rowData) : rowData;
|
|
262
|
-
this.
|
|
255
|
+
this.$emit(datasourceEventNames.filtersRestored);
|
|
263
256
|
// Use transactions for adding data
|
|
264
|
-
this.
|
|
265
|
-
this.
|
|
257
|
+
this.transactionData = { add: data ? [...data] : [], remove: [], update: [], addIndex: 0 };
|
|
258
|
+
this.emitDataChanged(this.transactionData);
|
|
266
259
|
// Update the cached row array
|
|
267
260
|
this.updateCachedRowArray();
|
|
268
261
|
this.requiresFullRowDataAndColDefs = false;
|
|
@@ -275,6 +268,31 @@ let GridProGenesisDatasource = class GridProGenesisDatasource extends LifecycleM
|
|
|
275
268
|
updateCachedRowArray() {
|
|
276
269
|
this.cachedRowArray = Array.from(this.rowData.values());
|
|
277
270
|
}
|
|
271
|
+
/**
|
|
272
|
+
* Emits event to notify data has been loaded
|
|
273
|
+
* @internal
|
|
274
|
+
*/
|
|
275
|
+
emitDataLoaded(data, isInitialLoad = false) {
|
|
276
|
+
this.$emit(datasourceEventNames.dataLoaded, {
|
|
277
|
+
data,
|
|
278
|
+
isInitialLoad,
|
|
279
|
+
});
|
|
280
|
+
}
|
|
281
|
+
/**
|
|
282
|
+
* Emits event to notify data has changed
|
|
283
|
+
* @internal
|
|
284
|
+
*/
|
|
285
|
+
emitDataChanged(transaction) {
|
|
286
|
+
this.$emit(datasourceEventNames.dataChanged, {
|
|
287
|
+
changes: transaction,
|
|
288
|
+
});
|
|
289
|
+
if (this.rowData.size === 0 &&
|
|
290
|
+
!transaction.add.length &&
|
|
291
|
+
!transaction.update.length &&
|
|
292
|
+
!transaction.remove.length) {
|
|
293
|
+
this.$emit(datasourceEventNames.noDataAvailable);
|
|
294
|
+
}
|
|
295
|
+
}
|
|
278
296
|
/**
|
|
279
297
|
* Resets the grid data while keeping columnDefs and sends a DATA_LOGOFF message if it's a stream.
|
|
280
298
|
* Loads resource data without full initialization (no metadata fetch).
|
|
@@ -284,7 +302,6 @@ let GridProGenesisDatasource = class GridProGenesisDatasource extends LifecycleM
|
|
|
284
302
|
*/
|
|
285
303
|
reloadResourceData() {
|
|
286
304
|
return __awaiter(this, void 0, void 0, function* () {
|
|
287
|
-
var _a, _b, _c;
|
|
288
305
|
logger.debug('GridProGenesisDatasource.reloadResourceData()', this.resourceName);
|
|
289
306
|
if (this.dataSub) {
|
|
290
307
|
this.dataSub.unsubscribe();
|
|
@@ -295,10 +312,8 @@ let GridProGenesisDatasource = class GridProGenesisDatasource extends LifecycleM
|
|
|
295
312
|
this._loadMoreCount = 0;
|
|
296
313
|
this.datasource.updateLoadMoreCount(0);
|
|
297
314
|
this.datasource.stream = undefined;
|
|
298
|
-
// Cache the current filter model before clearing data to preserve column filters
|
|
299
|
-
yield ((_a = this.agGrid) === null || _a === void 0 ? void 0 : _a.cacheFilterConfig());
|
|
300
315
|
this.clearRowData(withoutColumnDefs);
|
|
301
|
-
(
|
|
316
|
+
this.$emit(datasourceEventNames.loadingStarted);
|
|
302
317
|
this.setDisconnected(false);
|
|
303
318
|
yield this.loadResourceData(withoutFullInit);
|
|
304
319
|
});
|
|
@@ -418,20 +433,13 @@ let GridProGenesisDatasource = class GridProGenesisDatasource extends LifecycleM
|
|
|
418
433
|
* @param sourceRef - The source reference
|
|
419
434
|
* @param rowsCount - The total number of rows
|
|
420
435
|
* @remarks
|
|
421
|
-
* This method
|
|
422
|
-
* It will silently fail if the Enterprise module is not available.
|
|
436
|
+
* This method emits an event for the grid to handle status bar updates.
|
|
423
437
|
*/
|
|
424
438
|
updateLoadMoreStatus(moreRows, sourceRef) {
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
if (statusBar) {
|
|
430
|
-
(_c = (_b = statusBar).updateParams) === null || _c === void 0 ? void 0 : _c.call(_b, {
|
|
431
|
-
moreRows,
|
|
432
|
-
sourceRef,
|
|
433
|
-
});
|
|
434
|
-
}
|
|
439
|
+
this.$emit(datasourceEventNames.moreDataAvailable, {
|
|
440
|
+
hasMoreData: moreRows,
|
|
441
|
+
sourceRef,
|
|
442
|
+
});
|
|
435
443
|
}
|
|
436
444
|
applyRequestServerData(requestServerResult) {
|
|
437
445
|
var _a;
|
|
@@ -479,11 +487,11 @@ let GridProGenesisDatasource = class GridProGenesisDatasource extends LifecycleM
|
|
|
479
487
|
return true; // delete rows that don't exist in requestServerData
|
|
480
488
|
});
|
|
481
489
|
const rowsToInsert = requestServerData.filter((data) => !this.rowData.has(data[this.rowId]));
|
|
482
|
-
this.
|
|
490
|
+
this.transactionData = { add: [], remove: [], update: [] };
|
|
483
491
|
this.handleStreamInserts(rowsToInsert);
|
|
484
492
|
this.handleStreamDeletes(rowsToDelete);
|
|
485
493
|
this.handleStreamUpdates(rowsToUpdate);
|
|
486
|
-
this.
|
|
494
|
+
this.emitDataChanged(this.transactionData);
|
|
487
495
|
this.handleSizeChanged(previousSize, this.rowData.size);
|
|
488
496
|
}
|
|
489
497
|
applyDataserverData(dataServerResult) {
|
|
@@ -499,19 +507,19 @@ let GridProGenesisDatasource = class GridProGenesisDatasource extends LifecycleM
|
|
|
499
507
|
this.handleSizeChanged(previousSize, this.rowData.size);
|
|
500
508
|
return;
|
|
501
509
|
}
|
|
502
|
-
this.
|
|
510
|
+
this.transactionData = { add: [], remove: [], update: [] };
|
|
503
511
|
this.handleStreamInserts(dataServerResult.inserts);
|
|
504
512
|
this.handleStreamDeletes(dataServerResult.deletes);
|
|
505
513
|
this.handleStreamUpdates(dataServerResult.updates);
|
|
506
|
-
this.
|
|
514
|
+
this.emitDataChanged(this.transactionData);
|
|
507
515
|
this.handleSizeChanged(previousSize, this.rowData.size);
|
|
508
516
|
}
|
|
509
517
|
// FUTURE: Work with the field types vs ag grid column def types!
|
|
510
518
|
getAgColumnDefs(fieldsMetadata) {
|
|
511
519
|
return __awaiter(this, void 0, void 0, function* () {
|
|
512
520
|
const columnDefsFromMetadata = this.generateColumnDefsFromMetadata(fieldsMetadata, getClientSideFilterParamsByFieldType);
|
|
513
|
-
|
|
514
|
-
return
|
|
521
|
+
// Return the base column definitions - the grid will handle merging with template definitions
|
|
522
|
+
return columnDefsFromMetadata;
|
|
515
523
|
});
|
|
516
524
|
}
|
|
517
525
|
setFilter(fieldName, newFilter) {
|
|
@@ -522,11 +530,8 @@ let GridProGenesisDatasource = class GridProGenesisDatasource extends LifecycleM
|
|
|
522
530
|
this.criteriaFromFilters.delete(fieldName);
|
|
523
531
|
this.update.next(this.criteriaFromFilters);
|
|
524
532
|
}
|
|
525
|
-
applyTransaction(
|
|
526
|
-
|
|
527
|
-
}
|
|
528
|
-
applyTransactionAsync(agTransaction, callback) {
|
|
529
|
-
this.agGrid.gridApi.applyTransactionAsync(agTransaction, callback);
|
|
533
|
+
applyTransaction(transaction) {
|
|
534
|
+
this.emitDataChanged(transaction);
|
|
530
535
|
}
|
|
531
536
|
handleSizeChanged(oldSize, newSize) {
|
|
532
537
|
if (oldSize === newSize)
|