@nocobase/plugin-map 0.13.0-alpha.1 → 0.13.0-alpha.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/dist/client/index.js +33 -3072
- package/dist/index.js +37 -16
- package/dist/locale/en-US.js +22 -4
- package/dist/locale/fr-FR.js +22 -4
- package/dist/locale/pt-BR.js +22 -4
- package/dist/locale/zh-CN.js +22 -4
- package/dist/server/actions/index.js +31 -9
- package/dist/server/collections/mapConfiguration.js +24 -7
- package/dist/server/constants.js +26 -4
- package/dist/server/fields/circle.js +35 -14
- package/dist/server/fields/index.js +26 -32
- package/dist/server/fields/lineString.js +40 -19
- package/dist/server/fields/point.js +40 -19
- package/dist/server/fields/polygon.js +40 -19
- package/dist/server/helpers/index.js +36 -9
- package/dist/server/index.js +33 -11
- package/dist/server/plugin.js +46 -27
- package/dist/server/value-parsers/index.js +37 -13
- package/dist/swagger/index.js +22 -4
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -1,18 +1,39 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var
|
|
6
|
-
|
|
7
|
-
|
|
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 __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var src_exports = {};
|
|
30
|
+
__export(src_exports, {
|
|
31
|
+
default: () => import_server.default
|
|
12
32
|
});
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
33
|
+
module.exports = __toCommonJS(src_exports);
|
|
34
|
+
__reExport(src_exports, require("./server"), module.exports);
|
|
35
|
+
var import_server = __toESM(require("./server"));
|
|
36
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
37
|
+
0 && (module.exports = {
|
|
38
|
+
...require("./server")
|
|
18
39
|
});
|
package/dist/locale/en-US.js
CHANGED
|
@@ -1,6 +1,24 @@
|
|
|
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 en_US_exports = {};
|
|
19
|
+
__export(en_US_exports, {
|
|
20
|
+
default: () => en_US_default
|
|
21
|
+
});
|
|
22
|
+
module.exports = __toCommonJS(en_US_exports);
|
|
3
23
|
const locale = {};
|
|
4
24
|
var en_US_default = locale;
|
|
5
|
-
|
|
6
|
-
module.exports = en_US_default;
|
package/dist/locale/fr-FR.js
CHANGED
|
@@ -1,6 +1,24 @@
|
|
|
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 fr_FR_exports = {};
|
|
19
|
+
__export(fr_FR_exports, {
|
|
20
|
+
default: () => fr_FR_default
|
|
21
|
+
});
|
|
22
|
+
module.exports = __toCommonJS(fr_FR_exports);
|
|
3
23
|
const locale = {};
|
|
4
24
|
var fr_FR_default = locale;
|
|
5
|
-
|
|
6
|
-
module.exports = fr_FR_default;
|
package/dist/locale/pt-BR.js
CHANGED
|
@@ -1,5 +1,25 @@
|
|
|
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 pt_BR_exports = {};
|
|
19
|
+
__export(pt_BR_exports, {
|
|
20
|
+
default: () => pt_BR_default
|
|
21
|
+
});
|
|
22
|
+
module.exports = __toCommonJS(pt_BR_exports);
|
|
3
23
|
const locale = {
|
|
4
24
|
"Map-based geometry": "Geometria baseada em mapa",
|
|
5
25
|
"Map type": "Tipo de mapa",
|
|
@@ -47,5 +67,3 @@ const locale = {
|
|
|
47
67
|
"Marker field": "Campo de marcador"
|
|
48
68
|
};
|
|
49
69
|
var pt_BR_default = locale;
|
|
50
|
-
|
|
51
|
-
module.exports = pt_BR_default;
|
package/dist/locale/zh-CN.js
CHANGED
|
@@ -1,5 +1,25 @@
|
|
|
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 zh_CN_exports = {};
|
|
19
|
+
__export(zh_CN_exports, {
|
|
20
|
+
default: () => zh_CN_default
|
|
21
|
+
});
|
|
22
|
+
module.exports = __toCommonJS(zh_CN_exports);
|
|
3
23
|
const locale = {
|
|
4
24
|
Map: "\u5730\u56FE",
|
|
5
25
|
"Map-based geometry": "\u57FA\u4E8E\u5730\u56FE\u7684\u51E0\u4F55\u56FE\u5F62",
|
|
@@ -50,5 +70,3 @@ const locale = {
|
|
|
50
70
|
"Create map block": "\u521B\u5EFA\u5730\u56FE\u533A\u5757"
|
|
51
71
|
};
|
|
52
72
|
var zh_CN_default = locale;
|
|
53
|
-
|
|
54
|
-
module.exports = zh_CN_default;
|
|
@@ -1,12 +1,32 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var
|
|
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 actions_exports = {};
|
|
19
|
+
__export(actions_exports, {
|
|
20
|
+
getConfiguration: () => getConfiguration,
|
|
21
|
+
setConfiguration: () => setConfiguration
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(actions_exports);
|
|
24
|
+
var import_constants = require("../constants");
|
|
5
25
|
const getConfiguration = async (ctx, next) => {
|
|
6
26
|
const {
|
|
7
27
|
params: { type }
|
|
8
28
|
} = ctx.action;
|
|
9
|
-
const repo = ctx.db.getRepository(
|
|
29
|
+
const repo = ctx.db.getRepository(import_constants.MapConfigurationCollectionName);
|
|
10
30
|
const record = await repo.findOne({
|
|
11
31
|
filter: {
|
|
12
32
|
type
|
|
@@ -17,7 +37,7 @@ const getConfiguration = async (ctx, next) => {
|
|
|
17
37
|
};
|
|
18
38
|
const setConfiguration = async (ctx, next) => {
|
|
19
39
|
const { params: values } = ctx.action;
|
|
20
|
-
const repo = ctx.db.getRepository(
|
|
40
|
+
const repo = ctx.db.getRepository(import_constants.MapConfigurationCollectionName);
|
|
21
41
|
const record = await repo.findOne({
|
|
22
42
|
filter: {
|
|
23
43
|
type: values.type
|
|
@@ -38,6 +58,8 @@ const setConfiguration = async (ctx, next) => {
|
|
|
38
58
|
ctx.body = "ok";
|
|
39
59
|
return next();
|
|
40
60
|
};
|
|
41
|
-
|
|
42
|
-
exports
|
|
43
|
-
|
|
61
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
62
|
+
0 && (module.exports = {
|
|
63
|
+
getConfiguration,
|
|
64
|
+
setConfiguration
|
|
65
|
+
});
|
|
@@ -1,11 +1,30 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var
|
|
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 mapConfiguration_exports = {};
|
|
19
|
+
__export(mapConfiguration_exports, {
|
|
20
|
+
default: () => mapConfiguration_default
|
|
21
|
+
});
|
|
22
|
+
module.exports = __toCommonJS(mapConfiguration_exports);
|
|
23
|
+
var import_constants = require("../constants");
|
|
5
24
|
var mapConfiguration_default = {
|
|
6
25
|
namespace: "map.mapConfiguration",
|
|
7
26
|
duplicator: "optional",
|
|
8
|
-
name:
|
|
27
|
+
name: import_constants.MapConfigurationCollectionName,
|
|
9
28
|
title: '{{t("Map Manager")}}',
|
|
10
29
|
fields: [
|
|
11
30
|
{
|
|
@@ -28,5 +47,3 @@ var mapConfiguration_default = {
|
|
|
28
47
|
}
|
|
29
48
|
]
|
|
30
49
|
};
|
|
31
|
-
|
|
32
|
-
module.exports = mapConfiguration_default;
|
package/dist/server/constants.js
CHANGED
|
@@ -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 constants_exports = {};
|
|
19
|
+
__export(constants_exports, {
|
|
20
|
+
MapConfigurationCollectionName: () => MapConfigurationCollectionName
|
|
21
|
+
});
|
|
22
|
+
module.exports = __toCommonJS(constants_exports);
|
|
3
23
|
const MapConfigurationCollectionName = "mapConfiguration";
|
|
4
|
-
|
|
5
|
-
exports
|
|
24
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
25
|
+
0 && (module.exports = {
|
|
26
|
+
MapConfigurationCollectionName
|
|
27
|
+
});
|
|
@@ -1,21 +1,40 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
|
|
6
|
-
|
|
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 circle_exports = {};
|
|
19
|
+
__export(circle_exports, {
|
|
20
|
+
CircleField: () => CircleField
|
|
21
|
+
});
|
|
22
|
+
module.exports = __toCommonJS(circle_exports);
|
|
23
|
+
var import_database = require("@nocobase/database");
|
|
24
|
+
var import_helpers = require("../helpers");
|
|
25
|
+
class Circle extends import_database.DataTypes.ABSTRACT {
|
|
7
26
|
key = "Circle";
|
|
8
27
|
}
|
|
9
|
-
class CircleField extends
|
|
28
|
+
class CircleField extends import_database.Field {
|
|
10
29
|
constructor(options, context) {
|
|
11
30
|
const { name } = options;
|
|
12
31
|
super(
|
|
13
32
|
{
|
|
14
33
|
get() {
|
|
15
34
|
const value = this.getDataValue(name);
|
|
16
|
-
if (
|
|
35
|
+
if ((0, import_helpers.isPg)(context)) {
|
|
17
36
|
if (typeof value === "string") {
|
|
18
|
-
return
|
|
37
|
+
return (0, import_helpers.toValue)(`(${value})`);
|
|
19
38
|
}
|
|
20
39
|
return value ? [value.x, value.y, value.radius] : null;
|
|
21
40
|
} else {
|
|
@@ -25,7 +44,7 @@ class CircleField extends database.Field {
|
|
|
25
44
|
set(value) {
|
|
26
45
|
if (!(value == null ? void 0 : value.length))
|
|
27
46
|
value = null;
|
|
28
|
-
else if (
|
|
47
|
+
else if ((0, import_helpers.isPg)(context)) {
|
|
29
48
|
value = value.join(",");
|
|
30
49
|
}
|
|
31
50
|
this.setDataValue(name, value);
|
|
@@ -36,12 +55,14 @@ class CircleField extends database.Field {
|
|
|
36
55
|
);
|
|
37
56
|
}
|
|
38
57
|
get dataType() {
|
|
39
|
-
if (
|
|
58
|
+
if ((0, import_helpers.isPg)(this.context)) {
|
|
40
59
|
return Circle;
|
|
41
60
|
} else {
|
|
42
|
-
return
|
|
61
|
+
return import_database.DataTypes.JSON;
|
|
43
62
|
}
|
|
44
63
|
}
|
|
45
64
|
}
|
|
46
|
-
|
|
47
|
-
exports
|
|
65
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
66
|
+
0 && (module.exports = {
|
|
67
|
+
CircleField
|
|
68
|
+
});
|
|
@@ -1,33 +1,27 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
});
|
|
28
|
-
Object.keys(circle).forEach(function (k) {
|
|
29
|
-
if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
|
|
30
|
-
enumerable: true,
|
|
31
|
-
get: function () { return circle[k]; }
|
|
32
|
-
});
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __copyProps = (to, from, except, desc) => {
|
|
6
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
7
|
+
for (let key of __getOwnPropNames(from))
|
|
8
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
9
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
10
|
+
}
|
|
11
|
+
return to;
|
|
12
|
+
};
|
|
13
|
+
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
14
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
15
|
+
var fields_exports = {};
|
|
16
|
+
module.exports = __toCommonJS(fields_exports);
|
|
17
|
+
__reExport(fields_exports, require("./point"), module.exports);
|
|
18
|
+
__reExport(fields_exports, require("./lineString"), module.exports);
|
|
19
|
+
__reExport(fields_exports, require("./polygon"), module.exports);
|
|
20
|
+
__reExport(fields_exports, require("./circle"), module.exports);
|
|
21
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
22
|
+
0 && (module.exports = {
|
|
23
|
+
...require("./point"),
|
|
24
|
+
...require("./lineString"),
|
|
25
|
+
...require("./polygon"),
|
|
26
|
+
...require("./circle")
|
|
33
27
|
});
|
|
@@ -1,21 +1,40 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
|
|
6
|
-
|
|
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 lineString_exports = {};
|
|
19
|
+
__export(lineString_exports, {
|
|
20
|
+
LineStringField: () => LineStringField
|
|
21
|
+
});
|
|
22
|
+
module.exports = __toCommonJS(lineString_exports);
|
|
23
|
+
var import_database = require("@nocobase/database");
|
|
24
|
+
var import_helpers = require("../helpers");
|
|
25
|
+
class LineString extends import_database.DataTypes.ABSTRACT {
|
|
7
26
|
key = "Path";
|
|
8
27
|
}
|
|
9
|
-
class LineStringField extends
|
|
28
|
+
class LineStringField extends import_database.Field {
|
|
10
29
|
constructor(options, context) {
|
|
11
30
|
const { name } = options;
|
|
12
31
|
super(
|
|
13
32
|
{
|
|
14
33
|
get() {
|
|
15
34
|
const value = this.getDataValue(name);
|
|
16
|
-
if (
|
|
17
|
-
return
|
|
18
|
-
} else if (
|
|
35
|
+
if ((0, import_helpers.isPg)(context)) {
|
|
36
|
+
return (0, import_helpers.toValue)(value);
|
|
37
|
+
} else if ((0, import_helpers.isMysql)(context)) {
|
|
19
38
|
return (value == null ? void 0 : value.coordinates) || null;
|
|
20
39
|
} else {
|
|
21
40
|
return value;
|
|
@@ -24,9 +43,9 @@ class LineStringField extends database.Field {
|
|
|
24
43
|
set(value) {
|
|
25
44
|
if (!(value == null ? void 0 : value.length))
|
|
26
45
|
value = null;
|
|
27
|
-
else if (
|
|
28
|
-
value =
|
|
29
|
-
} else if (
|
|
46
|
+
else if ((0, import_helpers.isPg)(context)) {
|
|
47
|
+
value = (0, import_helpers.joinComma)(value.map(import_helpers.joinComma));
|
|
48
|
+
} else if ((0, import_helpers.isMysql)(context)) {
|
|
30
49
|
value = {
|
|
31
50
|
type: "LineString",
|
|
32
51
|
coordinates: value
|
|
@@ -40,15 +59,17 @@ class LineStringField extends database.Field {
|
|
|
40
59
|
);
|
|
41
60
|
}
|
|
42
61
|
get dataType() {
|
|
43
|
-
if (
|
|
62
|
+
if ((0, import_helpers.isPg)(this.context)) {
|
|
44
63
|
return LineString;
|
|
45
64
|
}
|
|
46
|
-
if (
|
|
47
|
-
return
|
|
65
|
+
if ((0, import_helpers.isMysql)(this.context)) {
|
|
66
|
+
return import_database.DataTypes.GEOMETRY("LINESTRING");
|
|
48
67
|
} else {
|
|
49
|
-
return
|
|
68
|
+
return import_database.DataTypes.JSON;
|
|
50
69
|
}
|
|
51
70
|
}
|
|
52
71
|
}
|
|
53
|
-
|
|
54
|
-
exports
|
|
72
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
73
|
+
0 && (module.exports = {
|
|
74
|
+
LineStringField
|
|
75
|
+
});
|
|
@@ -1,24 +1,43 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
|
|
6
|
-
|
|
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 point_exports = {};
|
|
19
|
+
__export(point_exports, {
|
|
20
|
+
PointField: () => PointField
|
|
21
|
+
});
|
|
22
|
+
module.exports = __toCommonJS(point_exports);
|
|
23
|
+
var import_database = require("@nocobase/database");
|
|
24
|
+
var import_helpers = require("../helpers");
|
|
25
|
+
class Point extends import_database.DataTypes.ABSTRACT {
|
|
7
26
|
key = "Point";
|
|
8
27
|
}
|
|
9
|
-
class PointField extends
|
|
28
|
+
class PointField extends import_database.Field {
|
|
10
29
|
constructor(options, context) {
|
|
11
30
|
const { name } = options;
|
|
12
31
|
super(
|
|
13
32
|
{
|
|
14
33
|
get() {
|
|
15
34
|
const value = this.getDataValue(name);
|
|
16
|
-
if (
|
|
35
|
+
if ((0, import_helpers.isPg)(context)) {
|
|
17
36
|
if (typeof value === "string") {
|
|
18
|
-
return
|
|
37
|
+
return (0, import_helpers.toValue)(value);
|
|
19
38
|
}
|
|
20
39
|
return value ? [value.x, value.y] : null;
|
|
21
|
-
} else if (
|
|
40
|
+
} else if ((0, import_helpers.isMysql)(context)) {
|
|
22
41
|
return (value == null ? void 0 : value.coordinates) || null;
|
|
23
42
|
} else {
|
|
24
43
|
return value;
|
|
@@ -27,9 +46,9 @@ class PointField extends database.Field {
|
|
|
27
46
|
set(value) {
|
|
28
47
|
if (!(value == null ? void 0 : value.length))
|
|
29
48
|
value = null;
|
|
30
|
-
else if (
|
|
31
|
-
value =
|
|
32
|
-
} else if (
|
|
49
|
+
else if ((0, import_helpers.isPg)(context)) {
|
|
50
|
+
value = (0, import_helpers.joinComma)(value);
|
|
51
|
+
} else if ((0, import_helpers.isMysql)(context)) {
|
|
33
52
|
value = {
|
|
34
53
|
type: "Point",
|
|
35
54
|
coordinates: value
|
|
@@ -43,15 +62,17 @@ class PointField extends database.Field {
|
|
|
43
62
|
);
|
|
44
63
|
}
|
|
45
64
|
get dataType() {
|
|
46
|
-
if (
|
|
65
|
+
if ((0, import_helpers.isPg)(this.context)) {
|
|
47
66
|
return Point;
|
|
48
67
|
}
|
|
49
|
-
if (
|
|
50
|
-
return
|
|
68
|
+
if ((0, import_helpers.isMysql)(this.context)) {
|
|
69
|
+
return import_database.DataTypes.GEOMETRY("POINT");
|
|
51
70
|
} else {
|
|
52
|
-
return
|
|
71
|
+
return import_database.DataTypes.JSON;
|
|
53
72
|
}
|
|
54
73
|
}
|
|
55
74
|
}
|
|
56
|
-
|
|
57
|
-
exports
|
|
75
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
76
|
+
0 && (module.exports = {
|
|
77
|
+
PointField
|
|
78
|
+
});
|