@adaptabletools/adaptable-plugin-nocode-aggrid-cjs 22.0.0-canary.1 → 22.0.0-canary.10
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 +1 -1
- package/package.json +1 -1
- package/src/index.d.ts +1 -1
- package/src/index.js +5 -10
package/README.md
CHANGED
|
@@ -11,7 +11,7 @@ It has 2 steps:
|
|
|
11
11
|
|
|
12
12
|
1. The Wizard will read the input file / JSON and list the available columns it contains, together with options for each column to change the DataType, and set editing, filtering, sorting, grouping and other properties.
|
|
13
13
|
|
|
14
|
-
2. Additional (optional) steps allow Users to set up many of the [Adaptable Options](https://www.adaptabletools.com/docs/reference-options
|
|
14
|
+
2. Additional (optional) steps allow Users to set up many of the [Adaptable Options](https://www.adaptabletools.com/docs/technical-reference-adaptable-options) that would normally be configured at design-time, in order to ensure that the AdapTable instance suits their precise requirements, as well as any required AG Grid GridOptions.
|
|
15
15
|
|
|
16
16
|
> The source data must have one column that contains **unique values** which will be set as the Primary Key column (by convention this is the first column).
|
|
17
17
|
|
package/package.json
CHANGED
package/src/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AdaptableOptions, AdaptablePlugin, AgGridConfig } from "@adaptabletools/adaptable-cjs
|
|
1
|
+
import { AdaptableOptions, AdaptablePlugin, AgGridConfig } from "@adaptabletools/adaptable-cjs";
|
|
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 {
|
package/src/index.js
CHANGED
|
@@ -3,19 +3,14 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.readExcelFile = exports.readJSONFile = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const xlsx_1 = require("xlsx");
|
|
6
|
-
const
|
|
7
|
-
const types_1 = require("@adaptabletools/adaptable-cjs/types");
|
|
6
|
+
const adaptable_1 = require("@adaptabletools/adaptable-cjs");
|
|
8
7
|
const package_json_1 = tslib_1.__importDefault(require("../package.json"));
|
|
9
8
|
const package_json_2 = tslib_1.__importDefault(require("@adaptabletools/adaptable-cjs/package.json"));
|
|
10
9
|
const { version, name } = package_json_1.default;
|
|
11
10
|
const { version: coreVersion } = package_json_2.default;
|
|
12
11
|
const suffix = name.endsWith('-cjs') ? '-cjs' : '';
|
|
13
12
|
if (version !== coreVersion) {
|
|
14
|
-
console.warn(`
|
|
15
|
-
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
|
16
|
-
!!!!!!! "@adaptabletools/adaptable-plugin-nocode${suffix}" (v @${version}) and "@adaptabletools/adaptable${suffix}" (v @${coreVersion}) have different versions - they should have the exact same version.
|
|
17
|
-
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
|
18
|
-
`);
|
|
13
|
+
console.warn(`Version mismatch: "@adaptabletools/adaptable-plugin-nocode${suffix}" (v${version}) and "@adaptabletools/adaptable${suffix}" (v${coreVersion}) have different versions. They should be the exact same version.`);
|
|
19
14
|
}
|
|
20
15
|
const readJSONFile = async (file, toJSON) => {
|
|
21
16
|
const reader = new FileReader();
|
|
@@ -65,10 +60,10 @@ const readExcelFile = (file) => {
|
|
|
65
60
|
};
|
|
66
61
|
exports.readExcelFile = readExcelFile;
|
|
67
62
|
const defaultOptions = {};
|
|
68
|
-
class NoCodePlugin extends
|
|
63
|
+
class NoCodePlugin extends adaptable_1.AdaptablePlugin {
|
|
64
|
+
pluginId = 'nocode-aggrid';
|
|
69
65
|
constructor(options) {
|
|
70
66
|
super(options);
|
|
71
|
-
this.pluginId = 'nocode-aggrid';
|
|
72
67
|
this.options = { ...defaultOptions, ...options };
|
|
73
68
|
}
|
|
74
69
|
beforeInit(adaptableOptions, agGridOptions) {
|
|
@@ -83,7 +78,7 @@ class NoCodePlugin extends types_1.AdaptablePlugin {
|
|
|
83
78
|
}
|
|
84
79
|
let isJSON;
|
|
85
80
|
return new Promise((resolve) => {
|
|
86
|
-
new
|
|
81
|
+
new adaptable_1.AdaptableNoCodeWizard(adaptableOptions, {
|
|
87
82
|
fileAccept: '.json,.csv,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/vnd.ms-excel',
|
|
88
83
|
helpText: this.options.headerMessage,
|
|
89
84
|
defaultActionMessage: this.options.actionMessage ||
|