@adaptabletools/adaptable-plugin-nocode-aggrid-cjs 22.0.1 → 22.0.3
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 +1 -1
- package/src/index.d.ts +4 -3
- package/src/index.js +9 -6
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/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 {
|
|
@@ -19,5 +19,6 @@ declare class NoCodePlugin extends AdaptablePlugin {
|
|
|
19
19
|
constructor(options?: NoCodePluginOptions);
|
|
20
20
|
beforeInit(adaptableOptions: AdaptableOptions, agGridOptions: AgGridConfig): Promise<unknown>;
|
|
21
21
|
}
|
|
22
|
-
|
|
23
|
-
export
|
|
22
|
+
export type { NoCodePluginOptions };
|
|
23
|
+
export declare const nocodePlugin: (options?: NoCodePluginOptions) => NoCodePlugin;
|
|
24
|
+
export default nocodePlugin;
|
package/src/index.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.readExcelFile = exports.readJSONFile = void 0;
|
|
3
|
+
exports.nocodePlugin = exports.readExcelFile = exports.readJSONFile = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const xlsx_1 = require("xlsx");
|
|
6
|
-
const
|
|
6
|
+
const types_1 = require("@adaptabletools/adaptable-cjs/types");
|
|
7
|
+
const agGrid_1 = require("@adaptabletools/adaptable-cjs/agGrid");
|
|
7
8
|
const package_json_1 = tslib_1.__importDefault(require("../package.json"));
|
|
8
9
|
const package_json_2 = tslib_1.__importDefault(require("@adaptabletools/adaptable-cjs/package.json"));
|
|
9
10
|
const { version, name } = package_json_1.default;
|
|
@@ -60,7 +61,7 @@ const readExcelFile = (file) => {
|
|
|
60
61
|
};
|
|
61
62
|
exports.readExcelFile = readExcelFile;
|
|
62
63
|
const defaultOptions = {};
|
|
63
|
-
class NoCodePlugin extends
|
|
64
|
+
class NoCodePlugin extends types_1.AdaptablePlugin {
|
|
64
65
|
pluginId = 'nocode-aggrid';
|
|
65
66
|
constructor(options) {
|
|
66
67
|
super(options);
|
|
@@ -74,11 +75,11 @@ class NoCodePlugin extends adaptable_1.AdaptablePlugin {
|
|
|
74
75
|
? adaptableOptions.initialState.Theme.CurrentTheme
|
|
75
76
|
: null);
|
|
76
77
|
if (theme) {
|
|
77
|
-
document.documentElement.classList.add(`ab--theme-${theme}`);
|
|
78
|
+
document.documentElement.classList.add(`ab--theme-${theme}`, `infinite-theme-mode--${theme}`);
|
|
78
79
|
}
|
|
79
80
|
let isJSON;
|
|
80
81
|
return new Promise((resolve) => {
|
|
81
|
-
new
|
|
82
|
+
new agGrid_1.AdaptableNoCodeWizard(adaptableOptions, {
|
|
82
83
|
fileAccept: '.json,.csv,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/vnd.ms-excel',
|
|
83
84
|
helpText: this.options.headerMessage,
|
|
84
85
|
defaultActionMessage: this.options.actionMessage ||
|
|
@@ -126,4 +127,6 @@ class NoCodePlugin extends adaptable_1.AdaptablePlugin {
|
|
|
126
127
|
});
|
|
127
128
|
}
|
|
128
129
|
}
|
|
129
|
-
|
|
130
|
+
const nocodePlugin = (options) => new NoCodePlugin(options);
|
|
131
|
+
exports.nocodePlugin = nocodePlugin;
|
|
132
|
+
exports.default = exports.nocodePlugin;
|