@nocobase/plugin-charts 0.13.0-alpha.3 → 0.13.0-alpha.5
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/dist/client/index.js +24 -3214
- package/dist/index.js +37 -16
- package/dist/locale/en-US.js +22 -4
- package/dist/locale/es-ES.js +22 -4
- package/dist/locale/fr-FR.js +22 -4
- package/dist/locale/ja-JP.js +22 -4
- package/dist/locale/pt-BR.js +22 -4
- package/dist/locale/ru-RU.js +22 -4
- package/dist/locale/tr-TR.js +22 -4
- package/dist/locale/zh-CN.js +22 -4
- package/dist/node_modules/json5/lib/index.js +1 -1
- package/dist/node_modules/json5/package.json +1 -1
- package/dist/server/actions/chartsQueries.js +45 -16
- package/dist/server/actions/index.js +0 -2
- package/dist/server/collections/chartsQueries.js +24 -7
- package/dist/server/index.js +33 -11
- package/dist/server/plugin.js +49 -24
- package/dist/server/query.js +27 -7
- package/dist/server/shared/index.js +26 -4
- package/package.json +2 -2
package/dist/server/index.js
CHANGED
|
@@ -1,11 +1,33 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
var
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
+
mod
|
|
26
|
+
));
|
|
27
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
+
var server_exports = {};
|
|
29
|
+
__export(server_exports, {
|
|
30
|
+
default: () => import_plugin.default
|
|
31
|
+
});
|
|
32
|
+
module.exports = __toCommonJS(server_exports);
|
|
33
|
+
var import_plugin = __toESM(require("./plugin"));
|
package/dist/server/plugin.js
CHANGED
|
@@ -1,23 +1,47 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var
|
|
6
|
-
var
|
|
7
|
-
var
|
|
8
|
-
var
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
+
mod
|
|
26
|
+
));
|
|
27
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
+
var plugin_exports = {};
|
|
29
|
+
__export(plugin_exports, {
|
|
30
|
+
ChartsPlugin: () => ChartsPlugin,
|
|
31
|
+
default: () => plugin_default
|
|
32
|
+
});
|
|
33
|
+
module.exports = __toCommonJS(plugin_exports);
|
|
34
|
+
var import_server = require("@nocobase/server");
|
|
35
|
+
var import_json5 = __toESM(require("json5"));
|
|
36
|
+
var import_path = require("path");
|
|
37
|
+
var import_chartsQueries = require("./actions/chartsQueries");
|
|
38
|
+
var import_query = require("./query");
|
|
39
|
+
class ChartsPlugin extends import_server.Plugin {
|
|
16
40
|
syncFields = async (instance, { transaction }) => {
|
|
17
|
-
const _data = await
|
|
41
|
+
const _data = await import_query.query[instance.type](instance.options, { db: this.db, transaction, validateSQL: true });
|
|
18
42
|
let data;
|
|
19
43
|
if (typeof _data === "string") {
|
|
20
|
-
data =
|
|
44
|
+
data = import_json5.default.parse(_data);
|
|
21
45
|
} else {
|
|
22
46
|
data = _data;
|
|
23
47
|
}
|
|
@@ -37,12 +61,12 @@ class ChartsPlugin extends server.Plugin {
|
|
|
37
61
|
}
|
|
38
62
|
async load() {
|
|
39
63
|
await this.db.import({
|
|
40
|
-
directory:
|
|
64
|
+
directory: (0, import_path.resolve)(__dirname, "collections")
|
|
41
65
|
});
|
|
42
66
|
this.app.resourcer.registerActionHandlers({
|
|
43
|
-
"chartsQueries:getData":
|
|
44
|
-
"chartsQueries:listMetadata":
|
|
45
|
-
"chartsQueries:validate":
|
|
67
|
+
"chartsQueries:getData": import_chartsQueries.getData,
|
|
68
|
+
"chartsQueries:listMetadata": import_chartsQueries.listMetadata,
|
|
69
|
+
"chartsQueries:validate": import_chartsQueries.validate
|
|
46
70
|
});
|
|
47
71
|
this.app.acl.registerSnippet({
|
|
48
72
|
name: "pm.charts.queries",
|
|
@@ -61,6 +85,7 @@ class ChartsPlugin extends server.Plugin {
|
|
|
61
85
|
}
|
|
62
86
|
}
|
|
63
87
|
var plugin_default = ChartsPlugin;
|
|
64
|
-
|
|
65
|
-
exports
|
|
66
|
-
|
|
88
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
89
|
+
0 && (module.exports = {
|
|
90
|
+
ChartsPlugin
|
|
91
|
+
});
|
package/dist/server/query.js
CHANGED
|
@@ -1,7 +1,26 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
var query_exports = {};
|
|
19
|
+
__export(query_exports, {
|
|
20
|
+
default: () => query_default,
|
|
21
|
+
query: () => query
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(query_exports);
|
|
5
24
|
const query = {
|
|
6
25
|
api: async (options) => {
|
|
7
26
|
return [];
|
|
@@ -34,6 +53,7 @@ const query = {
|
|
|
34
53
|
}
|
|
35
54
|
};
|
|
36
55
|
var query_default = query;
|
|
37
|
-
|
|
38
|
-
exports
|
|
39
|
-
|
|
56
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
57
|
+
0 && (module.exports = {
|
|
58
|
+
query
|
|
59
|
+
});
|
|
@@ -1,5 +1,27 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
var shared_exports = {};
|
|
19
|
+
__export(shared_exports, {
|
|
20
|
+
choicesTypeInterfaceArray: () => choicesTypeInterfaceArray
|
|
21
|
+
});
|
|
22
|
+
module.exports = __toCommonJS(shared_exports);
|
|
3
23
|
const choicesTypeInterfaceArray = ["radioGroup", "select"];
|
|
4
|
-
|
|
5
|
-
exports
|
|
24
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
25
|
+
0 && (module.exports = {
|
|
26
|
+
choicesTypeInterfaceArray
|
|
27
|
+
});
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"displayName.zh-CN": "图表",
|
|
5
5
|
"description": "Out-of-the-box, feature-rich chart plugins.",
|
|
6
6
|
"description.zh-CN": "开箱即用、丰富的报表。",
|
|
7
|
-
"version": "0.13.0-alpha.
|
|
7
|
+
"version": "0.13.0-alpha.5",
|
|
8
8
|
"main": "./dist/server/index.js",
|
|
9
9
|
"devDependencies": {
|
|
10
10
|
"@ant-design/icons": "5.x",
|
|
@@ -25,5 +25,5 @@
|
|
|
25
25
|
"@nocobase/test": "0.x",
|
|
26
26
|
"@nocobase/utils": "0.x"
|
|
27
27
|
},
|
|
28
|
-
"gitHead": "
|
|
28
|
+
"gitHead": "9eabe607b4a20c356fdb2fd95e40fa476986dcb0"
|
|
29
29
|
}
|