@nocobase/plugin-map 0.9.0-alpha.1 → 0.9.1-alpha.1
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 +13 -0
- package/README.zh-CN.md +13 -0
- package/lib/client/components/AMap.d.ts +1 -1
- package/lib/client/components/AMap.js +57 -57
- package/lib/client/components/Configuration.js +2 -2
- package/lib/client/components/Designer.js +6 -7
- package/lib/client/components/ReadPretty.js +7 -7
- package/lib/client/components/Search.js +14 -14
- package/lib/client/constants.js +3 -3
- package/lib/client/fields/circle.js +3 -3
- package/lib/client/fields/lineString.js +3 -3
- package/lib/client/fields/point.js +3 -3
- package/lib/client/fields/polygon.js +3 -3
- package/lib/client/fields/schema.d.ts +0 -56
- package/lib/client/fields/schema.js +4 -4
- package/lib/client/index.js +2 -2
- package/lib/client/initialize.d.ts +1 -1
- package/lib/client/initialize.js +9 -9
- package/lib/client/{locales → locale}/index.js +2 -10
- package/lib/server/collections/mapConfiguration.js +2 -0
- package/lib/server/plugin.js +8 -0
- package/lib/server/value-parsers/index.d.ts +13 -0
- package/lib/server/value-parsers/index.js +96 -0
- package/package.json +5 -10
- package/src/client/components/AMap.tsx +7 -8
- package/src/client/components/Configuration.tsx +4 -4
- package/src/client/components/Designer.tsx +4 -4
- package/src/client/components/ReadPretty.tsx +7 -9
- package/src/client/components/Search.tsx +3 -3
- package/src/client/constants.ts +1 -1
- package/src/client/fields/circle.ts +1 -1
- package/src/client/fields/lineString.ts +1 -1
- package/src/client/fields/point.ts +1 -2
- package/src/client/fields/polygon.ts +1 -1
- package/src/client/fields/schema.ts +3 -3
- package/src/client/index.tsx +1 -1
- package/src/client/initialize.tsx +3 -4
- package/src/client/{locales → locale}/index.ts +2 -4
- package/src/server/collections/mapConfiguration.ts +2 -0
- package/src/server/plugin.ts +7 -1
- package/src/server/value-parsers/index.ts +55 -0
- /package/lib/client/{locales → locale}/en-US.d.ts +0 -0
- /package/lib/client/{locales → locale}/en-US.js +0 -0
- /package/lib/client/{locales → locale}/index.d.ts +0 -0
- /package/lib/client/{locales → locale}/zh-CN.d.ts +0 -0
- /package/lib/client/{locales → locale}/zh-CN.js +0 -0
- /package/src/client/{locales → locale}/en-US.ts +0 -0
- /package/src/client/{locales → locale}/zh-CN.ts +0 -0
package/README.md
ADDED
package/README.zh-CN.md
ADDED
|
@@ -5,32 +5,42 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
|
|
8
|
-
function
|
|
9
|
-
const data =
|
|
8
|
+
function _amapJsapiLoader() {
|
|
9
|
+
const data = _interopRequireDefault(require("@amap/amap-jsapi-loader"));
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
_amapJsapiLoader = function _amapJsapiLoader() {
|
|
12
12
|
return data;
|
|
13
13
|
};
|
|
14
14
|
|
|
15
15
|
return data;
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
-
|
|
19
|
-
const data = _interopRequireDefault(require("@amap/amap-jsapi-loader"));
|
|
18
|
+
require("@amap/amap-jsapi-types");
|
|
20
19
|
|
|
21
|
-
|
|
20
|
+
function _icons() {
|
|
21
|
+
const data = require("@ant-design/icons");
|
|
22
|
+
|
|
23
|
+
_icons = function _icons() {
|
|
22
24
|
return data;
|
|
23
25
|
};
|
|
24
26
|
|
|
25
27
|
return data;
|
|
26
28
|
}
|
|
27
29
|
|
|
28
|
-
|
|
30
|
+
function _css() {
|
|
31
|
+
const data = require("@emotion/css");
|
|
29
32
|
|
|
30
|
-
function
|
|
33
|
+
_css = function _css() {
|
|
34
|
+
return data;
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
return data;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
function _react() {
|
|
31
41
|
const data = require("@formily/react");
|
|
32
42
|
|
|
33
|
-
|
|
43
|
+
_react = function _react() {
|
|
34
44
|
return data;
|
|
35
45
|
};
|
|
36
46
|
|
|
@@ -47,10 +57,10 @@ function _client() {
|
|
|
47
57
|
return data;
|
|
48
58
|
}
|
|
49
59
|
|
|
50
|
-
function
|
|
51
|
-
const data = require("
|
|
60
|
+
function _ahooks() {
|
|
61
|
+
const data = require("ahooks");
|
|
52
62
|
|
|
53
|
-
|
|
63
|
+
_ahooks = function _ahooks() {
|
|
54
64
|
return data;
|
|
55
65
|
};
|
|
56
66
|
|
|
@@ -67,22 +77,16 @@ function _antd() {
|
|
|
67
77
|
return data;
|
|
68
78
|
}
|
|
69
79
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
var _Search = _interopRequireDefault(require("./Search"));
|
|
73
|
-
|
|
74
|
-
function _ahooks() {
|
|
75
|
-
const data = require("ahooks");
|
|
80
|
+
function _react2() {
|
|
81
|
+
const data = _interopRequireWildcard(require("react"));
|
|
76
82
|
|
|
77
|
-
|
|
83
|
+
_react2 = function _react2() {
|
|
78
84
|
return data;
|
|
79
85
|
};
|
|
80
86
|
|
|
81
87
|
return data;
|
|
82
88
|
}
|
|
83
89
|
|
|
84
|
-
var _hooks = require("../hooks");
|
|
85
|
-
|
|
86
90
|
function _reactRouter() {
|
|
87
91
|
const data = require("react-router");
|
|
88
92
|
|
|
@@ -93,22 +97,18 @@ function _reactRouter() {
|
|
|
93
97
|
return data;
|
|
94
98
|
}
|
|
95
99
|
|
|
96
|
-
|
|
97
|
-
const data = require("@ant-design/icons");
|
|
98
|
-
|
|
99
|
-
_icons = function _icons() {
|
|
100
|
-
return data;
|
|
101
|
-
};
|
|
100
|
+
var _hooks = require("../hooks");
|
|
102
101
|
|
|
103
|
-
|
|
104
|
-
}
|
|
102
|
+
var _locale = require("../locale");
|
|
105
103
|
|
|
106
|
-
|
|
104
|
+
var _Search = _interopRequireDefault(require("./Search"));
|
|
107
105
|
|
|
108
106
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
109
107
|
|
|
110
108
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
111
109
|
|
|
110
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
111
|
+
|
|
112
112
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
113
113
|
|
|
114
114
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
@@ -171,20 +171,20 @@ const AMapComponent = props => {
|
|
|
171
171
|
_props$zoom = props.zoom,
|
|
172
172
|
zoom = _props$zoom === void 0 ? 13 : _props$zoom;
|
|
173
173
|
|
|
174
|
-
const _useMapTranslation = (0,
|
|
174
|
+
const _useMapTranslation = (0, _locale.useMapTranslation)(),
|
|
175
175
|
t = _useMapTranslation.t;
|
|
176
176
|
|
|
177
|
-
const fieldSchema = (0,
|
|
178
|
-
const aMap = (0,
|
|
179
|
-
const map = (0,
|
|
180
|
-
const mouseTool = (0,
|
|
177
|
+
const fieldSchema = (0, _react().useFieldSchema)();
|
|
178
|
+
const aMap = (0, _react2().useRef)();
|
|
179
|
+
const map = (0, _react2().useRef)();
|
|
180
|
+
const mouseTool = (0, _react2().useRef)();
|
|
181
181
|
|
|
182
|
-
const _useState = (0,
|
|
182
|
+
const _useState = (0, _react2().useState)([]),
|
|
183
183
|
_useState2 = _slicedToArray(_useState, 2),
|
|
184
184
|
needUpdateFlag = _useState2[0],
|
|
185
185
|
forceUpdate = _useState2[1];
|
|
186
186
|
|
|
187
|
-
const _useState3 = (0,
|
|
187
|
+
const _useState3 = (0, _react2().useState)(''),
|
|
188
188
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
189
189
|
errMessage = _useState4[0],
|
|
190
190
|
setErrMessage = _useState4[1];
|
|
@@ -194,12 +194,12 @@ const AMapComponent = props => {
|
|
|
194
194
|
|
|
195
195
|
const collectionField = getField(fieldSchema.name);
|
|
196
196
|
const type = collectionField === null || collectionField === void 0 ? void 0 : collectionField.interface;
|
|
197
|
-
const overlay = (0,
|
|
198
|
-
const editor = (0,
|
|
197
|
+
const overlay = (0, _react2().useRef)();
|
|
198
|
+
const editor = (0, _react2().useRef)(null);
|
|
199
199
|
const history = (0, _reactRouter().useHistory)();
|
|
200
|
-
const id = (0,
|
|
200
|
+
const id = (0, _react2().useRef)(`nocobase-map-${type}-${Date.now().toString(32)}`);
|
|
201
201
|
|
|
202
|
-
const _useState5 = (0,
|
|
202
|
+
const _useState5 = (0, _react2().useState)({
|
|
203
203
|
strokeWeight: 5,
|
|
204
204
|
strokeColor: '#4e9bff',
|
|
205
205
|
fillColor: '#4e9bff',
|
|
@@ -328,7 +328,7 @@ const AMapComponent = props => {
|
|
|
328
328
|
}; // 编辑时
|
|
329
329
|
|
|
330
330
|
|
|
331
|
-
(0,
|
|
331
|
+
(0, _react2().useEffect)(() => {
|
|
332
332
|
if (!aMap.current) return;
|
|
333
333
|
|
|
334
334
|
if (!value || overlay.current) {
|
|
@@ -358,7 +358,7 @@ const AMapComponent = props => {
|
|
|
358
358
|
setTarget();
|
|
359
359
|
}, [value, needUpdateFlag, type, commonOptions]); // 当在编辑时,关闭 mouseTool
|
|
360
360
|
|
|
361
|
-
(0,
|
|
361
|
+
(0, _react2().useEffect)(() => {
|
|
362
362
|
if (!mouseTool.current) return;
|
|
363
363
|
|
|
364
364
|
if (disabled) {
|
|
@@ -374,12 +374,12 @@ const AMapComponent = props => {
|
|
|
374
374
|
}
|
|
375
375
|
}, [disabled]); // AMap.MouseTool & AMap.XXXEditor
|
|
376
376
|
|
|
377
|
-
(0,
|
|
377
|
+
(0, _react2().useEffect)(() => {
|
|
378
378
|
if (!aMap.current || !type || disabled) return;
|
|
379
379
|
createMouseTool();
|
|
380
380
|
createEditor();
|
|
381
381
|
}, [disabled, needUpdateFlag, type]);
|
|
382
|
-
(0,
|
|
382
|
+
(0, _react2().useEffect)(() => {
|
|
383
383
|
if (!mouseTool.current || !editor.current) return;
|
|
384
384
|
const target = editor.current.getTarget();
|
|
385
385
|
|
|
@@ -391,7 +391,7 @@ const AMapComponent = props => {
|
|
|
391
391
|
executeMouseTool();
|
|
392
392
|
}
|
|
393
393
|
}, [type, value]);
|
|
394
|
-
(0,
|
|
394
|
+
(0, _react2().useEffect)(() => {
|
|
395
395
|
if (!accessKey || map.current) return;
|
|
396
396
|
|
|
397
397
|
if (securityJsCode) {
|
|
@@ -434,8 +434,8 @@ const AMapComponent = props => {
|
|
|
434
434
|
}, [accessKey, type, securityJsCode]);
|
|
435
435
|
|
|
436
436
|
if (!accessKey || errMessage) {
|
|
437
|
-
return
|
|
438
|
-
action:
|
|
437
|
+
return _react2().default.createElement(_antd().Alert, {
|
|
438
|
+
action: _react2().default.createElement(_antd().Button, {
|
|
439
439
|
type: "primary",
|
|
440
440
|
onClick: () => history.push('/admin/settings/map-configuration/configuration')
|
|
441
441
|
}, t('Go to the configuration page')),
|
|
@@ -444,7 +444,7 @@ const AMapComponent = props => {
|
|
|
444
444
|
});
|
|
445
445
|
}
|
|
446
446
|
|
|
447
|
-
return
|
|
447
|
+
return _react2().default.createElement("div", {
|
|
448
448
|
className: (0, _css().css)`
|
|
449
449
|
position: relative;
|
|
450
450
|
`,
|
|
@@ -452,24 +452,24 @@ const AMapComponent = props => {
|
|
|
452
452
|
style: {
|
|
453
453
|
height: '500px'
|
|
454
454
|
}
|
|
455
|
-
},
|
|
455
|
+
}, _react2().default.createElement("div", {
|
|
456
456
|
className: (0, _css().css)`
|
|
457
457
|
position: absolute;
|
|
458
458
|
bottom: 80px;
|
|
459
459
|
right: 20px;
|
|
460
460
|
z-index: 10;
|
|
461
461
|
`
|
|
462
|
-
},
|
|
462
|
+
}, _react2().default.createElement(_antd().Button, {
|
|
463
463
|
onClick: onFocusOverlay,
|
|
464
464
|
disabled: !overlay.current,
|
|
465
465
|
type: "primary",
|
|
466
466
|
shape: "round",
|
|
467
467
|
size: "large",
|
|
468
|
-
icon:
|
|
469
|
-
})), !disabled ?
|
|
468
|
+
icon: _react2().default.createElement(_icons().SyncOutlined, null)
|
|
469
|
+
})), !disabled ? _react2().default.createElement(_react2().default.Fragment, null, _react2().default.createElement(_Search.default, {
|
|
470
470
|
toCenter: toCenter,
|
|
471
471
|
aMap: aMap.current
|
|
472
|
-
}),
|
|
472
|
+
}), _react2().default.createElement("div", {
|
|
473
473
|
className: (0, _css().css)`
|
|
474
474
|
position: absolute;
|
|
475
475
|
bottom: 20px;
|
|
@@ -477,17 +477,17 @@ const AMapComponent = props => {
|
|
|
477
477
|
z-index: 2;
|
|
478
478
|
pointer-events: none;
|
|
479
479
|
`
|
|
480
|
-
},
|
|
480
|
+
}, _react2().default.createElement(_antd().Alert, {
|
|
481
481
|
message: t('Click to select the starting point and double-click to end the drawing'),
|
|
482
482
|
type: "info"
|
|
483
|
-
})),
|
|
483
|
+
})), _react2().default.createElement("div", {
|
|
484
484
|
className: (0, _css().css)`
|
|
485
485
|
position: absolute;
|
|
486
486
|
bottom: 20px;
|
|
487
487
|
right: 20px;
|
|
488
488
|
z-index: 2;
|
|
489
489
|
`
|
|
490
|
-
},
|
|
490
|
+
}, _react2().default.createElement(_antd().Button, {
|
|
491
491
|
disabled: !value,
|
|
492
492
|
style: {
|
|
493
493
|
height: '40px'
|
|
@@ -49,7 +49,7 @@ var _constants = require("../constants");
|
|
|
49
49
|
|
|
50
50
|
var _hooks = require("../hooks");
|
|
51
51
|
|
|
52
|
-
var
|
|
52
|
+
var _locale = require("../locale");
|
|
53
53
|
|
|
54
54
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
55
55
|
|
|
@@ -76,7 +76,7 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
|
76
76
|
const AMapConfiguration = ({
|
|
77
77
|
type
|
|
78
78
|
}) => {
|
|
79
|
-
const _useMapTranslation = (0,
|
|
79
|
+
const _useMapTranslation = (0, _locale.useMapTranslation)(),
|
|
80
80
|
t = _useMapTranslation.t;
|
|
81
81
|
|
|
82
82
|
const _useBoolean = (0, _ahooks().useBoolean)(false),
|
|
@@ -25,10 +25,10 @@ function _client() {
|
|
|
25
25
|
return data;
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
-
function
|
|
29
|
-
const data = _interopRequireDefault(require("lodash"));
|
|
28
|
+
function _set() {
|
|
29
|
+
const data = _interopRequireDefault(require("lodash/set"));
|
|
30
30
|
|
|
31
|
-
|
|
31
|
+
_set = function _set() {
|
|
32
32
|
return data;
|
|
33
33
|
};
|
|
34
34
|
|
|
@@ -45,7 +45,7 @@ function _react2() {
|
|
|
45
45
|
return data;
|
|
46
46
|
}
|
|
47
47
|
|
|
48
|
-
var
|
|
48
|
+
var _locale = require("../locale");
|
|
49
49
|
|
|
50
50
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
51
51
|
|
|
@@ -64,7 +64,7 @@ const Designer = () => {
|
|
|
64
64
|
const field = (0, _react().useField)();
|
|
65
65
|
const fieldSchema = (0, _react().useFieldSchema)();
|
|
66
66
|
|
|
67
|
-
const _useMapTranslation = (0,
|
|
67
|
+
const _useMapTranslation = (0, _locale.useMapTranslation)(),
|
|
68
68
|
t = _useMapTranslation.t;
|
|
69
69
|
|
|
70
70
|
const _useDesignable = (0, _client().useDesignable)(),
|
|
@@ -279,8 +279,7 @@ const Designer = () => {
|
|
|
279
279
|
zoom
|
|
280
280
|
}) => {
|
|
281
281
|
if (zoom) {
|
|
282
|
-
|
|
283
|
-
|
|
282
|
+
(0, _set().default)(fieldSchema, 'x-component-props.zoom', zoom);
|
|
284
283
|
Object.assign(field.componentProps, fieldSchema['x-component-props']);
|
|
285
284
|
dn.emit('patch', {
|
|
286
285
|
schema: {
|
|
@@ -63,15 +63,15 @@ const ReadPretty = props => {
|
|
|
63
63
|
const mapType = props.mapType || (collectionField === null || collectionField === void 0 ? void 0 : (_collectionField$uiSc = collectionField.uiSchema['x-component-props']) === null || _collectionField$uiSc === void 0 ? void 0 : _collectionField$uiSc.mapType);
|
|
64
64
|
const field = (0, _react().useField)();
|
|
65
65
|
(0, _react2().useEffect)(() => {
|
|
66
|
-
|
|
66
|
+
var _collectionField$uiSc2;
|
|
67
|
+
|
|
68
|
+
if (!field.title && (collectionField === null || collectionField === void 0 ? void 0 : (_collectionField$uiSc2 = collectionField.uiSchema) === null || _collectionField$uiSc2 === void 0 ? void 0 : _collectionField$uiSc2.title)) {
|
|
67
69
|
field.title = collectionField.uiSchema.title;
|
|
68
70
|
}
|
|
69
|
-
}, collectionField.title);
|
|
70
|
-
if (!readOnly) return _react2().default.createElement("div", {
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
}
|
|
74
|
-
}, value === null || value === void 0 ? void 0 : value.map(item => Array.isArray(item) ? `(${item.join(',')})` : item).join(','));
|
|
71
|
+
}, collectionField === null || collectionField === void 0 ? void 0 : collectionField.title);
|
|
72
|
+
if (!readOnly) return _react2().default.createElement("div", null, _react2().default.createElement(_client().EllipsisWithTooltip, {
|
|
73
|
+
ellipsis: true
|
|
74
|
+
}, value === null || value === void 0 ? void 0 : value.map(item => Array.isArray(item) ? `(${item.join(',')})` : item).join(',')));
|
|
75
75
|
return mapType === 'amap' ? _react2().default.createElement(_AMap.default, _objectSpread({
|
|
76
76
|
mapType: mapType
|
|
77
77
|
}, props)) : null;
|
|
@@ -5,47 +5,47 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
|
|
8
|
-
function
|
|
9
|
-
const data = require("
|
|
8
|
+
function _css() {
|
|
9
|
+
const data = require("@emotion/css");
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
_css = function _css() {
|
|
12
12
|
return data;
|
|
13
13
|
};
|
|
14
14
|
|
|
15
15
|
return data;
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
-
function
|
|
19
|
-
const data = require("
|
|
18
|
+
function _ahooks() {
|
|
19
|
+
const data = require("ahooks");
|
|
20
20
|
|
|
21
|
-
|
|
21
|
+
_ahooks = function _ahooks() {
|
|
22
22
|
return data;
|
|
23
23
|
};
|
|
24
24
|
|
|
25
25
|
return data;
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
-
function
|
|
29
|
-
const data =
|
|
28
|
+
function _antd() {
|
|
29
|
+
const data = require("antd");
|
|
30
30
|
|
|
31
|
-
|
|
31
|
+
_antd = function _antd() {
|
|
32
32
|
return data;
|
|
33
33
|
};
|
|
34
34
|
|
|
35
35
|
return data;
|
|
36
36
|
}
|
|
37
37
|
|
|
38
|
-
function
|
|
39
|
-
const data = require("
|
|
38
|
+
function _react() {
|
|
39
|
+
const data = _interopRequireWildcard(require("react"));
|
|
40
40
|
|
|
41
|
-
|
|
41
|
+
_react = function _react() {
|
|
42
42
|
return data;
|
|
43
43
|
};
|
|
44
44
|
|
|
45
45
|
return data;
|
|
46
46
|
}
|
|
47
47
|
|
|
48
|
-
var
|
|
48
|
+
var _locale = require("../locale");
|
|
49
49
|
|
|
50
50
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
51
51
|
|
|
@@ -73,7 +73,7 @@ const Search = props => {
|
|
|
73
73
|
const aMap = props.aMap,
|
|
74
74
|
toCenter = props.toCenter;
|
|
75
75
|
|
|
76
|
-
const _useMapTranslation = (0,
|
|
76
|
+
const _useMapTranslation = (0, _locale.useMapTranslation)(),
|
|
77
77
|
t = _useMapTranslation.t;
|
|
78
78
|
|
|
79
79
|
const placeSearch = (0, _react().useRef)();
|
package/lib/client/constants.js
CHANGED
|
@@ -5,13 +5,13 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.MapTypes = void 0;
|
|
7
7
|
|
|
8
|
-
var
|
|
8
|
+
var _locale = require("./locale");
|
|
9
9
|
|
|
10
10
|
const MapTypes = [{
|
|
11
|
-
label: (0,
|
|
11
|
+
label: (0, _locale.generateNTemplate)('AMap'),
|
|
12
12
|
value: 'amap'
|
|
13
13
|
}, {
|
|
14
|
-
label: (0,
|
|
14
|
+
label: (0, _locale.generateNTemplate)('Google Maps'),
|
|
15
15
|
value: 'google'
|
|
16
16
|
}];
|
|
17
17
|
exports.MapTypes = MapTypes;
|
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.circle = void 0;
|
|
7
7
|
|
|
8
|
-
var
|
|
8
|
+
var _locale = require("../locale");
|
|
9
9
|
|
|
10
10
|
var _schema = require("./schema");
|
|
11
11
|
|
|
@@ -20,8 +20,8 @@ const circle = _objectSpread({
|
|
|
20
20
|
type: 'object',
|
|
21
21
|
group: 'map',
|
|
22
22
|
order: 3,
|
|
23
|
-
title: (0,
|
|
24
|
-
description: (0,
|
|
23
|
+
title: (0, _locale.generateNTemplate)('Circle'),
|
|
24
|
+
description: (0, _locale.generateNTemplate)('Circle'),
|
|
25
25
|
sortable: true,
|
|
26
26
|
default: {
|
|
27
27
|
type: 'circle',
|
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.lineString = void 0;
|
|
7
7
|
|
|
8
|
-
var
|
|
8
|
+
var _locale = require("../locale");
|
|
9
9
|
|
|
10
10
|
var _schema = require("./schema");
|
|
11
11
|
|
|
@@ -20,8 +20,8 @@ const lineString = _objectSpread({
|
|
|
20
20
|
type: 'object',
|
|
21
21
|
group: 'map',
|
|
22
22
|
order: 2,
|
|
23
|
-
title: (0,
|
|
24
|
-
description: (0,
|
|
23
|
+
title: (0, _locale.generateNTemplate)('Line'),
|
|
24
|
+
description: (0, _locale.generateNTemplate)('Line'),
|
|
25
25
|
sortable: true,
|
|
26
26
|
default: {
|
|
27
27
|
type: 'lineString',
|
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.point = void 0;
|
|
7
7
|
|
|
8
|
-
var
|
|
8
|
+
var _locale = require("../locale");
|
|
9
9
|
|
|
10
10
|
var _schema = require("./schema");
|
|
11
11
|
|
|
@@ -20,8 +20,8 @@ const point = _objectSpread({
|
|
|
20
20
|
type: 'object',
|
|
21
21
|
group: 'map',
|
|
22
22
|
order: 1,
|
|
23
|
-
title: (0,
|
|
24
|
-
description: (0,
|
|
23
|
+
title: (0, _locale.generateNTemplate)('Point'),
|
|
24
|
+
description: (0, _locale.generateNTemplate)('Point'),
|
|
25
25
|
sortable: true,
|
|
26
26
|
default: {
|
|
27
27
|
type: 'point',
|
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.polygon = void 0;
|
|
7
7
|
|
|
8
|
-
var
|
|
8
|
+
var _locale = require("../locale");
|
|
9
9
|
|
|
10
10
|
var _schema = require("./schema");
|
|
11
11
|
|
|
@@ -20,8 +20,8 @@ const polygon = _objectSpread({
|
|
|
20
20
|
type: 'object',
|
|
21
21
|
group: 'map',
|
|
22
22
|
order: 4,
|
|
23
|
-
title: (0,
|
|
24
|
-
description: (0,
|
|
23
|
+
title: (0, _locale.generateNTemplate)('Polygon'),
|
|
24
|
+
description: (0, _locale.generateNTemplate)('Polygon'),
|
|
25
25
|
sortable: true,
|
|
26
26
|
default: {
|
|
27
27
|
type: 'polygon',
|
|
@@ -35,62 +35,6 @@ export declare const commonSchema: {
|
|
|
35
35
|
'x-validator': string;
|
|
36
36
|
description: string;
|
|
37
37
|
};
|
|
38
|
-
type: import("@formily/react").Stringify<{
|
|
39
|
-
[key: symbol]: any;
|
|
40
|
-
[key: `x-${string}`]: any;
|
|
41
|
-
[key: `x-${number}`]: any;
|
|
42
|
-
version?: string;
|
|
43
|
-
name?: import("@formily/react").SchemaKey;
|
|
44
|
-
title?: any;
|
|
45
|
-
description?: any;
|
|
46
|
-
default?: any;
|
|
47
|
-
readOnly?: boolean;
|
|
48
|
-
writeOnly?: boolean;
|
|
49
|
-
type?: import("@formily/react").SchemaTypes;
|
|
50
|
-
enum?: import("@formily/react").SchemaEnum<any>;
|
|
51
|
-
const?: any;
|
|
52
|
-
multipleOf?: number;
|
|
53
|
-
maximum?: number;
|
|
54
|
-
exclusiveMaximum?: number;
|
|
55
|
-
minimum?: number;
|
|
56
|
-
exclusiveMinimum?: number;
|
|
57
|
-
maxLength?: number;
|
|
58
|
-
minLength?: number;
|
|
59
|
-
pattern?: string | RegExp;
|
|
60
|
-
maxItems?: number;
|
|
61
|
-
minItems?: number;
|
|
62
|
-
uniqueItems?: boolean;
|
|
63
|
-
maxProperties?: number;
|
|
64
|
-
minProperties?: number;
|
|
65
|
-
required?: string | boolean | string[];
|
|
66
|
-
format?: string;
|
|
67
|
-
$ref?: string;
|
|
68
|
-
$namespace?: string;
|
|
69
|
-
definitions?: import("@formily/react").SchemaProperties<any, any, any, any, any, any, any, any>;
|
|
70
|
-
properties?: import("@formily/react").SchemaProperties<any, any, any, any, any, any, any, any>;
|
|
71
|
-
items?: import("@formily/react").SchemaItems<any, any, any, any, any, any, any, any>;
|
|
72
|
-
additionalItems?: import("@formily/react").Stringify<any>;
|
|
73
|
-
patternProperties?: import("@formily/react").SchemaProperties<any, any, any, any, any, any, any, any>;
|
|
74
|
-
additionalProperties?: import("@formily/react").Stringify<any>;
|
|
75
|
-
"x-value"?: any;
|
|
76
|
-
"x-index"?: number;
|
|
77
|
-
"x-pattern"?: any;
|
|
78
|
-
"x-display"?: any;
|
|
79
|
-
"x-validator"?: any;
|
|
80
|
-
"x-decorator"?: any;
|
|
81
|
-
"x-decorator-props"?: any;
|
|
82
|
-
"x-component"?: any;
|
|
83
|
-
"x-component-props"?: any;
|
|
84
|
-
"x-reactions"?: import("@formily/react").SchemaReactions<any>;
|
|
85
|
-
"x-content"?: any;
|
|
86
|
-
"x-data"?: any;
|
|
87
|
-
"x-visible"?: boolean;
|
|
88
|
-
"x-hidden"?: boolean;
|
|
89
|
-
"x-disabled"?: boolean;
|
|
90
|
-
"x-editable"?: boolean;
|
|
91
|
-
"x-read-only"?: boolean;
|
|
92
|
-
"x-read-pretty"?: boolean;
|
|
93
|
-
}>;
|
|
94
38
|
};
|
|
95
39
|
schemaInitialize(schema: ISchema, { readPretty, block }: {
|
|
96
40
|
readPretty: any;
|
|
@@ -17,7 +17,7 @@ function _client() {
|
|
|
17
17
|
|
|
18
18
|
var _constants = require("../constants");
|
|
19
19
|
|
|
20
|
-
var
|
|
20
|
+
var _locale = require("../locale");
|
|
21
21
|
|
|
22
22
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
23
23
|
|
|
@@ -27,8 +27,8 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
|
|
|
27
27
|
|
|
28
28
|
const defaultProps = _client().interfacesProperties.defaultProps;
|
|
29
29
|
|
|
30
|
-
if (Array.isArray(
|
|
31
|
-
|
|
30
|
+
if (Array.isArray(_client().interfacesProperties.type.enum)) {
|
|
31
|
+
_client().interfacesProperties.type.enum.push({
|
|
32
32
|
label: 'Point',
|
|
33
33
|
value: 'point'
|
|
34
34
|
}, {
|
|
@@ -46,7 +46,7 @@ if (Array.isArray(defaultProps.type.enum)) {
|
|
|
46
46
|
const commonSchema = {
|
|
47
47
|
properties: _objectSpread(_objectSpread({}, defaultProps), {}, {
|
|
48
48
|
'uiSchema.x-component-props.mapType': {
|
|
49
|
-
title: (0,
|
|
49
|
+
title: (0, _locale.generateNTemplate)('Map type'),
|
|
50
50
|
type: 'string',
|
|
51
51
|
required: true,
|
|
52
52
|
'x-decorator': 'FormItem',
|