@adaptabletools/adaptable-plugin-nocode-aggrid 12.2.3 → 13.0.0-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.
Files changed (2) hide show
  1. package/package.json +3 -6
  2. package/src/index.js +6 -6
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adaptabletools/adaptable-plugin-nocode-aggrid",
3
- "version": "12.2.3",
3
+ "version": "13.0.0-canary.0",
4
4
  "description": "",
5
5
  "homepage": "http://www.adaptabletools.com/",
6
6
  "author": {
@@ -10,11 +10,8 @@
10
10
  "main": "src/index.js",
11
11
  "typings": "src/index.d.ts",
12
12
  "dependencies": {
13
- "tslib": "^2.0.0",
13
+ "tslib": "^2.3.0",
14
14
  "xlsx": "^0.15.5",
15
- "@adaptabletools/adaptable": "12.2.3"
16
- },
17
- "peerDependencies": {
18
- "@ag-grid-community/all-modules": ">=27.3.0"
15
+ "@adaptabletools/adaptable": "13.0.0-canary.0"
19
16
  }
20
17
  }
package/src/index.js CHANGED
@@ -7,6 +7,7 @@ const agGrid_1 = require("@adaptabletools/adaptable/agGrid");
7
7
  const types_1 = require("@adaptabletools/adaptable/types");
8
8
  const package_json_1 = require("../package.json");
9
9
  const version_1 = tslib_1.__importDefault(require("@adaptabletools/adaptable/version"));
10
+ const core_1 = require("@ag-grid-community/core");
10
11
  if (package_json_1.version !== version_1.default) {
11
12
  console.warn(`
12
13
  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
@@ -40,7 +41,7 @@ const readExcelFile = (file) => {
40
41
  const asBinary = !!reader.readAsBinaryString;
41
42
  return new Promise((resolve, reject) => {
42
43
  reader.onload = (e) => {
43
- const wb = xlsx_1.read(e.target.result, {
44
+ const wb = (0, xlsx_1.read)(e.target.result, {
44
45
  type: asBinary ? 'binary' : 'array',
45
46
  cellDates: true,
46
47
  });
@@ -80,6 +81,8 @@ class NoCodePlugin extends types_1.AdaptablePlugin {
80
81
  document.documentElement.classList.add(`ab--theme-${theme}`);
81
82
  }
82
83
  let isJSON;
84
+ // the AG Grid modules were registered previously by the main Adaptable instance (IMPORTANT: this is relevant only for Vanilla NoCode version)
85
+ const agGridModules = core_1.ModuleRegistry.getRegisteredModules();
83
86
  return new Promise((resolve) => {
84
87
  new agGrid_1.AdaptableNoCodeWizard(adaptableOptions, {
85
88
  fileAccept: '.json,.csv,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/vnd.ms-excel',
@@ -94,18 +97,15 @@ class NoCodePlugin extends types_1.AdaptablePlugin {
94
97
  readFile: (file) => {
95
98
  isJSON = (file.type && file.type.indexOf('json')) != -1 || file.name.endsWith('.json');
96
99
  if (isJSON) {
97
- return exports.readJSONFile(file);
100
+ return (0, exports.readJSONFile)(file);
98
101
  }
99
- return exports.readExcelFile(file);
102
+ return (0, exports.readExcelFile)(file);
100
103
  },
101
104
  onInit: ({ gridOptions, adaptableOptions: newAdaptableOptions }) => {
102
105
  Object.keys(newAdaptableOptions).forEach((key) => {
103
106
  adaptableOptions[key] = newAdaptableOptions[key];
104
107
  });
105
108
  adaptableOptions.gridOptions = gridOptions;
106
- if (this.options.modules) {
107
- adaptableOptions.modules = this.options.modules;
108
- }
109
109
  let onInitResult = Promise.resolve(true);
110
110
  if (this.options.onInit) {
111
111
  onInitResult = this.options.onInit(adaptableOptions);