@nocobase/plugin-charts 1.2.12-alpha → 1.3.0-alpha.20240710084543
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 +2 -2
- package/dist/client/ChartBlockEngine.d.ts +0 -36
- package/dist/client/ChartBlockEngineDesigner.d.ts +0 -12
- package/dist/client/ChartBlockInitializer.d.ts +0 -11
- package/dist/client/ChartQueryBlockInitializer.d.ts +0 -18
- package/dist/client/ChartQueryMetadataProvider.d.ts +0 -18
- package/dist/client/DataSetPreviewTable.d.ts +0 -14
- package/dist/client/Icons.d.ts +0 -9
- package/dist/client/chartRenderComponents/index.d.ts +0 -10
- package/dist/client/hooks/index.d.ts +0 -12
- package/dist/client/index.d.ts +0 -15
- package/dist/client/index.js +0 -53
- package/dist/client/locale/index.d.ts +0 -11
- package/dist/client/select/CustomSelect.d.ts +0 -19
- package/dist/client/select/ReadPretty.d.ts +0 -10
- package/dist/client/select/index.d.ts +0 -10
- package/dist/client/select/shared.d.ts +0 -15
- package/dist/client/settings/AddNewQuery.d.ts +0 -11
- package/dist/client/settings/ConfigureFields.d.ts +0 -10
- package/dist/client/settings/QueriesTable.d.ts +0 -10
- package/dist/client/settings/queryTypes.d.ts +0 -13
- package/dist/client/settings/schemas/chartsQueries.d.ts +0 -16
- package/dist/client/templates/AreaTemplate.d.ts +0 -73
- package/dist/client/templates/BarTemplate.d.ts +0 -88
- package/dist/client/templates/ColumnTemplate.d.ts +0 -88
- package/dist/client/templates/FunnelTemplate.d.ts +0 -74
- package/dist/client/templates/LineTemplate.d.ts +0 -75
- package/dist/client/templates/PieTemplate.d.ts +0 -79
- package/dist/client/templates/RadarTemplate.d.ts +0 -79
- package/dist/client/templates/ScatterTemplate.d.ts +0 -99
- package/dist/client/templates/TableTemplate.d.ts +0 -36
- package/dist/client/templates/index.d.ts +0 -9
- package/dist/client/utils.d.ts +0 -11
- package/dist/externalVersion.js +0 -25
- package/dist/index.d.ts +0 -10
- package/dist/index.js +0 -48
- package/dist/locale/en-US.d.ts +0 -31
- package/dist/locale/en-US.js +0 -53
- package/dist/locale/es-ES.d.ts +0 -61
- package/dist/locale/es-ES.js +0 -83
- package/dist/locale/fr-FR.d.ts +0 -10
- package/dist/locale/fr-FR.js +0 -32
- package/dist/locale/ja-JP.d.ts +0 -10
- package/dist/locale/ja-JP.js +0 -32
- package/dist/locale/ko_KR.d.ts +0 -70
- package/dist/locale/ko_KR.js +0 -92
- package/dist/locale/pt-BR.d.ts +0 -31
- package/dist/locale/pt-BR.js +0 -53
- package/dist/locale/ru-RU.d.ts +0 -10
- package/dist/locale/ru-RU.js +0 -32
- package/dist/locale/tr-TR.d.ts +0 -10
- package/dist/locale/tr-TR.js +0 -32
- package/dist/locale/zh-CN.d.ts +0 -70
- package/dist/locale/zh-CN.js +0 -92
- package/dist/node_modules/json5/dist/index.js +0 -1737
- package/dist/node_modules/json5/dist/index.min.js +0 -1
- package/dist/node_modules/json5/lib/cli.js +0 -152
- package/dist/node_modules/json5/lib/index.d.ts +0 -4
- package/dist/node_modules/json5/lib/index.js +0 -1
- package/dist/node_modules/json5/lib/parse.d.ts +0 -15
- package/dist/node_modules/json5/lib/parse.js +0 -1114
- package/dist/node_modules/json5/lib/register.js +0 -13
- package/dist/node_modules/json5/lib/require.js +0 -4
- package/dist/node_modules/json5/lib/stringify.d.ts +0 -89
- package/dist/node_modules/json5/lib/stringify.js +0 -261
- package/dist/node_modules/json5/lib/unicode.d.ts +0 -3
- package/dist/node_modules/json5/lib/unicode.js +0 -4
- package/dist/node_modules/json5/lib/util.d.ts +0 -5
- package/dist/node_modules/json5/lib/util.js +0 -35
- package/dist/node_modules/json5/package.json +0 -1
- package/dist/server/actions/chartsQueries.d.ts +0 -11
- package/dist/server/actions/chartsQueries.js +0 -95
- package/dist/server/actions/index.d.ts +0 -8
- package/dist/server/actions/index.js +0 -9
- package/dist/server/collections/chartsQueries.d.ts +0 -10
- package/dist/server/collections/chartsQueries.js +0 -56
- package/dist/server/index.d.ts +0 -9
- package/dist/server/index.js +0 -42
- package/dist/server/plugin.d.ts +0 -22
- package/dist/server/plugin.js +0 -98
- package/dist/server/query.d.ts +0 -20
- package/dist/server/query.js +0 -68
- package/dist/server/shared/index.d.ts +0 -10
- package/dist/server/shared/index.js +0 -36
package/dist/server/index.js
DELETED
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file is part of the NocoBase (R) project.
|
|
3
|
-
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
-
* Authors: NocoBase Team.
|
|
5
|
-
*
|
|
6
|
-
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
-
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
var __create = Object.create;
|
|
11
|
-
var __defProp = Object.defineProperty;
|
|
12
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
13
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
14
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
15
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
16
|
-
var __export = (target, all) => {
|
|
17
|
-
for (var name in all)
|
|
18
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
19
|
-
};
|
|
20
|
-
var __copyProps = (to, from, except, desc) => {
|
|
21
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
22
|
-
for (let key of __getOwnPropNames(from))
|
|
23
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
24
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
25
|
-
}
|
|
26
|
-
return to;
|
|
27
|
-
};
|
|
28
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
29
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
30
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
31
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
32
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
33
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
34
|
-
mod
|
|
35
|
-
));
|
|
36
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
37
|
-
var server_exports = {};
|
|
38
|
-
__export(server_exports, {
|
|
39
|
-
default: () => import_plugin.default
|
|
40
|
-
});
|
|
41
|
-
module.exports = __toCommonJS(server_exports);
|
|
42
|
-
var import_plugin = __toESM(require("./plugin"));
|
package/dist/server/plugin.d.ts
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file is part of the NocoBase (R) project.
|
|
3
|
-
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
-
* Authors: NocoBase Team.
|
|
5
|
-
*
|
|
6
|
-
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
-
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
-
*/
|
|
9
|
-
import { InstallOptions, Plugin } from '@nocobase/server';
|
|
10
|
-
export declare class ChartsPlugin extends Plugin {
|
|
11
|
-
syncFields: (instance: any, { transaction }: {
|
|
12
|
-
transaction: any;
|
|
13
|
-
}) => Promise<void>;
|
|
14
|
-
afterAdd(): void;
|
|
15
|
-
beforeLoad(): void;
|
|
16
|
-
load(): Promise<void>;
|
|
17
|
-
install(options?: InstallOptions): Promise<void>;
|
|
18
|
-
afterEnable(): Promise<void>;
|
|
19
|
-
afterDisable(): Promise<void>;
|
|
20
|
-
remove(): Promise<void>;
|
|
21
|
-
}
|
|
22
|
-
export default ChartsPlugin;
|
package/dist/server/plugin.js
DELETED
|
@@ -1,98 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file is part of the NocoBase (R) project.
|
|
3
|
-
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
-
* Authors: NocoBase Team.
|
|
5
|
-
*
|
|
6
|
-
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
-
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
var __create = Object.create;
|
|
11
|
-
var __defProp = Object.defineProperty;
|
|
12
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
13
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
14
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
15
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
16
|
-
var __export = (target, all) => {
|
|
17
|
-
for (var name in all)
|
|
18
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
19
|
-
};
|
|
20
|
-
var __copyProps = (to, from, except, desc) => {
|
|
21
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
22
|
-
for (let key of __getOwnPropNames(from))
|
|
23
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
24
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
25
|
-
}
|
|
26
|
-
return to;
|
|
27
|
-
};
|
|
28
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
29
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
30
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
31
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
32
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
33
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
34
|
-
mod
|
|
35
|
-
));
|
|
36
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
37
|
-
var plugin_exports = {};
|
|
38
|
-
__export(plugin_exports, {
|
|
39
|
-
ChartsPlugin: () => ChartsPlugin,
|
|
40
|
-
default: () => plugin_default
|
|
41
|
-
});
|
|
42
|
-
module.exports = __toCommonJS(plugin_exports);
|
|
43
|
-
var import_server = require("@nocobase/server");
|
|
44
|
-
var import_json5 = __toESM(require("json5"));
|
|
45
|
-
var import_path = require("path");
|
|
46
|
-
var import_chartsQueries = require("./actions/chartsQueries");
|
|
47
|
-
var import_query = require("./query");
|
|
48
|
-
class ChartsPlugin extends import_server.Plugin {
|
|
49
|
-
syncFields = async (instance, { transaction }) => {
|
|
50
|
-
const _data = await import_query.query[instance.type](instance.options, { db: this.db, transaction, validateSQL: true });
|
|
51
|
-
let data;
|
|
52
|
-
if (typeof _data === "string") {
|
|
53
|
-
data = import_json5.default.parse(_data);
|
|
54
|
-
} else {
|
|
55
|
-
data = _data;
|
|
56
|
-
}
|
|
57
|
-
const d = Array.isArray(data) ? data == null ? void 0 : data[0] : data;
|
|
58
|
-
const fields = Object.keys(d || {}).map((f) => {
|
|
59
|
-
return {
|
|
60
|
-
name: f
|
|
61
|
-
};
|
|
62
|
-
});
|
|
63
|
-
instance.set("fields", fields);
|
|
64
|
-
};
|
|
65
|
-
afterAdd() {
|
|
66
|
-
}
|
|
67
|
-
beforeLoad() {
|
|
68
|
-
this.app.db.on("chartsQueries.beforeCreate", this.syncFields);
|
|
69
|
-
this.app.db.on("chartsQueries.beforeUpdate", this.syncFields);
|
|
70
|
-
}
|
|
71
|
-
async load() {
|
|
72
|
-
await this.importCollections((0, import_path.resolve)(__dirname, "collections"));
|
|
73
|
-
this.app.resourcer.registerActionHandlers({
|
|
74
|
-
"chartsQueries:getData": import_chartsQueries.getData,
|
|
75
|
-
"chartsQueries:listMetadata": import_chartsQueries.listMetadata,
|
|
76
|
-
"chartsQueries:validate": import_chartsQueries.validate
|
|
77
|
-
});
|
|
78
|
-
this.app.acl.registerSnippet({
|
|
79
|
-
name: "pm.charts.queries",
|
|
80
|
-
actions: ["chartsQueries:*"]
|
|
81
|
-
});
|
|
82
|
-
this.app.acl.allow("chartsQueries", "getData", "loggedIn");
|
|
83
|
-
this.app.acl.allow("chartsQueries", "listMetadata", "loggedIn");
|
|
84
|
-
}
|
|
85
|
-
async install(options) {
|
|
86
|
-
}
|
|
87
|
-
async afterEnable() {
|
|
88
|
-
}
|
|
89
|
-
async afterDisable() {
|
|
90
|
-
}
|
|
91
|
-
async remove() {
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
var plugin_default = ChartsPlugin;
|
|
95
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
96
|
-
0 && (module.exports = {
|
|
97
|
-
ChartsPlugin
|
|
98
|
-
});
|
package/dist/server/query.d.ts
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file is part of the NocoBase (R) project.
|
|
3
|
-
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
-
* Authors: NocoBase Team.
|
|
5
|
-
*
|
|
6
|
-
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
-
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
-
*/
|
|
9
|
-
import { Database } from '@nocobase/database';
|
|
10
|
-
export declare const query: {
|
|
11
|
-
api: (options: any) => Promise<any[]>;
|
|
12
|
-
json: (options: any) => Promise<any>;
|
|
13
|
-
sql: (options: any, { db, transaction, skipError, validateSQL, }: {
|
|
14
|
-
db: Database;
|
|
15
|
-
transaction?: any;
|
|
16
|
-
skipError?: boolean;
|
|
17
|
-
validateSQL?: boolean;
|
|
18
|
-
}) => Promise<unknown[]>;
|
|
19
|
-
};
|
|
20
|
-
export default query;
|
package/dist/server/query.js
DELETED
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file is part of the NocoBase (R) project.
|
|
3
|
-
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
-
* Authors: NocoBase Team.
|
|
5
|
-
*
|
|
6
|
-
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
-
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
var __defProp = Object.defineProperty;
|
|
11
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
12
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
13
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
14
|
-
var __export = (target, all) => {
|
|
15
|
-
for (var name in all)
|
|
16
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
17
|
-
};
|
|
18
|
-
var __copyProps = (to, from, except, desc) => {
|
|
19
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
20
|
-
for (let key of __getOwnPropNames(from))
|
|
21
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
22
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
23
|
-
}
|
|
24
|
-
return to;
|
|
25
|
-
};
|
|
26
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
27
|
-
var query_exports = {};
|
|
28
|
-
__export(query_exports, {
|
|
29
|
-
default: () => query_default,
|
|
30
|
-
query: () => query
|
|
31
|
-
});
|
|
32
|
-
module.exports = __toCommonJS(query_exports);
|
|
33
|
-
const query = {
|
|
34
|
-
api: async (options) => {
|
|
35
|
-
return [];
|
|
36
|
-
},
|
|
37
|
-
json: async (options) => {
|
|
38
|
-
return options.data || [];
|
|
39
|
-
},
|
|
40
|
-
sql: async (options, {
|
|
41
|
-
db,
|
|
42
|
-
transaction,
|
|
43
|
-
skipError,
|
|
44
|
-
validateSQL
|
|
45
|
-
}) => {
|
|
46
|
-
try {
|
|
47
|
-
const sql = options.sql.trim().split(";").shift();
|
|
48
|
-
if (!sql) {
|
|
49
|
-
throw new Error("SQL is empty");
|
|
50
|
-
}
|
|
51
|
-
if (!/^select/i.test(sql) && !/^with([\s\S]+)select([\s\S]+)/i.test(sql)) {
|
|
52
|
-
throw new Error("Only select query allowed");
|
|
53
|
-
}
|
|
54
|
-
const [data] = await db.sequelize.query(sql, { transaction });
|
|
55
|
-
return data;
|
|
56
|
-
} catch (error) {
|
|
57
|
-
if (skipError) {
|
|
58
|
-
return [];
|
|
59
|
-
}
|
|
60
|
-
throw error;
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
};
|
|
64
|
-
var query_default = query;
|
|
65
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
66
|
-
0 && (module.exports = {
|
|
67
|
-
query
|
|
68
|
-
});
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file is part of the NocoBase (R) project.
|
|
3
|
-
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
-
* Authors: NocoBase Team.
|
|
5
|
-
*
|
|
6
|
-
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
-
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
-
*/
|
|
9
|
-
declare const choicesTypeInterfaceArray: string[];
|
|
10
|
-
export { choicesTypeInterfaceArray };
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file is part of the NocoBase (R) project.
|
|
3
|
-
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
-
* Authors: NocoBase Team.
|
|
5
|
-
*
|
|
6
|
-
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
-
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
var __defProp = Object.defineProperty;
|
|
11
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
12
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
13
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
14
|
-
var __export = (target, all) => {
|
|
15
|
-
for (var name in all)
|
|
16
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
17
|
-
};
|
|
18
|
-
var __copyProps = (to, from, except, desc) => {
|
|
19
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
20
|
-
for (let key of __getOwnPropNames(from))
|
|
21
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
22
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
23
|
-
}
|
|
24
|
-
return to;
|
|
25
|
-
};
|
|
26
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
27
|
-
var shared_exports = {};
|
|
28
|
-
__export(shared_exports, {
|
|
29
|
-
choicesTypeInterfaceArray: () => choicesTypeInterfaceArray
|
|
30
|
-
});
|
|
31
|
-
module.exports = __toCommonJS(shared_exports);
|
|
32
|
-
const choicesTypeInterfaceArray = ["radioGroup", "select"];
|
|
33
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
34
|
-
0 && (module.exports = {
|
|
35
|
-
choicesTypeInterfaceArray
|
|
36
|
-
});
|