@adaptabletools/adaptable-plugin-nocode-aggrid 16.0.7 → 16.0.8-canary.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adaptabletools/adaptable-plugin-nocode-aggrid",
3
- "version": "16.0.7",
3
+ "version": "16.0.8-canary.0",
4
4
  "description": "",
5
5
  "homepage": "http://www.adaptabletools.com/",
6
6
  "author": {
@@ -12,6 +12,6 @@
12
12
  "dependencies": {
13
13
  "tslib": "^2.3.0",
14
14
  "xlsx": "^0.15.5",
15
- "@adaptabletools/adaptable": "16.0.7"
15
+ "@adaptabletools/adaptable": "16.0.8-canary.0"
16
16
  }
17
17
  }
package/src/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { AdaptableOptions, AdaptablePlugin } from '@adaptabletools/adaptable/types';
1
+ import { AdaptableOptions, AdaptablePlugin, AgGridConfig } from '@adaptabletools/adaptable/types';
2
2
  export declare const readJSONFile: (file: File, toJSON?: (str: string) => Promise<any> | any) => Promise<unknown>;
3
3
  export declare const readExcelFile: (file: File) => Promise<any>;
4
4
  interface NoCodePluginOptions {
@@ -17,7 +17,7 @@ declare class NoCodePlugin extends AdaptablePlugin {
17
17
  options: NoCodePluginOptions;
18
18
  pluginId: string;
19
19
  constructor(options?: NoCodePluginOptions);
20
- beforeInit(adaptableOptions: AdaptableOptions): Promise<unknown>;
20
+ beforeInit(adaptableOptions: AdaptableOptions, agGridOptions: AgGridConfig): Promise<unknown>;
21
21
  }
22
22
  declare const _default: (options?: NoCodePluginOptions) => NoCodePlugin;
23
23
  export default _default;
package/src/index.js CHANGED
@@ -68,7 +68,7 @@ class NoCodePlugin extends types_1.AdaptablePlugin {
68
68
  this.pluginId = 'nocode-aggrid';
69
69
  this.options = Object.assign(Object.assign({}, defaultOptions), options);
70
70
  }
71
- beforeInit(adaptableOptions) {
71
+ beforeInit(adaptableOptions, agGridOptions) {
72
72
  const theme = this.options.theme ||
73
73
  (typeof adaptableOptions.predefinedConfig === 'object' &&
74
74
  adaptableOptions.predefinedConfig.Theme &&
@@ -101,7 +101,15 @@ class NoCodePlugin extends types_1.AdaptablePlugin {
101
101
  Object.keys(newAdaptableOptions).forEach((key) => {
102
102
  adaptableOptions[key] = newAdaptableOptions[key];
103
103
  });
104
- adaptableOptions._gridOptions = gridOptions;
104
+ /**
105
+ * Update the gridOptions with the new gridOptions
106
+ */
107
+ if (agGridOptions.gridOptions) {
108
+ Object.assign(agGridOptions.gridOptions, gridOptions);
109
+ }
110
+ else {
111
+ agGridOptions.gridOptions = gridOptions;
112
+ }
105
113
  let onInitResult = Promise.resolve(true);
106
114
  if (this.options.onInit) {
107
115
  onInitResult = this.options.onInit(adaptableOptions);
@@ -116,7 +124,7 @@ class NoCodePlugin extends types_1.AdaptablePlugin {
116
124
  }
117
125
  return null;
118
126
  },
119
- });
127
+ }, agGridOptions);
120
128
  });
121
129
  }
122
130
  }