@genesislcap/grid-pro 14.209.0 → 14.209.1-alpha-963e767.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.
Files changed (39) hide show
  1. package/README.md +0 -3
  2. package/dist/custom-elements.json +23 -28
  3. package/dist/dts/cell-renderers/boolean.renderer.d.ts.map +1 -1
  4. package/dist/dts/datasource/base.datasource.d.ts.map +1 -1
  5. package/dist/dts/datasource/server-side.datasource.d.ts.map +1 -1
  6. package/dist/dts/datasource/server-side.resource-base.d.ts +2 -2
  7. package/dist/dts/datasource/server-side.resource-base.d.ts.map +1 -1
  8. package/dist/dts/external/index.d.ts +1 -0
  9. package/dist/dts/external/index.d.ts.map +1 -1
  10. package/dist/dts/grid-pro-genesis-datasource/grid-pro-genesis-datasource.d.ts +0 -4
  11. package/dist/dts/grid-pro-genesis-datasource/grid-pro-genesis-datasource.d.ts.map +1 -1
  12. package/dist/dts/grid-pro.d.ts +15 -23
  13. package/dist/dts/grid-pro.d.ts.map +1 -1
  14. package/dist/dts/grid-pro.template.d.ts.map +1 -1
  15. package/dist/dts/grid-pro.types.d.ts +7 -2
  16. package/dist/dts/grid-pro.types.d.ts.map +1 -1
  17. package/dist/esm/cell-renderers/boolean.renderer.js +6 -7
  18. package/dist/esm/datasource/base.datasource.js +1 -0
  19. package/dist/esm/datasource/server-side.datasource.js +19 -17
  20. package/dist/esm/external/index.js +5 -0
  21. package/dist/esm/grid-pro-genesis-datasource/grid-pro-genesis-datasource.js +16 -13
  22. package/dist/esm/grid-pro.js +34 -27
  23. package/dist/esm/grid-pro.template.js +1 -2
  24. package/dist/esm/grid-pro.types.js +1 -1
  25. package/dist/grid-pro.api.json +47 -73
  26. package/dist/grid-pro.d.ts +21 -27
  27. package/docs/api/grid-pro.agpubliceventtype.md +13 -0
  28. package/docs/api/grid-pro.grid_ready_event.md +1 -1
  29. package/docs/api/grid-pro.gridpro.addeventlistener.md +2 -2
  30. package/docs/api/grid-pro.gridpro.applytemplatedefinitions.md +2 -2
  31. package/docs/api/grid-pro.gridpro.gridapi.md +1 -1
  32. package/docs/api/grid-pro.gridpro.md +2 -4
  33. package/docs/api/grid-pro.gridpro.mergeallcolumndefsandstates.md +2 -2
  34. package/docs/api/grid-pro.gridpro.themechanged.md +2 -2
  35. package/docs/api/grid-pro.md +1 -0
  36. package/docs/api-report.md +11 -13
  37. package/package.json +16 -16
  38. package/docs/api/grid-pro.gridpro.aggrid.md +0 -11
  39. package/docs/api/grid-pro.gridpro.columnapi.md +0 -11
@@ -1,5 +1,4 @@
1
1
  import { __awaiter, __decorate } from "tslib";
2
- import { Events, } from '@ag-grid-community/core';
3
2
  import { dataServerResultFilter, MessageType, normaliseCriteria, toFieldMetadata, } from '@genesislcap/foundation-comms';
4
3
  import { LifecycleMixin } from '@genesislcap/foundation-utils';
5
4
  import { attr, customElement, DOM, observable } from '@microsoft/fast-element';
@@ -80,7 +79,7 @@ let GridProServerSideDatasource = class GridProServerSideDatasource extends Life
80
79
  * @internal
81
80
  */
82
81
  reloadResourceData(params) {
83
- var _a, _b, _c, _d, _e, _f;
82
+ var _a, _b, _c, _d;
84
83
  return __awaiter(this, void 0, void 0, function* () {
85
84
  this.datasource.destroy();
86
85
  (_a = this.liveUpdatesStream) === null || _a === void 0 ? void 0 : _a.unsubscribe();
@@ -92,7 +91,8 @@ let GridProServerSideDatasource = class GridProServerSideDatasource extends Life
92
91
  const initOK = yield this.datasource.init(options, true, false);
93
92
  // this.$emit(gridProGenesisDatasourceEventNames.dataInit);
94
93
  if (!initOK) {
95
- (_b = this.agGrid.gridApi) === null || _b === void 0 ? void 0 : _b.setServerSideDatasource(null);
94
+ // TODO: confirm what changed here!!
95
+ // this.agGrid.gridApi?.setServerSideDatasource(null);
96
96
  logger.error('Genesis Datasource re-init failed on filtering/sorting.');
97
97
  }
98
98
  }
@@ -101,9 +101,10 @@ let GridProServerSideDatasource = class GridProServerSideDatasource extends Life
101
101
  yield this.ssrmDatasource.destroy();
102
102
  this.ssrmDatasource = undefined;
103
103
  }
104
- (_c = this.agGrid.gridApi) === null || _c === void 0 ? void 0 : _c.setServerSideDatasource(null);
105
- (_d = this.agGrid.gridApi) === null || _d === void 0 ? void 0 : _d.refreshServerSide({ purge: true });
106
- (_f = (_e = this.agGrid) === null || _e === void 0 ? void 0 : _e.gridApi) === null || _f === void 0 ? void 0 : _f.showLoadingOverlay();
104
+ // TODO: confirm what changed here!!
105
+ // this.agGrid.gridApi?.setServerSideDatasource(null);
106
+ (_b = this.agGrid.gridApi) === null || _b === void 0 ? void 0 : _b.refreshServerSide({ purge: true });
107
+ (_d = (_c = this.agGrid) === null || _c === void 0 ? void 0 : _c.gridApi) === null || _d === void 0 ? void 0 : _d.showLoadingOverlay();
107
108
  yield this.init();
108
109
  }
109
110
  });
@@ -125,9 +126,9 @@ let GridProServerSideDatasource = class GridProServerSideDatasource extends Life
125
126
  filter: true,
126
127
  resizable: true,
127
128
  sortable: false,
128
- }, pagination: this.pagination, paginationPageSize: this.maxRows, rowBuffer: 0, rowModelType: 'serverSide', suppressServerSideInfiniteScroll: false, suppressMultiSort: true, onFilterChanged: (params) => { }, onSortChanged: (params) => { }, onPaginationChanged: (event) => this.onPaginationChanged(event) }, this.agGrid['agGridOptions']), this.deferredGridOptions);
129
+ }, pagination: this.pagination, paginationPageSize: this.maxRows, paginationPageSizeSelector: false, rowBuffer: 0, rowModelType: 'serverSide', suppressMultiSort: true, onFilterChanged: (params) => { }, onSortChanged: (params) => { }, onPaginationChanged: (event) => this.onPaginationChanged(event) }, this.agGrid['agGridOptions']), this.deferredGridOptions);
129
130
  this.agGrid['initGrid']();
130
- this.agGrid.addEventListener(Events.EVENT_GRID_READY, () => __awaiter(this, void 0, void 0, function* () {
131
+ this.agGrid.addEventListener('gridReady', () => __awaiter(this, void 0, void 0, function* () {
131
132
  const initOK = yield this.datasource.init(this.datasourceOptions(), true, false);
132
133
  if (!initOK) {
133
134
  logger.debug(`Genesis Datasource init failed for ${this.resourceName}`);
@@ -138,7 +139,7 @@ let GridProServerSideDatasource = class GridProServerSideDatasource extends Life
138
139
  this.indexes = this.getResourceIndexes(this.datasource.availableIndexes);
139
140
  const fieldMetadata = toFieldMetadata(this.datasource.originalFieldDef);
140
141
  const agColumnDefs = yield this.getAgColumnDefs(fieldMetadata);
141
- this.agGrid.gridApi.setColumnDefs(agColumnDefs);
142
+ this.agGrid.gridApi.updateGridOptions({ columnDefs: agColumnDefs });
142
143
  if (this.isRequestServer) {
143
144
  this.ssrmDatasource = new ReqRepServerSideDatasource({
144
145
  createReqRepRequestFunc: this.createReqRepRequest.bind(this),
@@ -169,7 +170,7 @@ let GridProServerSideDatasource = class GridProServerSideDatasource extends Life
169
170
  zeroBasedViewNumber: this.zeroBasedViewNumber,
170
171
  });
171
172
  }
172
- this.agGrid.gridApi.setServerSideDatasource(this.ssrmDatasource);
173
+ this.agGrid.gridApi.updateGridOptions({ serverSideDatasource: this.ssrmDatasource });
173
174
  }), { once: true });
174
175
  return;
175
176
  }
@@ -183,7 +184,7 @@ let GridProServerSideDatasource = class GridProServerSideDatasource extends Life
183
184
  }
184
185
  }
185
186
  destroy() {
186
- var _a, _b, _c;
187
+ var _a, _b;
187
188
  return __awaiter(this, void 0, void 0, function* () {
188
189
  this.datasource.destroy();
189
190
  (_a = this.liveUpdatesStream) === null || _a === void 0 ? void 0 : _a.unsubscribe();
@@ -193,8 +194,9 @@ let GridProServerSideDatasource = class GridProServerSideDatasource extends Life
193
194
  yield this.ssrmDatasource.destroy();
194
195
  this.ssrmDatasource = undefined;
195
196
  }
196
- (_b = this.agGrid.gridApi) === null || _b === void 0 ? void 0 : _b.setServerSideDatasource(null);
197
- (_c = this.agGrid.gridApi) === null || _c === void 0 ? void 0 : _c.refreshServerSide({ purge: true });
197
+ // TODO: confirm what changed here!!
198
+ // this.agGrid.gridApi?.setServerSideDatasource(null);
199
+ (_b = this.agGrid.gridApi) === null || _b === void 0 ? void 0 : _b.refreshServerSide({ purge: true });
198
200
  });
199
201
  }
200
202
  restart() {
@@ -204,16 +206,16 @@ let GridProServerSideDatasource = class GridProServerSideDatasource extends Life
204
206
  });
205
207
  }
206
208
  clearRowData(withColumnDefs = true) {
207
- var _a, _b, _c, _d;
209
+ var _a, _b;
208
210
  this.rowData = new Map();
209
211
  if (withColumnDefs) {
210
- (_b = (_a = this.agGrid) === null || _a === void 0 ? void 0 : _a.gridApi) === null || _b === void 0 ? void 0 : _b.setColumnDefs([]);
212
+ this.agGrid.gridApi.updateGridOptions({ columnDefs: [] });
211
213
  }
212
214
  this.agTransaction = { remove: [] };
213
- (_c = this.agGrid.gridApi) === null || _c === void 0 ? void 0 : _c.forEachNode((node) => {
215
+ (_a = this.agGrid.gridApi) === null || _a === void 0 ? void 0 : _a.forEachNode((node) => {
214
216
  this.agTransaction.remove.push(node.data);
215
217
  });
216
- (_d = this.agGrid.gridApi) === null || _d === void 0 ? void 0 : _d.applyServerSideTransaction(this.agTransaction);
218
+ (_b = this.agGrid.gridApi) === null || _b === void 0 ? void 0 : _b.applyServerSideTransaction(this.agTransaction);
217
219
  this.agTransaction = undefined;
218
220
  }
219
221
  getResourceIndexes(avaialbleIndexes) {
@@ -8,6 +8,7 @@ export * from './fonts';
8
8
  /**
9
9
  * All External AG Grid Stock in one CSS.
10
10
  * @remarks This is a collection of multiple AG themes, only needed if the target element needs more than one stock theme.
11
+ * @privateRemarks See https://github.com/ag-grid/ag-grid/issues/7324 about the viewport scrollbar.
11
12
  * @public
12
13
  */
13
14
  export const agExternalStockStyles = css `
@@ -16,6 +17,10 @@ export const agExternalStockStyles = css `
16
17
  ${agThemeAlpineNofontsCSS}
17
18
  ${agThemeBalhamNofontsCSS}
18
19
  ${agThemeMaterialNofontsCSS}
20
+ .ag-body-viewport::-webkit-scrollbar,
21
+ .ag-center-cols-viewport::-webkit-scrollbar {
22
+ display: none !important;
23
+ }
19
24
  `;
20
25
  /**
21
26
  * All available External AG Grid Stock CSS.
@@ -1,5 +1,4 @@
1
1
  import { __awaiter, __decorate } from "tslib";
2
- import { Events, } from '@ag-grid-community/core';
3
2
  import { MessageType, dataServerResultFilter, normaliseCriteria, } from '@genesislcap/foundation-comms';
4
3
  import { LifecycleMixin } from '@genesislcap/foundation-utils';
5
4
  import { DOM, attr, customElement } from '@microsoft/fast-element';
@@ -121,9 +120,9 @@ let GridProGenesisDatasource = class GridProGenesisDatasource extends LifecycleM
121
120
  const gridOptions = Object.assign(Object.assign(Object.assign({ getRowId: (params) => params.data[this.rowId] }, (columnDefinitions && { columnDefs: columnDefinitions })), this.agGrid['agGridOptions']), this.deferredGridOptions);
122
121
  this.agGrid.gridOptions = Object.assign({}, gridOptions);
123
122
  this.agGrid['initGrid']();
124
- this.agGrid.addEventListener(Events.EVENT_GRID_READY, () => __awaiter(this, void 0, void 0, function* () {
123
+ this.agGrid.addEventListener('gridReady', () => __awaiter(this, void 0, void 0, function* () {
125
124
  if (columnStates) {
126
- this.agGrid.columnApi.applyColumnState({ state: columnStates });
125
+ this.agGrid.gridApi.applyColumnState({ state: columnStates });
127
126
  }
128
127
  yield this.loadResourceData();
129
128
  }), { once: true });
@@ -192,7 +191,7 @@ let GridProGenesisDatasource = class GridProGenesisDatasource extends LifecycleM
192
191
  let columnStates;
193
192
  if (this.keepColDefsOnClearRowData) {
194
193
  columnDefinitions = this.agGrid.gridApi.getColumnDefs();
195
- columnStates = this.agGrid.columnApi.getColumnState();
194
+ columnStates = this.agGrid.gridApi.getColumnState();
196
195
  }
197
196
  this.destroy();
198
197
  this.init(columnDefinitions, columnStates);
@@ -210,13 +209,12 @@ let GridProGenesisDatasource = class GridProGenesisDatasource extends LifecycleM
210
209
  * @internal
211
210
  */
212
211
  clearRowData(withColumnDefs = true) {
213
- var _a, _b, _c, _d;
214
212
  this.rowData = new Map();
215
213
  this.agTransaction = undefined;
216
214
  if (withColumnDefs && !this.keepColDefsOnClearRowData) {
217
- (_b = (_a = this.agGrid) === null || _a === void 0 ? void 0 : _a.gridApi) === null || _b === void 0 ? void 0 : _b.setColumnDefs([]);
215
+ this.agGrid.gridApi.updateGridOptions({ columnDefs: [] });
218
216
  }
219
- (_d = (_c = this.agGrid) === null || _c === void 0 ? void 0 : _c.gridApi) === null || _d === void 0 ? void 0 : _d.setRowData([]);
217
+ this.agGrid.gridApi.updateGridOptions({ rowData: [] });
220
218
  }
221
219
  /**
222
220
  * Sets the columnDefs and rowData for the grid.
@@ -241,12 +239,18 @@ let GridProGenesisDatasource = class GridProGenesisDatasource extends LifecycleM
241
239
  col.pivot = null;
242
240
  }
243
241
  });
244
- this.agGrid.gridApi.setColumnDefs(agColumnDefs);
242
+ this.agGrid.gridApi.updateGridOptions({ columnDefs: agColumnDefs });
245
243
  }
246
244
  }
247
245
  const data = this.rowDataMapper ? this.rowDataMapper(rowData) : rowData;
248
246
  this.agGrid.restoreCachedFilterConfig();
249
- this.agTransaction = { add: data ? [...data] : [], remove: [], update: [], addIndex: 0 };
247
+ this.agTransaction = {
248
+ add: data ? [...data] : [],
249
+ remove: [],
250
+ update: [],
251
+ addIndex: this.agGrid.addIndex,
252
+ };
253
+ // this.agGrid.gridApi.setGridOption('rowData', data);
250
254
  this.applyAllAgTransactions();
251
255
  this.requiresFullRowDataAndColDefs = false;
252
256
  });
@@ -258,7 +262,6 @@ let GridProGenesisDatasource = class GridProGenesisDatasource extends LifecycleM
258
262
  * @internal
259
263
  */
260
264
  reloadResourceData() {
261
- var _a, _b;
262
265
  return __awaiter(this, void 0, void 0, function* () {
263
266
  logger.debug('GridProGenesisDatasource.reloadResourceData()', this.resourceName);
264
267
  if (this.dataSub) {
@@ -266,7 +269,7 @@ let GridProGenesisDatasource = class GridProGenesisDatasource extends LifecycleM
266
269
  this.dataSub = undefined;
267
270
  }
268
271
  this.clearRowData(withoutColumnDefs);
269
- (_b = (_a = this.agGrid) === null || _a === void 0 ? void 0 : _a.gridApi) === null || _b === void 0 ? void 0 : _b.showLoadingOverlay();
272
+ this.agGrid.gridApi.setGridOption('loading', true);
270
273
  this.agGrid.removeAttribute('ds-disconnected');
271
274
  this.loadResourceData(withoutFullInit);
272
275
  });
@@ -421,7 +424,7 @@ let GridProGenesisDatasource = class GridProGenesisDatasource extends LifecycleM
421
424
  return true; // delete rows that don't exist in requestServerData
422
425
  });
423
426
  const rowsToInsert = requestServerData.filter((data) => !this.rowData.has(data[this.rowId]));
424
- this.agTransaction = { add: [], remove: [], update: [] };
427
+ this.agTransaction = { add: [], remove: [], update: [], addIndex: this.agGrid.addIndex };
425
428
  this.handleStreamInserts(rowsToInsert);
426
429
  this.handleStreamDeletes(rowsToDelete);
427
430
  this.handleStreamUpdates(rowsToUpdate);
@@ -440,7 +443,7 @@ let GridProGenesisDatasource = class GridProGenesisDatasource extends LifecycleM
440
443
  this.handleSizeChanged(previousSize, this.rowData.size);
441
444
  return;
442
445
  }
443
- this.agTransaction = { add: [], remove: [], update: [] };
446
+ this.agTransaction = { add: [], remove: [], update: [], addIndex: this.agGrid.addIndex };
444
447
  this.handleStreamInserts(dataServerResult.inserts);
445
448
  this.handleStreamDeletes(dataServerResult.deletes);
446
449
  this.handleStreamUpdates(dataServerResult.updates);
@@ -1,9 +1,9 @@
1
1
  import { __awaiter, __decorate, __rest } from "tslib";
2
2
  import { ClientSideRowModelModule } from '@ag-grid-community/client-side-row-model';
3
- import { ComponentUtil, Events, Grid, ModuleRegistry } from '@ag-grid-community/core';
3
+ import { _combineAttributesAndGridOptions, createGrid, ComponentUtil, ModuleRegistry, } from '@ag-grid-community/core';
4
4
  import { CsvExportModule } from '@ag-grid-community/csv-export';
5
5
  import { insertDocumentCSSRule, LifecycleMixin, respondToVisibility, } from '@genesislcap/foundation-utils';
6
- import { attr, DOM, observable } from '@microsoft/fast-element';
6
+ import { attr, DOM, observable, volatile } from '@microsoft/fast-element';
7
7
  import { FoundationElement } from '@microsoft/fast-foundation';
8
8
  import { classNames } from '@microsoft/fast-web-utilities';
9
9
  import * as changeCase from 'change-case';
@@ -42,12 +42,29 @@ export const AG_PROPERTIES = ComponentUtil.ALL_PROPERTIES.filter((p) => p !== 'r
42
42
  * @tagname %%prefix%%-grid-pro
43
43
  */
44
44
  export class GridPro extends LifecycleMixin(FoundationElement) {
45
+ get gridApi() {
46
+ if (!this.initialised) {
47
+ // Return a proxy object to intercept property accesses
48
+ return new Proxy({}, {
49
+ get: () => {
50
+ return () => {
51
+ return {
52
+ destroy: () => {
53
+ // do nothing
54
+ },
55
+ };
56
+ };
57
+ },
58
+ });
59
+ }
60
+ return this._gridApi;
61
+ }
45
62
  rowDataChanged(_, rowData) {
46
63
  if (this.initialised) {
47
- this.gridApi.setRowData(rowData);
64
+ this.gridApi.setGridOption('rowData', rowData);
48
65
  }
49
66
  }
50
- themeChanged(oldValue, newValue) {
67
+ themeChanged(_oldValue, newValue) {
51
68
  if (!newValue) {
52
69
  this.classNames = '';
53
70
  this.destroyFontFace();
@@ -140,11 +157,9 @@ export class GridPro extends LifecycleMixin(FoundationElement) {
140
157
  }
141
158
  /**
142
159
  * Adds an event listener to the grid element.
143
- * @param eventType - The event type to listen for. Recommened to use the `Events` from AG Grid.
160
+ * @param eventType - The event type to listen for.
144
161
  * @param listener - The event listener to call when the event is fired.
145
162
  * @param options - An options object that specifies characteristics about the event listener.
146
- * @privateRemarks
147
- * This will change once we do the AG Upgrade and `eventType` will be correctly typed.
148
163
  */
149
164
  addEventListener(eventType, listener, options) {
150
165
  super.addEventListener(eventType, listener, options);
@@ -255,7 +270,7 @@ export class GridPro extends LifecycleMixin(FoundationElement) {
255
270
  saveColumnState() {
256
271
  return __awaiter(this, void 0, void 0, function* () {
257
272
  if (this.rehydrationAttempted && this.statePersistanceEnabled()) {
258
- let colState = this.columnApi.getColumnState();
273
+ let colState = this.gridApi.getColumnState();
259
274
  colState = this.gridAutosizingEnabled
260
275
  ? this.removeConfigWidthsToAutosize(colState)
261
276
  : colState;
@@ -268,7 +283,7 @@ export class GridPro extends LifecycleMixin(FoundationElement) {
268
283
  /**
269
284
  * Gets the saved grid ColumnState[] from storage
270
285
  * @remarks This is used to restore the grid state when the grid is rehydrated
271
- * @privateRemarks Not using `columnApi.get|setColumnState()` for these flows as it doesn't work setting new columnDefs vs different ordering.
286
+ * @privateRemarks Not using `gridApi.get|setColumnState()` for these flows as it doesn't work setting new columnDefs vs different ordering.
272
287
  * @public
273
288
  */
274
289
  getSavedColumnState() {
@@ -286,7 +301,7 @@ export class GridPro extends LifecycleMixin(FoundationElement) {
286
301
  this.rehydrationAttempted = true;
287
302
  const colState = yield this.getSavedColumnState();
288
303
  if (colState && colState.length > 0) {
289
- (_a = this.columnApi) === null || _a === void 0 ? void 0 : _a.applyColumnState({
304
+ (_a = this.gridApi) === null || _a === void 0 ? void 0 : _a.applyColumnState({
290
305
  state: colState,
291
306
  applyOrder: true,
292
307
  });
@@ -346,21 +361,18 @@ export class GridPro extends LifecycleMixin(FoundationElement) {
346
361
  });
347
362
  const { columnDefs, components, defaultColDef, getRowId, onGridReady, onFilterChanged } = options, rest = __rest(options, ["columnDefs", "components", "defaultColDef", "getRowId", "onGridReady", "onFilterChanged"]);
348
363
  const derivedOptions = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, this.gridOptionsConfig), { defaultColDef: Object.assign({ enableCellChangeFlash: this.enableCellFlashing, filter: true, resizable: true, sortable: true }, defaultColDef), components: this.combineAllGridComponents(components), suppressDragLeaveHidesColumns: true }), this.eventsAndCallbacks), { onGridReady: (event) => {
349
- var _a, _b;
350
- this.gridApi = (_a = options.api) !== null && _a !== void 0 ? _a : event.api;
351
- this.columnApi = (_b = options.columnApi) !== null && _b !== void 0 ? _b : event.columnApi;
352
364
  if (this.gridEventsQueue.length) {
353
365
  this.gridEventsQueue.forEach((type) => {
354
366
  this.addGridEventListener(type);
355
367
  });
356
368
  }
357
369
  if (this.rowData) {
358
- this.gridApi.setRowData(this.rowData);
370
+ this.gridApi.setGridOption('rowData', this.rowData);
359
371
  }
360
372
  if (onGridReady) {
361
373
  onGridReady(event);
362
374
  }
363
- this.$emit(Events.EVENT_GRID_READY, {
375
+ this.$emit('gridReady', {
364
376
  event,
365
377
  gridId: this.id,
366
378
  });
@@ -392,7 +404,7 @@ export class GridPro extends LifecycleMixin(FoundationElement) {
392
404
  }
393
405
  }
394
406
  setLocalGridOptions(derivedOptions) {
395
- this.agGridOptions = Object.assign(Object.assign({}, this.agGridOptions), ComponentUtil.copyAttributesToGridOptions(derivedOptions, this.agAttributes));
407
+ this.agGridOptions = Object.assign(Object.assign({}, this.agGridOptions), _combineAttributesAndGridOptions(derivedOptions, this.agAttributes));
396
408
  }
397
409
  initGrid() {
398
410
  DOM.queueUpdate(() => {
@@ -403,7 +415,7 @@ export class GridPro extends LifecycleMixin(FoundationElement) {
403
415
  this.gridSlot.removeChild(this.gridSlot.firstChild);
404
416
  }
405
417
  }
406
- this.agGrid = new Grid(this.gridSlot, this.agGridOptions, this.gridParams);
418
+ this._gridApi = createGrid(this.gridSlot, this.agGridOptions);
407
419
  this.initialised = true;
408
420
  });
409
421
  }
@@ -517,7 +529,8 @@ export class GridPro extends LifecycleMixin(FoundationElement) {
517
529
  // for subsequent (post gridOptions) changes
518
530
  const changeObject = {};
519
531
  changeObject[gridPropertyName] = { currentValue: newValue };
520
- ComponentUtil.processOnChange(changeObject, this.gridApi);
532
+ // TODO: find alternative?
533
+ // ComponentUtil.processOnChange(changeObject, this.gridApi);
521
534
  }
522
535
  }
523
536
  }
@@ -549,18 +562,15 @@ export class GridPro extends LifecycleMixin(FoundationElement) {
549
562
  }
550
563
  }
551
564
  }
552
- __decorate([
553
- observable
554
- ], GridPro.prototype, "columnApi", void 0);
555
- __decorate([
556
- observable
557
- ], GridPro.prototype, "gridApi", void 0);
558
565
  __decorate([
559
566
  observable
560
567
  ], GridPro.prototype, "gridErrorItems", void 0);
561
568
  __decorate([
562
569
  StatePersistence
563
570
  ], GridPro.prototype, "statePersistence", void 0);
571
+ __decorate([
572
+ volatile
573
+ ], GridPro.prototype, "gridApi", null);
564
574
  __decorate([
565
575
  attr({ attribute: 'auto-cell-renderer-by-type', mode: 'boolean' })
566
576
  ], GridPro.prototype, "autoCellRendererByType", void 0);
@@ -624,9 +634,6 @@ __decorate([
624
634
  __decorate([
625
635
  observable
626
636
  ], GridPro.prototype, "classNames", void 0);
627
- __decorate([
628
- observable
629
- ], GridPro.prototype, "agGrid", void 0);
630
637
  __decorate([
631
638
  observable
632
639
  ], GridPro.prototype, "gridSlot", void 0);
@@ -9,8 +9,7 @@ import { gridProErrorNames } from './grid-pro.definitions';
9
9
  export const getGridProTemplate = (prefix = 'foundation') => html `
10
10
  <template>
11
11
  <span part="grid" class="${(x) => x.classNames}">
12
- <slot name="grid" ${ref('gridSlot')}></slot>
13
- <slot></slot>
12
+ <div ${ref('gridSlot')} style="width: 100%; height: 100%">
14
13
  </span>
15
14
  <slot
16
15
  name="grid-datasource-error"
@@ -142,7 +142,7 @@ export var GridProRendererTypes;
142
142
  * @privateRemarks
143
143
  * This will be removed when we do the AG Upgrade.
144
144
  */
145
- export const GRID_READY_EVENT = 'onGridReady';
145
+ export const GRID_READY_EVENT = 'gridReady';
146
146
  /**
147
147
  * Key used to store currently edited column when it being synced with server side data
148
148
  * @public
@@ -2214,6 +2214,41 @@
2214
2214
  "endIndex": 3
2215
2215
  }
2216
2216
  },
2217
+ {
2218
+ "kind": "TypeAlias",
2219
+ "canonicalReference": "@genesislcap/grid-pro!AgPublicEventType:type",
2220
+ "docComment": "/**\n * All the public AG Grid events\n *\n * @public\n */\n",
2221
+ "excerptTokens": [
2222
+ {
2223
+ "kind": "Content",
2224
+ "text": "export type AgPublicEventType = "
2225
+ },
2226
+ {
2227
+ "kind": "Content",
2228
+ "text": "(typeof "
2229
+ },
2230
+ {
2231
+ "kind": "Reference",
2232
+ "text": "ComponentUtil.PUBLIC_EVENTS",
2233
+ "canonicalReference": "@ag-grid-community/core!ComponentUtil.PUBLIC_EVENTS:member"
2234
+ },
2235
+ {
2236
+ "kind": "Content",
2237
+ "text": ")[number]"
2238
+ },
2239
+ {
2240
+ "kind": "Content",
2241
+ "text": ";"
2242
+ }
2243
+ ],
2244
+ "fileUrlPath": "src/grid-pro.types.ts",
2245
+ "releaseTag": "Public",
2246
+ "name": "AgPublicEventType",
2247
+ "typeTokenRange": {
2248
+ "startIndex": 1,
2249
+ "endIndex": 4
2250
+ }
2251
+ },
2217
2252
  {
2218
2253
  "kind": "Variable",
2219
2254
  "canonicalReference": "@genesislcap/grid-pro!agSelectEditorStyles:var",
@@ -7507,7 +7542,7 @@
7507
7542
  },
7508
7543
  {
7509
7544
  "kind": "Content",
7510
- "text": "\"onGridReady\""
7545
+ "text": "\"gridReady\""
7511
7546
  }
7512
7547
  ],
7513
7548
  "fileUrlPath": "src/grid-pro.types.ts",
@@ -7623,15 +7658,16 @@
7623
7658
  {
7624
7659
  "kind": "Method",
7625
7660
  "canonicalReference": "@genesislcap/grid-pro!GridPro#addEventListener:member(1)",
7626
- "docComment": "/**\n * Adds an event listener to the grid element.\n *\n * @param eventType - The event type to listen for. Recommened to use the `Events` from AG Grid.\n *\n * @param listener - The event listener to call when the event is fired.\n *\n * @param options - An options object that specifies characteristics about the event listener.\n */\n",
7661
+ "docComment": "/**\n * Adds an event listener to the grid element.\n *\n * @param eventType - The event type to listen for.\n *\n * @param listener - The event listener to call when the event is fired.\n *\n * @param options - An options object that specifies characteristics about the event listener.\n */\n",
7627
7662
  "excerptTokens": [
7628
7663
  {
7629
7664
  "kind": "Content",
7630
7665
  "text": "addEventListener(eventType: "
7631
7666
  },
7632
7667
  {
7633
- "kind": "Content",
7634
- "text": "string"
7668
+ "kind": "Reference",
7669
+ "text": "AgPublicEventType",
7670
+ "canonicalReference": "@genesislcap/grid-pro!AgPublicEventType:type"
7635
7671
  },
7636
7672
  {
7637
7673
  "kind": "Content",
@@ -7850,37 +7886,6 @@
7850
7886
  "isProtected": true,
7851
7887
  "isAbstract": false
7852
7888
  },
7853
- {
7854
- "kind": "Property",
7855
- "canonicalReference": "@genesislcap/grid-pro!GridPro#agGrid:member",
7856
- "docComment": "",
7857
- "excerptTokens": [
7858
- {
7859
- "kind": "Content",
7860
- "text": "agGrid: "
7861
- },
7862
- {
7863
- "kind": "Reference",
7864
- "text": "Grid",
7865
- "canonicalReference": "@ag-grid-community/core!Grid:class"
7866
- },
7867
- {
7868
- "kind": "Content",
7869
- "text": ";"
7870
- }
7871
- ],
7872
- "isReadonly": false,
7873
- "isOptional": false,
7874
- "releaseTag": "Public",
7875
- "name": "agGrid",
7876
- "propertyTypeTokenRange": {
7877
- "startIndex": 1,
7878
- "endIndex": 2
7879
- },
7880
- "isStatic": false,
7881
- "isProtected": false,
7882
- "isAbstract": false
7883
- },
7884
7889
  {
7885
7890
  "kind": "Property",
7886
7891
  "canonicalReference": "@genesislcap/grid-pro!GridPro#agGridOptions:member",
@@ -7993,7 +7998,7 @@
7993
7998
  },
7994
7999
  {
7995
8000
  "kind": "Content",
7996
- "text": "<any>[]>"
8001
+ "text": "<any, any>[]>"
7997
8002
  },
7998
8003
  {
7999
8004
  "kind": "Content",
@@ -8180,37 +8185,6 @@
8180
8185
  "isProtected": false,
8181
8186
  "isAbstract": false
8182
8187
  },
8183
- {
8184
- "kind": "Property",
8185
- "canonicalReference": "@genesislcap/grid-pro!GridPro#columnApi:member",
8186
- "docComment": "",
8187
- "excerptTokens": [
8188
- {
8189
- "kind": "Content",
8190
- "text": "columnApi: "
8191
- },
8192
- {
8193
- "kind": "Reference",
8194
- "text": "ColumnApi",
8195
- "canonicalReference": "@ag-grid-community/core!ColumnApi:class"
8196
- },
8197
- {
8198
- "kind": "Content",
8199
- "text": ";"
8200
- }
8201
- ],
8202
- "isReadonly": false,
8203
- "isOptional": false,
8204
- "releaseTag": "Public",
8205
- "name": "columnApi",
8206
- "propertyTypeTokenRange": {
8207
- "startIndex": 1,
8208
- "endIndex": 2
8209
- },
8210
- "isStatic": false,
8211
- "isProtected": false,
8212
- "isAbstract": false
8213
- },
8214
8188
  {
8215
8189
  "kind": "Property",
8216
8190
  "canonicalReference": "@genesislcap/grid-pro!GridPro#columnComponentName:member",
@@ -8626,19 +8600,19 @@
8626
8600
  "excerptTokens": [
8627
8601
  {
8628
8602
  "kind": "Content",
8629
- "text": "gridApi: "
8603
+ "text": "get gridApi(): "
8630
8604
  },
8631
8605
  {
8632
8606
  "kind": "Reference",
8633
8607
  "text": "GridApi",
8634
- "canonicalReference": "@ag-grid-community/core!GridApi:class"
8608
+ "canonicalReference": "@ag-grid-community/core!GridApi:interface"
8635
8609
  },
8636
8610
  {
8637
8611
  "kind": "Content",
8638
8612
  "text": ";"
8639
8613
  }
8640
8614
  ],
8641
- "isReadonly": false,
8615
+ "isReadonly": true,
8642
8616
  "isOptional": false,
8643
8617
  "releaseTag": "Public",
8644
8618
  "name": "gridApi",
@@ -9134,7 +9108,7 @@
9134
9108
  },
9135
9109
  {
9136
9110
  "kind": "Content",
9137
- "text": "<any>[]>"
9111
+ "text": "<any, any>[]>"
9138
9112
  },
9139
9113
  {
9140
9114
  "kind": "Content",
@@ -9603,7 +9577,7 @@
9603
9577
  "excerptTokens": [
9604
9578
  {
9605
9579
  "kind": "Content",
9606
- "text": "themeChanged(oldValue: "
9580
+ "text": "themeChanged(_oldValue: "
9607
9581
  },
9608
9582
  {
9609
9583
  "kind": "Content",
@@ -9640,7 +9614,7 @@
9640
9614
  "overloadIndex": 1,
9641
9615
  "parameters": [
9642
9616
  {
9643
- "parameterName": "oldValue",
9617
+ "parameterName": "_oldValue",
9644
9618
  "parameterTypeTokenRange": {
9645
9619
  "startIndex": 1,
9646
9620
  "endIndex": 2