@nocobase/plugin-map 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/block/MapActionInitializers.d.ts +0 -16
- package/dist/client/block/MapBlock.Settings.d.ts +0 -78
- package/dist/client/block/MapBlock.d.ts +0 -10
- package/dist/client/block/MapBlockDesigner.d.ts +0 -10
- package/dist/client/block/MapBlockInitializer.d.ts +0 -10
- package/dist/client/block/MapBlockProvider.d.ts +0 -13
- package/dist/client/block/createMapBlockUISchema.d.ts +0 -14
- package/dist/client/block/index.d.ts +0 -10
- package/dist/client/block/utils.d.ts +0 -9
- package/dist/client/components/AMap/Block.d.ts +0 -10
- package/dist/client/components/AMap/Map.d.ts +0 -47
- package/dist/client/components/AMap/Search.d.ts +0 -15
- package/dist/client/components/AMap/index.d.ts +0 -10
- package/dist/client/components/Configuration.d.ts +0 -10
- package/dist/client/components/Designer.d.ts +0 -11
- package/dist/client/components/GoogleMaps/Block.d.ts +0 -10
- package/dist/client/components/GoogleMaps/Map.d.ts +0 -39
- package/dist/client/components/GoogleMaps/Search.d.ts +0 -16
- package/dist/client/components/GoogleMaps/index.d.ts +0 -10
- package/dist/client/components/GoogleMaps/utils.d.ts +0 -13
- package/dist/client/components/Map.d.ts +0 -15
- package/dist/client/components/MapBlock.d.ts +0 -10
- package/dist/client/components/MapComponent.d.ts +0 -10
- package/dist/client/components/ReadPretty.d.ts +0 -11
- package/dist/client/components/hook.d.ts +0 -9
- package/dist/client/components/index.d.ts +0 -14
- package/dist/client/constants.d.ts +0 -14
- package/dist/client/fields/circle.d.ts +0 -28
- package/dist/client/fields/fieldSettingsComponentMap.d.ts +0 -10
- package/dist/client/fields/index.d.ts +0 -10
- package/dist/client/fields/lineString.d.ts +0 -28
- package/dist/client/fields/point.d.ts +0 -28
- package/dist/client/fields/polygon.d.ts +0 -28
- package/dist/client/fields/schema.d.ts +0 -51
- package/dist/client/hooks/index.d.ts +0 -9
- package/dist/client/hooks/useMapConfiguration.d.ts +0 -11
- package/dist/client/index.d.ts +0 -13
- package/dist/client/index.js +0 -124
- package/dist/client/locale/index.d.ts +0 -12
- package/dist/client/types.d.ts +0 -9
- package/dist/client/utils.d.ts +0 -9
- package/dist/externalVersion.js +0 -28
- package/dist/index.d.ts +0 -10
- package/dist/index.js +0 -48
- package/dist/locale/en-US.json +0 -51
- package/dist/locale/ko_KR.json +0 -51
- package/dist/locale/pt-BR.json +0 -45
- package/dist/locale/zh-CN.json +0 -51
- package/dist/server/actions/index.d.ts +0 -11
- package/dist/server/actions/index.js +0 -74
- package/dist/server/collections/mapConfiguration.d.ts +0 -10
- package/dist/server/collections/mapConfiguration.js +0 -60
- package/dist/server/constants.d.ts +0 -9
- package/dist/server/constants.js +0 -36
- package/dist/server/fields/circle.d.ts +0 -20
- package/dist/server/fields/circle.js +0 -77
- package/dist/server/fields/index.d.ts +0 -12
- package/dist/server/fields/index.js +0 -36
- package/dist/server/fields/lineString.d.ts +0 -20
- package/dist/server/fields/lineString.js +0 -84
- package/dist/server/fields/point.d.ts +0 -20
- package/dist/server/fields/point.js +0 -87
- package/dist/server/fields/polygon.d.ts +0 -20
- package/dist/server/fields/polygon.js +0 -83
- package/dist/server/helpers/index.d.ts +0 -14
- package/dist/server/helpers/index.js +0 -67
- package/dist/server/index.d.ts +0 -9
- package/dist/server/index.js +0 -42
- package/dist/server/interfaces/index.d.ts +0 -23
- package/dist/server/interfaces/index.js +0 -80
- package/dist/server/plugin.d.ts +0 -19
- package/dist/server/plugin.js +0 -100
- package/dist/server/value-parsers/index.d.ts +0 -21
- package/dist/server/value-parsers/index.js +0 -86
- package/dist/swagger/index.d.ts +0 -85
- package/dist/swagger/index.js +0 -109
|
@@ -1,51 +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 { ISchema } from '@formily/react';
|
|
10
|
-
import { CollectionFieldInterface } from '@nocobase/client';
|
|
11
|
-
export declare class CommonSchema extends CollectionFieldInterface {
|
|
12
|
-
properties: {
|
|
13
|
-
'uiSchema.x-component-props.mapType': {
|
|
14
|
-
title: string;
|
|
15
|
-
type: string;
|
|
16
|
-
required: boolean;
|
|
17
|
-
'x-decorator': string;
|
|
18
|
-
'x-component': string;
|
|
19
|
-
'x-component-props': {
|
|
20
|
-
showSearch: boolean;
|
|
21
|
-
allowClear: boolean;
|
|
22
|
-
};
|
|
23
|
-
'x-disabled': string;
|
|
24
|
-
default: string;
|
|
25
|
-
enum: {
|
|
26
|
-
label: string;
|
|
27
|
-
value: string;
|
|
28
|
-
}[];
|
|
29
|
-
};
|
|
30
|
-
'uiSchema.title': {
|
|
31
|
-
type: string;
|
|
32
|
-
title: string;
|
|
33
|
-
required: boolean;
|
|
34
|
-
'x-decorator': string;
|
|
35
|
-
'x-component': string;
|
|
36
|
-
};
|
|
37
|
-
name: {
|
|
38
|
-
type: string;
|
|
39
|
-
title: string;
|
|
40
|
-
required: boolean;
|
|
41
|
-
'x-disabled': string;
|
|
42
|
-
'x-decorator': string;
|
|
43
|
-
'x-component': string;
|
|
44
|
-
'x-validator': string;
|
|
45
|
-
description: string;
|
|
46
|
-
};
|
|
47
|
-
};
|
|
48
|
-
schemaInitialize(schema: ISchema, { block }: {
|
|
49
|
-
block: any;
|
|
50
|
-
}): void;
|
|
51
|
-
}
|
|
@@ -1,9 +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
|
-
export * from './useMapConfiguration';
|
|
@@ -1,11 +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
|
-
export declare const MapConfigurationResourceKey = "map-configuration";
|
|
10
|
-
export declare const getSSKey: (type: any) => string;
|
|
11
|
-
export declare const useMapConfiguration: (type: string) => any;
|
package/dist/client/index.d.ts
DELETED
|
@@ -1,13 +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 { Plugin } from '@nocobase/client';
|
|
10
|
-
export declare class PluginMapClient extends Plugin {
|
|
11
|
-
load(): Promise<void>;
|
|
12
|
-
}
|
|
13
|
-
export default PluginMapClient;
|
package/dist/client/index.js
DELETED
|
@@ -1,124 +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
|
-
(function(D,s){typeof exports=="object"&&typeof module!="undefined"?s(exports,require("react/jsx-runtime"),require("@nocobase/client"),require("react"),require("@ant-design/icons"),require("@formily/react"),require("ahooks"),require("antd"),require("react-i18next"),require("react-router-dom"),require("lodash"),require("@formily/antd-v5"),require("@formily/shared"),require("@emotion/css")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","@nocobase/client","react","@ant-design/icons","@formily/react","ahooks","antd","react-i18next","react-router-dom","lodash","@formily/antd-v5","@formily/shared","@emotion/css"],s):(D=typeof globalThis!="undefined"?globalThis:D||self,s(D["@nocobase/plugin-map"]={},D.jsxRuntime,D["@nocobase/client"],D.react,D["@ant-design/icons"],D["@formily/react"],D.ahooks,D.antd,D["react-i18next"],D["react-router-dom"],D.lodash,D["@formily/antd-v5"],D["@formily/shared"],D["@emotion/css"]))})(this,function(D,s,n,h,R,N,q,w,ae,ce,Ee,$e,Re,et){"use strict";var Vt=Object.defineProperty,Wt=Object.defineProperties;var Yt=Object.getOwnPropertyDescriptors;var Qe=Object.getOwnPropertySymbols;var Ht=Object.prototype.hasOwnProperty,Jt=Object.prototype.propertyIsEnumerable;var Oe=(D,s,n)=>s in D?Vt(D,s,{enumerable:!0,configurable:!0,writable:!0,value:n}):D[s]=n,F=(D,s)=>{for(var n in s||(s={}))Ht.call(s,n)&&Oe(D,n,s[n]);if(Qe)for(var n of Qe(s))Jt.call(s,n)&&Oe(D,n,s[n]);return D},H=(D,s)=>Wt(D,Yt(s));var O=(D,s,n)=>(Oe(D,typeof s!="symbol"?s+"":s,n),n);var Me=(D,s,n)=>new Promise((h,R)=>{var N=ae=>{try{w(n.next(ae))}catch(ce){R(ce)}},q=ae=>{try{w(n.throw(ae))}catch(ce){R(ce)}},w=ae=>ae.done?h(ae.value):Promise.resolve(ae.value).then(N,q);w((n=n.apply(D,s)).next())});const ge="map";function X(e){return`{{t('${e}', { ns: '${ge}', nsMode: 'fallback' })}}`}function _(){return ae.useTranslation([ge,"client"],{nsMode:"fallback"})}const Le=[{label:X("AMap"),value:"amap"},{label:X("Google Maps"),value:"google"}],Ae="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACYAAAA/CAMAAAC7OkrPAAAAAXNSR0IB2cksfwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAEJQTFRFAAAA8Yti8Yti8Itj8Iti74tj8Itj8YtiKwADKwADKhw5Kh07KwADKwADKwADKwAD4odn1YBlKwADKwADKwADKwAD/5y7LQAAABZ0Uk5TAP/8/f/B/PYOHjY3CCozLP3XCSkvMhA05K4AAAC4SURBVHic7dXLDoIwEIXhwSsoLSrw/q8qbSAiMy3/oivj2czmS5omnVORdapVJJFKBSEL2mrrUurbpdXa5dTH5dXi9tTsGNtX0TFG1OT+7PdY2YdEGd0FuFmUwXWm5UAZbCTKYA3SUrXZQTHLHbUy2OlsMO0ultLsajLlbEWZMEUZ+ig5E6YKM2GqMBOmGKubW1D3ps6g1nnvA5uGa5Os85E9nmF2ebYkzeKhc9wre4V+GMeh317hDfXgCWigIGJbAAAAAElFTkSuQmCC",fe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACYAAAA/CAYAAACM5Lr9AAAFkklEQVR42s3VaWxUVRjG8ddiEKPRxAQTCVSWLnZaWmjpTgulpYUBExP9Agou4IKAogUKAgItlNJCgUIXINFPfsFoDCjibkQRI0QIICAQWUpZugKtpcv0+DxyYqaTe2/vTLf58Etu7znnPf+0k44opQw5i5qsjIFs2APHoBZatFq+02vZeq94yyKs0dOjsAzOTCtuVtNKWtX0UpeaXqHU07tgt4ZnvuMa93Avz/CsniE2WIQV3iEaCDnQ8F/MTgZ4h2d4ljNgmZ4pFszDpmIRIuFP57YWDMcFu7uHMziLMyEKxJBl2MbbM6DZub2NQ3sUZ3K2vkMMGIdNKbi1ADqcZe1q2i7VKzibd8BCEE8GUQ3PQ4ez3KWcGNCbeAfv0neKm85hWRvqo+Hu1LJ2HuwTvAt3tkAciKbDIDO/7iE4l7X9rpqCA30pa3uLwt3nYRAIuIfV5mcWN6msnapf8G405IGQMGry+prB0DiloqPfwng3G3SLDltXnTt5S6PK3NnRr9jAFhDJyLsZAJcz8SGcjOr+xAa0XGGTpOfeSMrYUKcyKlx+gS1oSkbY9VXpm2+rjHKXX2ALm2TS2qq96duaVHp5u19gC5skbc3V05N23FWT8NIfsIVNkra6siGttE2llbX7h9JWhaZ6mfj+lfaJZW3Kn6DJJRNWXWqbgN+Y39jRqtDUKKkrL15PxfdjammrfyhpVmiqlNQVfx9KwX/cFJT6A7awSVLeu1CeUlinxu9o8QsphbUKTWUyfvn5Wcm511QSXvoDtrBJkpedewzaE/E58wdsYZMopSQ55+z+pKK6fo9KKqpXaDkAIgxLWnomK3H1JZVQ0tyv2ICW6XAvLHHJ6QD4K6GgRsVjQ3/g3WzQLffCKGHJqfHgisOXaNy2f/oU7+TdukGIUW5xJ0vic6+oWGzsS7yTd4NoncPiF594GC7FFlSrcVub+gTv4p36btE6h1Fc9nFn7IpzKmZrY5/gXbwTxI0O8xD77rGPYtZeVtE42Jt4B+8C8WAcNu6dPwZDzVh8PYzdcqdXcDbvgMdBPDHEOG7R0Xkxqy6oKAzpDZzNO0AMmIfFvH1kABwZk1epIotv9yjOxOyj+g4xYB4W/dbvlAAdozGsJ3Gmni0mzMPGLvyN6IMo/NojNt/qEZyFmR+CWLAIW3CYaDDUR+D/TTgGdwdncJaeKRbMw8bM/9XdosjlZ5VjU0O3cAZngXTBPCzqzV/cPQAXHeuqVBgu8IVj/TXFGXqWdME8LHLez55mRSw9qUI31fuEZzFjNogNFmFvHPQUACfC8IUbUlTvlbDcSsWzeobYYB42+vWfjDwbnn3c6zCewdnnQGwyD4t47UcjAXA2JO+qCi6ss4V7eUafFZuswn4wM8ex+LgKwqV2cC/OzAXxgnlY+KvfmxkIVaPyr6tRhbWWuId79RnxgnmYY+53VlaHLj2lRm6stRSSc0ph7xoQL1mEzfnWyhPQNrKgGgE1hrjGPTAExEvmYWGvfNOVPUErz6vhiDDCNez5GMQHVmFfd2Vq6MLD6smCGkNc4x4QH5iHPfXyV125H64NX1eFkOpO+I5reo/4wDws9KUDdhSPxFdNIGLc8R3XQHxkFfalHYnB8w6qYRuqO+E7roH4yDws5MX9dtwHlYF5lQi6qYjPfKfXxEcWYbO/sKtsBP50QxFFI/D/De8qQLrBPCwYizY9M2r+of/D+Mx3ID6zDJv1uaVwGfAIBDqGJsbhZ9eQ/BuK+OwYlhzPNe7hXh9Yhe0zwqBB4IAYouCZn1wIXH5GEZ/d1sjBMzzrBfOwoBf2GWFYBMS4C03JWRA087OaoBmf3uCz5zrP8Kx9lmF7jXiE2RbBs95ghB0MIo8/pS0OeJAzvOBLmKY//BAGURBN+jmMa3qPkLdh/wKOL8SpLbnYFgAAAABJRU5ErkJggg==",Te=(e,o,t)=>{const r=o==null?void 0:o.reduce((l,i,a)=>a===o.length-1&&(t==="o2m"||t==="m2m")?l==null?void 0:l.map(m=>m[i]).filter(m=>m!=null):l==null?void 0:l[i],e);return t==="o2m"||t==="m2m"?r:[r]};var tt=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{};function ot(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var De={exports:{}};(function(e,o){(function(t,r){e.exports=r()})(tt,function(){function t(c){var M=[];return c.AMapUI&&M.push(r(c.AMapUI)),c.Loca&&M.push(l(c.Loca)),Promise.all(M)}function r(c){return new Promise(function(M,p){var d=[];if(c.plugins)for(var S=0;S<c.plugins.length;S+=1)a.AMapUI.plugins.indexOf(c.plugins[S])==-1&&d.push(c.plugins[S]);if(m.AMapUI===i.failed)p("前次请求 AMapUI 失败");else if(m.AMapUI===i.notload){m.AMapUI=i.loading,a.AMapUI.version=c.version||a.AMapUI.version,S=a.AMapUI.version;var z=document.body||document.head,K=document.createElement("script");K.type="text/javascript",K.src="https://webapi.amap.com/ui/"+S+"/main.js",K.onerror=function(P){m.AMapUI=i.failed,p("请求 AMapUI 失败")},K.onload=function(){if(m.AMapUI=i.loaded,d.length)window.AMapUI.loadUI(d,function(){for(var P=0,G=d.length;P<G;P++){var j=d[P].split("/").slice(-1)[0];window.AMapUI[j]=arguments[P]}for(M();b.AMapUI.length;)b.AMapUI.splice(0,1)[0]()});else for(M();b.AMapUI.length;)b.AMapUI.splice(0,1)[0]()},z.appendChild(K)}else m.AMapUI===i.loaded?c.version&&c.version!==a.AMapUI.version?p("不允许多个版本 AMapUI 混用"):d.length?window.AMapUI.loadUI(d,function(){for(var P=0,G=d.length;P<G;P++){var j=d[P].split("/").slice(-1)[0];window.AMapUI[j]=arguments[P]}M()}):M():c.version&&c.version!==a.AMapUI.version?p("不允许多个版本 AMapUI 混用"):b.AMapUI.push(function(P){P?p(P):d.length?window.AMapUI.loadUI(d,function(){for(var G=0,j=d.length;G<j;G++){var U=d[G].split("/").slice(-1)[0];window.AMapUI[U]=arguments[G]}M()}):M()})})}function l(c){return new Promise(function(M,p){if(m.Loca===i.failed)p("前次请求 Loca 失败");else if(m.Loca===i.notload){m.Loca=i.loading,a.Loca.version=c.version||a.Loca.version;var d=a.Loca.version,S=a.AMap.version.startsWith("2"),z=d.startsWith("2");if(S&&!z||!S&&z)p("JSAPI 与 Loca 版本不对应!!");else{S=a.key,z=document.body||document.head;var K=document.createElement("script");K.type="text/javascript",K.src="https://webapi.amap.com/loca?v="+d+"&key="+S,K.onerror=function(P){m.Loca=i.failed,p("请求 AMapUI 失败")},K.onload=function(){for(m.Loca=i.loaded,M();b.Loca.length;)b.Loca.splice(0,1)[0]()},z.appendChild(K)}}else m.Loca===i.loaded?c.version&&c.version!==a.Loca.version?p("不允许多个版本 Loca 混用"):M():c.version&&c.version!==a.Loca.version?p("不允许多个版本 Loca 混用"):b.Loca.push(function(P){P?p(P):p()})})}if(!window)throw Error("AMap JSAPI can only be used in Browser.");var i;(function(c){c.notload="notload",c.loading="loading",c.loaded="loaded",c.failed="failed"})(i||(i={}));var a={key:"",AMap:{version:"1.4.15",plugins:[]},AMapUI:{version:"1.1",plugins:[]},Loca:{version:"1.3.2"}},m={AMap:i.notload,AMapUI:i.notload,Loca:i.notload},b={AMap:[],AMapUI:[],Loca:[]},A=[],C=function(c){typeof c=="function"&&(m.AMap===i.loaded?c(window.AMap):A.push(c))};return{load:function(c){return new Promise(function(M,p){if(m.AMap==i.failed)p("");else if(m.AMap==i.notload){var d=c.key,S=c.version,z=c.plugins;d?(window.AMap&&location.host!=="lbs.amap.com"&&p("禁止多种API加载方式混用"),a.key=d,a.AMap.version=S||a.AMap.version,a.AMap.plugins=z||a.AMap.plugins,m.AMap=i.loading,S=document.body||document.head,window.___onAPILoaded=function(P){if(delete window.___onAPILoaded,P)m.AMap=i.failed,p(P);else for(m.AMap=i.loaded,t(c).then(function(){M(window.AMap)}).catch(p);A.length;)A.splice(0,1)[0]()},z=document.createElement("script"),z.type="text/javascript",z.src="https://webapi.amap.com/maps?callback=___onAPILoaded&v="+a.AMap.version+"&key="+d+"&plugin="+a.AMap.plugins.join(","),z.onerror=function(P){m.AMap=i.failed,p(P)},S.appendChild(z)):p("请填写key")}else if(m.AMap==i.loaded)if(c.key&&c.key!==a.key)p("多个不一致的 key");else if(c.version&&c.version!==a.AMap.version)p("不允许多个版本 JSAPI 混用");else{if(d=[],c.plugins)for(S=0;S<c.plugins.length;S+=1)a.AMap.plugins.indexOf(c.plugins[S])==-1&&d.push(c.plugins[S]);d.length?window.AMap.plugin(d,function(){t(c).then(function(){M(window.AMap)}).catch(p)}):t(c).then(function(){M(window.AMap)}).catch(p)}else if(c.key&&c.key!==a.key)p("多个不一致的 key");else if(c.version&&c.version!==a.AMap.version)p("不允许多个版本 JSAPI 混用");else{var K=[];if(c.plugins)for(S=0;S<c.plugins.length;S+=1)a.AMap.plugins.indexOf(c.plugins[S])==-1&&K.push(c.plugins[S]);C(function(){K.length?window.AMap.plugin(K,function(){t(c).then(function(){M(window.AMap)}).catch(p)}):t(c).then(function(){M(window.AMap)}).catch(p)})}})},reset:function(){delete window.AMap,delete window.AMapUI,delete window.Loca,a={key:"",AMap:{version:"1.4.15",plugins:[]},AMapUI:{version:"1.1",plugins:[]},Loca:{version:"1.3.2"}},m={AMap:i.notload,AMapUI:i.notload,Loca:i.notload},b={AMap:[],AMapUI:[],Loca:[]}}}})})(De);var rt=De.exports;const ze=ot(rt),Be="map-configuration",Ce=e=>`NOCOBASE_PLUGIN_MAP_CONFIGURATION_${e}`,Se=e=>{const o=h.useMemo(()=>{const r=sessionStorage.getItem(Ce(e));return r&&JSON.parse(r)},[e]),{data:t}=n.useRequest({resource:Be,action:"get",params:{type:e}},{onSuccess(r){sessionStorage.setItem(Ce(e),JSON.stringify(r==null?void 0:r.data))},refreshOnWindowFocus:!1,refreshDeps:[],manual:!!o});return o||(t==null?void 0:t.data)},nt=e=>{const{aMap:o,toCenter:t}=e,{t:r}=_(),l=h.useRef(),[i,a]=h.useState([]);h.useEffect(()=>{o==null||o.plugin("AMap.PlaceSearch",()=>{l.current=new o.PlaceSearch({city:"全国",pageSize:30})})},[o]);const{run:m}=q.useDebounceFn(A=>{l.current&&l.current.search(A||" ",(C,c)=>{if(C==="complete")a(c.poiList.pois.map(M=>H(F({},M),{label:`${M.name}-${M.address}`,value:M.id})));else{if(C==="no_data"){a([]);return}w.message.error(r("Please configure the AMap securityCode or securityHost correctly"))}})},{wait:300}),b=A=>{const C=i.find(c=>c.value===A);C!=null&&C.location&&t(C.location)};return s.jsx("div",{className:n.css`
|
|
11
|
-
position: absolute;
|
|
12
|
-
top: 10px;
|
|
13
|
-
left: 10px;
|
|
14
|
-
z-index: 10;
|
|
15
|
-
width: calc(100% - 20px);
|
|
16
|
-
`,children:s.jsx(w.Select,{showSearch:!0,allowClear:!0,style:{background:"rgba(255, 255, 255, 0.8)"},placeholder:r("Enter keywords to search"),filterOption:!1,onSearch:m,onSelect:b,options:i,popupMatchSelectWidth:!1})})},Ke=()=>{var C,c;const e=n.useDataBlockHeight(),{token:o}=w.theme.useToken(),{designable:t}=n.useDesignable(),{heightProps:r}=n.useBlockHeightProps()||{},{title:l}=r||{},i=N.useFieldSchema();if(!e)return;const a=Object.keys(((c=(C=i.parent)==null?void 0:C.properties.actions)==null?void 0:c.properties)||{}).length>0,m=t||a?o.paddingLG+o.controlHeight+o.margin:o.paddingLG+o.margin,b=o.paddingLG,A=l?o.fontSizeLG*o.lineHeightLG+o.padding*2-1:0;return e-m-b-A},xe={point:{mouseTool:"marker",propertyKey:"position",overlay:"Marker"},polygon:{mouseTool:"polygon",editor:"PolygonEditor",propertyKey:"path",overlay:"Polygon"},lineString:{mouseTool:"polyline",editor:"PolylineEditor",propertyKey:"path",overlay:"Polyline"},circle:{mouseTool:"circle",editor:"CircleEditor",transformOptions(e){return{center:e.slice(0,2),radius:e[2]}},overlay:"Circle"}},we=h.forwardRef((e,o)=>{const{accessKey:t,securityJsCode:r}=Se(e.mapType)||{},{value:l,onChange:i,block:a=!1,readonly:m,disabled:b=a,zoom:A=13,overlayCommonOptions:C}=e,{t:c}=_(),M=N.useFieldSchema(),p=h.useRef(),d=h.useRef(),S=h.useRef(),[z,K]=h.useState([]),[P,G]=h.useState(""),{getField:j}=n.useCollection_deprecated(),U=h.useMemo(()=>{if(e.type)return e.type;const u=j(M==null?void 0:M.name);return u==null?void 0:u.interface},[e==null?void 0:e.type,M==null?void 0:M.name]),V=h.useRef(),k=h.useRef(null),Q=ce.useNavigate(),J=h.useRef(`nocobase-map-${U||""}-${Date.now().toString(32)}`),{modal:de}=w.App.useApp(),re=Ke(),[W]=h.useState(F({strokeWeight:5,strokeColor:"#4e9bff",fillColor:"#4e9bff",strokeOpacity:1},C));h.useEffect(()=>{d.current&&d.current.setZoom(A)},[A]);const ne=q.useMemoizedFn(()=>{V.current&&V.current.remove()}),se=q.useMemoizedFn(()=>{(!b||a)&&U!=="point"&&k.current&&(k.current.setTarget(V.current),k.current.open())}),le=q.useMemoizedFn((u,f=!1)=>{let y=null;if(U==="point"){const{lat:g,lng:E}=u.getPosition();y=[E,g]}else if(U==="polygon"||U==="lineString"){if(y=u.getPath().map(g=>[g.lng,g.lat]),y.length<2)return}else if(U==="circle"){const g=u.getCenter(),E=u.getRadius();y=[g.lng,g.lat,E]}f||(ne(),V.current=u,se()),i==null||i(y)}),$=q.useMemoizedFn((u=U)=>{const f=xe[u];if(f&&"editor"in f&&!k.current)return k.current=new p.current[f.editor](d.current,null,{createOptions:W,editOptions:W,controlPoint:H(F({},W),{strokeWeight:3}),midControlPoint:H(F({},W),{strokeWeight:2,fillColor:"#fff"})}),k.current.on("adjust",function({target:y}){le(y,!0)}),k.current.on("move",function({target:y}){le(y,!0)}),k.current}),I=q.useMemoizedFn((u=U)=>{var y;if(!S.current||(y=k.current)!=null&&y.getTarget())return;const f=xe[u];f&&S.current[f.mouseTool](F({},W))}),Y=q.useMemoizedFn((u=U)=>{S.current||(S.current=new p.current.MouseTool(d.current),S.current.on("draw",function({obj:f}){le(f)}),I(u))}),B=(u,f)=>{d.current&&d.current.setZoomAndCenter(18,u,f)},Z=()=>{const u=()=>{ne(),k.current&&(k.current.setTarget(),k.current.close()),i==null||i(null)};de.confirm({title:c("Clear the canvas"),content:c("Are you sure to clear the canvas?"),okText:c("Confirm"),cancelText:c("Cancel"),getContainer:()=>document.getElementById(J.current),onOk(){u()}})},x=()=>{V.current&&d.current.setFitView([V.current])},L=h.useCallback((u=U,f=l,y)=>{const g=xe[u];if(!g)return;const E=F(F({},W),y);return"transformOptions"in g?Object.assign(E,g.transformOptions(f)):"propertyKey"in g&&(E[g.propertyKey]=f),new p.current[g.overlay](E)},[W]),v=(u=U,f=l,y)=>{if(!p.current)return;const g=L(u,f,y);return g.setMap(d.current),g};h.useEffect(()=>{if(!p.current||!l||!m&&V.current)return;const u=v();d.current.setFitView([u]),V.current=u,b||($(),se())},[l,z,U,W,b,m]),h.useEffect(()=>{var u,f,y;S.current&&(b?((u=S.current)==null||u.close(),(f=k.current)==null||f.close()):(I(),(y=k.current)==null||y.open()))},[b]),h.useEffect(()=>{!p.current||!U||b||(Y(),$())},[b,z,U]),h.useEffect(()=>{var f,y;if(!l&&(S.current||k.current)&&(ne(),k.current&&(k.current.setTarget(),k.current.close()),i==null||i(null)),!S.current||!k.current)return;k.current.getTarget()?(y=(f=S.current).close)==null||y.call(f):I()},[U,l]),h.useEffect(()=>{if(!t||d.current)return;r&&(window._AMapSecurityConfig={[r.endsWith("_AMapService")?"serviceHOST":"securityJsCode"]:r});const u=window.define;return window.define=void 0,ze.load({key:t,version:"2.0",plugins:["AMap.MouseTool","AMap.PolygonEditor","AMap.PolylineEditor","AMap.CircleEditor"]}).then(f=>(window.define=u,requestIdleCallback(()=>{d.current=new f.Map(J.current,{resizeEnable:!0,zoom:A}),p.current=f,G(""),K([])}))).catch(f=>{typeof f=="string"?f.includes("多个不一致的 key")?G(c("The AccessKey is incorrect, please check it")):G(f):(f==null?void 0:f.type)==="error"&&G("Something went wrong, please refresh the page and try again")}),()=>{var f;(f=d.current)==null||f.destroy(),p.current=null,d.current=null,S.current=null,k.current=null,ze.reset()}},[t,U,r]),h.useImperativeHandle(o,()=>({setOverlay:v,getOverlay:L,createMouseTool:Y,createEditor:$,executeMouseTool:I,aMap:p.current,map:d.current,overlay:V.current,mouseTool:()=>S.current,editor:()=>k.current,errMessage:P}));const T=n.useApp();return!t||P?s.jsx(w.Alert,{action:s.jsx(w.Button,{type:"primary",onClick:()=>Q(T.pluginSettingsManager.getRoutePath("map")),children:c("Go to the configuration page")}),message:P||c("Please configure the AccessKey and SecurityJsCode first"),type:"error"}):s.jsxs("div",{className:n.css`
|
|
17
|
-
position: relative;
|
|
18
|
-
height: ${re||500}px !important;
|
|
19
|
-
`,id:J.current,style:e==null?void 0:e.style,children:[!p.current&&s.jsx("div",{className:n.css`
|
|
20
|
-
position: absolute;
|
|
21
|
-
inset: 0;
|
|
22
|
-
display: flex;
|
|
23
|
-
align-items: center;
|
|
24
|
-
justify-content: center;
|
|
25
|
-
`,children:s.jsx(w.Spin,{})}),b?null:s.jsxs(s.Fragment,{children:[s.jsx(nt,{toCenter:B,aMap:p.current}),s.jsx("div",{className:n.css`
|
|
26
|
-
position: absolute;
|
|
27
|
-
bottom: 80px;
|
|
28
|
-
right: 20px;
|
|
29
|
-
z-index: 10;
|
|
30
|
-
`,children:s.jsx(w.Button,{onClick:x,disabled:!V.current,type:"primary",shape:"round",size:"large",icon:s.jsx(R.SyncOutlined,{})})}),U!=="point"?s.jsx("div",{className:n.css`
|
|
31
|
-
position: absolute;
|
|
32
|
-
bottom: 20px;
|
|
33
|
-
left: 10px;
|
|
34
|
-
z-index: 2;
|
|
35
|
-
pointer-events: none;
|
|
36
|
-
`,children:s.jsx(w.Alert,{message:c("Click to select the starting point and double-click to end the drawing"),type:"info"})}):null,s.jsx("div",{className:n.css`
|
|
37
|
-
position: absolute;
|
|
38
|
-
bottom: 20px;
|
|
39
|
-
right: 20px;
|
|
40
|
-
z-index: 2;
|
|
41
|
-
`,children:s.jsx(w.Button,{disabled:!l,style:{height:"40px"},onClick:Z,type:"primary",danger:!0,children:c("Clear")})})]})]})});we.displayName="AMapComponent";const st=e=>{var $,I,Y,B,Z;const{collectionField:o,fieldNames:t,dataSource:r,fixedBlock:l,zoom:i,setSelectedRecordKeys:a,lineSort:m}=n.useProps(e),{name:b,getPrimaryKey:A}=n.useCollection_deprecated(),{getCollectionJoinField:C}=n.useCollectionManager_deprecated(),c=A(),[M,p]=h.useState(!1),d=h.useRef(),S=(I=($=d.current)==null?void 0:$.aMap)==null?void 0:I.GeometryUtil,[z,K]=h.useState(),[P,G]=h.useState(""),{t:j}=_(),U=n.useCompile(),{isConnected:V,doFilter:k}=n.useFilterAPI(),[,Q]=h.useState(null),J=h.useRef(P);J.current=P;const{fields:de}=n.useCollection(),re=(Y=de.find(x=>x.name===(t==null?void 0:t.marker)))==null?void 0:Y.uiSchema,W=(x,L)=>{const v=x.getExtData(),T=typeof L=="undefined"?v.selected:!L;v.selected=!T,"setIcon"in x&&x.setIcon(new d.current.aMap.Icon({imageSize:[19,32],image:T?fe:Ae})),x.setOptions(F({extData:v},T?{strokeColor:"#4e9bff",fillColor:"#4e9bff"}:{strokeColor:"#F18b62",fillColor:"#F18b62"}))},ne=()=>{var x,L,v;d.current&&((x=d.current)==null||x.mouseTool().close(!0),(L=d.current)==null||L.editor().setTarget(null),(v=d.current)==null||v.editor().close())};h.useEffect(()=>{var x,L,v,T;if(P==="selection")return(x=d.current)!=null&&x.editor()?(T=d.current)==null||T.executeMouseTool("polygon"):((L=d.current)==null||L.createEditor("polygon"),(v=d.current)==null||v.createMouseTool("polygon")),()=>{ne()}},[P]),h.useEffect(()=>{if(P)return()=>{var x;J.current||(x=d.current)==null||x.map.getAllOverlays().forEach(L=>{W(L,!1)})}},[P]);const se=q.useMemoizedFn(()=>{var u,f,y;const x=(u=d.current)==null?void 0:u.editor().getTarget(),L=(f=d.current)==null?void 0:f.map.getAllOverlays(),v=L==null?void 0:L.filter(g=>{if(!(g===x||g.getExtData().id===void 0))return"getPosition"in g?S.isPointInRing(g.getPosition(),x==null?void 0:x.getPath()):S.doesRingRingIntersect(g.getPath(),x==null?void 0:x.getPath())}),T=v==null?void 0:v.map(g=>(W(g,!0),g.getExtData().id));a(g=>T==null?void 0:T.concat(g)),x==null||x.remove(),(y=d.current)==null||y.editor().close()});h.useEffect(()=>{var u,f,y;if(!o||!d.current||!r)return;const x=Array.isArray(t==null?void 0:t.field)&&(t==null?void 0:t.field.length)>1?t==null?void 0:t.field.slice(0,-1):t==null?void 0:t.field,L=C([b,...x].flat().join(".")),v=r.map(g=>{var te;const E=(te=Te(g,t==null?void 0:t.field,L==null?void 0:L.interface))==null?void 0:te.filter(Boolean),ee=n.getLabelFormatValue(re,g[t.marker]);return E!=null&&E.length?E.map(ie=>{var oe;return(oe=d.current)==null?void 0:oe.setOverlay(o.type,ie,{strokeColor:"#4e9bff",fillColor:"#4e9bff",cursor:"pointer",label:{direction:"bottom",offset:[0,5],content:t!=null&&t.marker?U(ee):void 0},extData:{id:g[c]}})}):[]}).flat().filter(Boolean);(f=(u=d.current)==null?void 0:u.map)==null||f.setFitView(v);const T=v.map(g=>{const E=ee=>{const te=ee.target,ie=te.getExtData();if(!ie)return;if(J.current){J.current==="click"&&(a(oe=>ie.selected?oe.filter(Fe=>Fe!==ie.id):[...oe,ie.id]),W(te));return}const ve=r.find(oe=>ie.id===oe[c]);if(V){Q(oe=>(oe&&Ue(oe),oe===g?(Ue(g),k(null),null):(at(g),k(ve[c],Fe=>Fe.field||c,"$eq"),g)));return}ve&&K(ve)};return g.on("click",E),()=>g.off("click",E)});if(o.type==="point"&&(m!=null&&m.length)&&(v==null?void 0:v.length)>1){const g=v.map(ee=>ee.getPosition());v[0].setzIndex(13),v[v.length-1].setzIndex(13);const E=(ee=!0)=>{var te,ie;if((te=d.current)!=null&&te.map)return new AMap.Text({label:{direction:"top",offset:[0,0],content:j(ee?"Start point":"End point")},position:g[ee?0:g.length-1],map:(ie=d.current)==null?void 0:ie.map})};v.push(...[(y=d.current)==null?void 0:y.setOverlay("lineString",g,{strokeColor:"#4e9bff",fillColor:"#4e9bff",strokeWeight:2,cursor:"pointer"}),E(),E(!1)].filter(Boolean))}return()=>{v.forEach(g=>{g.remove()}),T.forEach(g=>g())}},[r,M,t,b,c,o.type,V,m]),h.useEffect(()=>{setTimeout(()=>{a([])})},[r]);const le=x=>{d.current=x,p(!!(x!=null&&x.map)&&!x.errMessage)};return s.jsxs("div",{className:n.css`
|
|
42
|
-
position: relative;
|
|
43
|
-
height: 100%;
|
|
44
|
-
`,children:[s.jsx("div",{className:n.css`
|
|
45
|
-
position: absolute;
|
|
46
|
-
left: 10px;
|
|
47
|
-
top: 10px;
|
|
48
|
-
z-index: 999;
|
|
49
|
-
`,children:M&&!((B=d.current)!=null&&B.errMessage)?s.jsxs(w.Space,{direction:"vertical",children:[s.jsx(w.Button,{style:{color:P?void 0:"#F18b62",borderColor:"currentcolor"},onClick:x=>{x.stopPropagation(),G("")},icon:s.jsx(R.EnvironmentOutlined,{})}),s.jsx(w.Button,{style:{color:P==="selection"?"#F18b62":void 0,borderColor:"currentcolor"},onClick:x=>{x.stopPropagation(),G("selection")},icon:s.jsx(R.ExpandOutlined,{})}),P==="selection"?s.jsx(w.Button,{type:"primary",icon:s.jsx(R.CheckOutlined,{}),title:j("Confirm selection"),onClick:se}):null]}):null}),s.jsx(it,{record:z,setVisible:K}),s.jsx(we,H(F({},(Z=o==null?void 0:o.uiSchema)==null?void 0:Z["x-component-props"]),{ref:le,style:{height:l?"100%":null},zoom:i,disabled:!0,block:!0,overlayCommonOptions:{strokeColor:"#F18b62",fillColor:"#F18b62"}}))]})},it=e=>{const{setVisible:o,record:t}=e;_();const r=n.useCollection(),l=n.useCollectionParentRecordData(),i=N.useFieldSchema(),a=h.useMemo(()=>i.reduceProperties((m,b)=>b.name==="drawer"?b:m,null),[i]);return a&&s.jsx(n.ActionContextProvider,{value:{visible:!!t,setVisible:o},children:s.jsx(n.RecordProvider,{record:t,parent:l,children:s.jsx(n.VariablePopupRecordProvider,{recordData:t,collection:r,children:s.jsx(N.RecursionField,{schema:a,name:a.name})})})})};function Ue(e){e.dom?e.dom.style.filter="none":e.setOptions&&e.setOptions({strokeColor:"#4e9bff",fillColor:"#4e9bff"})}function at(e){e.dom?e.dom.style.filter="brightness(1.2) contrast(1.2) hue-rotate(180deg)":e.setOptions&&e.setOptions({strokeColor:"#F18b62",fillColor:"#F18b62"})}const Ne=({type:e,children:o})=>{const{t}=_(),[r,l]=q.useBoolean(!1),i=n.useAPIClient(),[a]=w.Form.useForm(),m=Se(e);h.useEffect(()=>{m&&(a.setFieldsValue(m),l.toggle())},[m]);const b=h.useMemo(()=>i.resource(Be),[i]),A=C=>{b.set(H(F({},C),{type:e})).then(c=>{sessionStorage.removeItem(Ce(e)),l.toggle(),w.message.success(t("Saved successfully"))}).catch(c=>{w.message.success(t("Saved failed"))})};return s.jsxs(w.Form,{disabled:r,form:a,layout:"vertical",onFinish:A,children:[o,r?s.jsx(w.Button,{disabled:!1,onClick:l.toggle,children:t("Edit")}):s.jsx(w.Form.Item,{children:s.jsx(w.Button,{disabled:!1,type:"primary",htmlType:"submit",children:t("Save")})})]})},lt={amap:()=>{const{t:e}=_();return s.jsxs(Ne,{type:"amap",children:[s.jsx(w.Form.Item,{required:!0,name:"accessKey",label:e("Access key"),children:s.jsx(w.Input,{})}),s.jsx(w.Form.Item,{required:!0,name:"securityJsCode",label:e("securityJsCode or serviceHost"),children:s.jsx(w.Input,{})})]})},google:()=>{const{t:e}=_();return s.jsx(Ne,{type:"google",children:s.jsx(w.Form.Item,{required:!0,name:"accessKey",label:e("Api key"),children:s.jsx(w.Input,{})})})}},ct=Le.map(e=>H(F({},e),{component:lt[e.value]})),pt=()=>{const e=n.useCompile(),o=ce.useLocation(),t=new URLSearchParams(o.search);return s.jsx(w.Card,{bordered:!0,children:s.jsx(w.Tabs,{type:"card",defaultActiveKey:t.get("tab"),children:ct.map(r=>s.jsx(w.Tabs.TabPane,{tab:e(r.label),children:s.jsx(r.component,{type:r.value})},r.value))})})};/*! *****************************************************************************
|
|
50
|
-
Copyright (c) Microsoft Corporation.
|
|
51
|
-
|
|
52
|
-
Permission to use, copy, modify, and/or distribute this software for any
|
|
53
|
-
purpose with or without fee is hereby granted.
|
|
54
|
-
|
|
55
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
56
|
-
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
57
|
-
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
58
|
-
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
59
|
-
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
60
|
-
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
61
|
-
PERFORMANCE OF THIS SOFTWARE.
|
|
62
|
-
***************************************************************************** */function ut(e,o,t,r){function l(i){return i instanceof t?i:new t(function(a){a(i)})}return new(t||(t=Promise))(function(i,a){function m(C){try{A(r.next(C))}catch(c){a(c)}}function b(C){try{A(r.throw(C))}catch(c){a(c)}}function A(C){C.done?i(C.value):l(C.value).then(m,b)}A((r=r.apply(e,o||[])).next())})}var dt=function e(o,t){if(o===t)return!0;if(o&&t&&typeof o=="object"&&typeof t=="object"){if(o.constructor!==t.constructor)return!1;var r,l,i;if(Array.isArray(o)){if(r=o.length,r!=t.length)return!1;for(l=r;l--!==0;)if(!e(o[l],t[l]))return!1;return!0}if(o.constructor===RegExp)return o.source===t.source&&o.flags===t.flags;if(o.valueOf!==Object.prototype.valueOf)return o.valueOf()===t.valueOf();if(o.toString!==Object.prototype.toString)return o.toString()===t.toString();if(i=Object.keys(o),r=i.length,r!==Object.keys(t).length)return!1;for(l=r;l--!==0;)if(!Object.prototype.hasOwnProperty.call(t,i[l]))return!1;for(l=r;l--!==0;){var a=i[l];if(!e(o[a],t[a]))return!1}return!0}return o!==o&&t!==t};const Ge="__googleMapsScriptId";var me;(function(e){e[e.INITIALIZED=0]="INITIALIZED",e[e.LOADING=1]="LOADING",e[e.SUCCESS=2]="SUCCESS",e[e.FAILURE=3]="FAILURE"})(me||(me={}));class pe{constructor({apiKey:o,authReferrerPolicy:t,channel:r,client:l,id:i=Ge,language:a,libraries:m=[],mapIds:b,nonce:A,region:C,retries:c=3,url:M="https://maps.googleapis.com/maps/api/js",version:p}){if(this.callbacks=[],this.done=!1,this.loading=!1,this.errors=[],this.apiKey=o,this.authReferrerPolicy=t,this.channel=r,this.client=l,this.id=i||Ge,this.language=a,this.libraries=m,this.mapIds=b,this.nonce=A,this.region=C,this.retries=c,this.url=M,this.version=p,pe.instance){if(!dt(this.options,pe.instance.options))throw new Error(`Loader must not be called again with different options. ${JSON.stringify(this.options)} !== ${JSON.stringify(pe.instance.options)}`);return pe.instance}pe.instance=this}get options(){return{version:this.version,apiKey:this.apiKey,channel:this.channel,client:this.client,id:this.id,libraries:this.libraries,language:this.language,region:this.region,mapIds:this.mapIds,nonce:this.nonce,url:this.url,authReferrerPolicy:this.authReferrerPolicy}}get status(){return this.errors.length?me.FAILURE:this.done?me.SUCCESS:this.loading?me.LOADING:me.INITIALIZED}get failed(){return this.done&&!this.loading&&this.errors.length>=this.retries+1}createUrl(){let o=this.url;return o+="?callback=__googleMapsCallback",this.apiKey&&(o+=`&key=${this.apiKey}`),this.channel&&(o+=`&channel=${this.channel}`),this.client&&(o+=`&client=${this.client}`),this.libraries.length>0&&(o+=`&libraries=${this.libraries.join(",")}`),this.language&&(o+=`&language=${this.language}`),this.region&&(o+=`®ion=${this.region}`),this.version&&(o+=`&v=${this.version}`),this.mapIds&&(o+=`&map_ids=${this.mapIds.join(",")}`),this.authReferrerPolicy&&(o+=`&auth_referrer_policy=${this.authReferrerPolicy}`),o}deleteScript(){const o=document.getElementById(this.id);o&&o.remove()}load(){return this.loadPromise()}loadPromise(){return new Promise((o,t)=>{this.loadCallback(r=>{r?t(r.error):o(window.google)})})}importLibrary(o){return this.execute(),google.maps.importLibrary(o)}loadCallback(o){this.callbacks.push(o),this.execute()}setScript(){var o,t;if(document.getElementById(this.id)){this.callback();return}const r={key:this.apiKey,channel:this.channel,client:this.client,libraries:this.libraries.length&&this.libraries,v:this.version,mapIds:this.mapIds,language:this.language,region:this.region,authReferrerPolicy:this.authReferrerPolicy};Object.keys(r).forEach(i=>!r[i]&&delete r[i]),!((t=(o=window==null?void 0:window.google)===null||o===void 0?void 0:o.maps)===null||t===void 0)&&t.importLibrary||(i=>{let a,m,b,A="The Google Maps JavaScript API",C="google",c="importLibrary",M="__ib__",p=document,d=window;d=d[C]||(d[C]={});const S=d.maps||(d.maps={}),z=new Set,K=new URLSearchParams,P=()=>a||(a=new Promise((G,j)=>ut(this,void 0,void 0,function*(){var U;yield m=p.createElement("script"),m.id=this.id,K.set("libraries",[...z]+"");for(b in i)K.set(b.replace(/[A-Z]/g,V=>"_"+V[0].toLowerCase()),i[b]);K.set("callback",C+".maps."+M),m.src=this.url+"?"+K,S[M]=G,m.onerror=()=>a=j(Error(A+" could not load.")),m.nonce=this.nonce||((U=p.querySelector("script[nonce]"))===null||U===void 0?void 0:U.nonce)||"",p.head.append(m)})));S[c]?console.warn(A+" only loads once. Ignoring:",i):S[c]=(G,...j)=>z.add(G)&&P().then(()=>S[c](G,...j))})(r);const l=this.libraries.map(i=>this.importLibrary(i));l.length||l.push(this.importLibrary("core")),Promise.all(l).then(()=>this.callback(),i=>{const a=new ErrorEvent("error",{error:i});this.loadErrorCallback(a)})}reset(){this.deleteScript(),this.done=!1,this.loading=!1,this.errors=[],this.onerrorEvent=null}resetIfRetryingFailed(){this.failed&&this.reset()}loadErrorCallback(o){if(this.errors.push(o),this.errors.length<=this.retries){const t=this.errors.length*Math.pow(2,this.errors.length);console.error(`Failed to load Google Maps script, retrying in ${t} ms.`),setTimeout(()=>{this.deleteScript(),this.setScript()},t)}else this.onerrorEvent=o,this.callback()}callback(){this.done=!0,this.loading=!1,this.callbacks.forEach(o=>{o(this.onerrorEvent)}),this.callbacks=[]}execute(){if(this.resetIfRetryingFailed(),this.done)this.callback();else{if(window.google&&window.google.maps&&window.google.maps.version){console.warn("Google Maps already loaded outside @googlemaps/js-api-loader.This may result in undesirable behavior as options and script parameters may not match."),this.callback();return}this.loading||(this.loading=!0,this.setScript())}}}const ft=e=>{const{toCenter:o,mapRef:t}=e,{t:r}=_(),l=h.useRef(),[i,a]=h.useState([]);h.useEffect(()=>{google.maps.importLibrary("places").then(A=>{l.current=new A.AutocompleteService}).catch(()=>{w.message.error("Please configure the Google API Key correctly")})},[t]);const{run:m}=q.useDebounceFn(A=>{l.current&&l.current.getPlacePredictions({input:A||" "},(C,c)=>{if(c===google.maps.places.PlacesServiceStatus.OK)a(C.map(M=>{const p=M.structured_formatting;return H(F({},M),{label:`${p.main_text}${p.secondary_text?" "+p.secondary_text:""}`,value:M.place_id})}));else{a([]);return}})},{wait:300}),b=A=>{const C=i.find(M=>M.value===A);new google.maps.places.PlacesService(t.current).getDetails({placeId:C.place_id,fields:["geometry"]},(M,p)=>{p===google.maps.places.PlacesServiceStatus.OK&&o(M.geometry.location)})};return s.jsx("div",{className:n.css`
|
|
63
|
-
position: absolute;
|
|
64
|
-
top: 10px;
|
|
65
|
-
left: 10px;
|
|
66
|
-
z-index: 10;
|
|
67
|
-
width: calc(100% - 20px);
|
|
68
|
-
`,children:s.jsx(w.Select,{id:"google-map-search",showSearch:!0,allowClear:!0,style:{background:"rgba(255, 255, 255, 0.8)"},placeholder:r("Enter keywords to search"),filterOption:!1,onSearch:m,onSelect:b,options:i})})},ue=e=>({url:e,scaledSize:{width:19,height:32},labelOrigin:new google.maps.Point(19/2,42)}),mt=()=>new Promise(e=>{const o=()=>{e({lat:37.4224764,lng:-122.0842499})};navigator.geolocation?navigator.geolocation.getCurrentPosition(t=>{const{latitude:r,longitude:l}=t.coords;e({lat:r,lng:l})},()=>{o()}):o()}),gt=e=>e==="point"?"marker":e==="lineString"?"polyline":e,ht={point:{propertyKey:"position",overlay:"Marker"},polygon:{propertyKey:"paths",overlay:"Polygon"},lineString:{propertyKey:"path",overlay:"Polyline"},circle:{transformOptions(e){return{center:new google.maps.LatLng(e[1],e[0]),radius:e[2]}},overlay:"Circle"}},Pe=h.forwardRef((e,o)=>{const{value:t,onChange:r,block:l=!1,readonly:i,disabled:a=l,zoom:m=13,overlayCommonOptions:b}=e,{accessKey:A}=Se(e.mapType)||{},{t:C}=_(),{getField:c}=n.useCollection_deprecated(),M=N.useFieldSchema(),p=h.useRef(),d=h.useRef(),S=h.useRef(),[z,K]=h.useState([]),[P,G]=h.useState(""),j=n.useAPIClient(),{modal:U}=w.App.useApp(),V=Ke();h.useEffect(()=>{d.current&&d.current.setZoom(m)},[m]);const k=h.useMemo(()=>{if(e.type)return e.type;const u=c(M==null?void 0:M.name);return u==null?void 0:u.interface},[e==null?void 0:e.type,M==null?void 0:M.name]),Q=h.useRef(gt(k)),[J]=h.useState(F({strokeWeight:5,strokeColor:"#4e9bff",fillColor:"#4e9bff",strokeOpacity:1,editable:!a,draggable:!a},b)),de=ce.useNavigate(),re=h.useRef(),W=h.useRef(new Set),ne=q.useMemoizedFn(u=>{if(W.current.forEach(f=>{W.current.delete(f)}),"getPath"in u){const f=u.getPath();["insert_at","remove_at","set_at"].forEach(y=>{W.current.add(f.addListener(y,()=>{B(u,!0)}).remove)})}else u instanceof google.maps.Circle&&["center_changed","radius_changed"].forEach(f=>{W.current.add(u.addListener(f,()=>{B(u,!0)}).remove)})}),se=q.useMemoizedFn(()=>{var u;S.current&&(S.current.unbindAll(),S.current.setMap(null)),k!=="point"&&((u=p.current)==null||u.setDrawingMode(null))}),le=q.useMemoizedFn(u=>{d.current&&(d.current.setCenter(u),d.current.setZoom(m))}),$=q.useMemoizedFn(u=>{se(),ne(u),S.current=u}),I=q.useMemoizedFn(u=>{const f=new google.maps.LatLngBounds;u.forEach(y=>{if(y instanceof google.maps.Marker)f.extend(y.getPosition());else if(y instanceof google.maps.Polyline||y instanceof google.maps.Polygon){const g=y.getPath();for(let E=0;E<g.getLength();E++)f.extend(g.getAt(E))}else y instanceof google.maps.Circle&&f.union(y.getBounds())}),d.current.setCenter(f.getCenter())}),Y=()=>{S.current&&I([S.current])},B=q.useMemoizedFn((u,f=!1)=>{let y=null;if(k==="point"){const{lat:g,lng:E}=u.getPosition();y=[E(),g()]}else if(k==="polygon"||k==="lineString"){if(y=u.getPath().getArray().map(g=>[g.lng(),g.lat()]),y.length<2)return}else if(k==="circle"){const g=u.getCenter(),E=u.getRadius();y=[g.lng(),g.lat(),E]}f||$(u),r==null||r(y)}),Z=q.useMemoizedFn((u=!1,f)=>{const y=H(F(F({},J),f),{map:d.current});return p.current=new google.maps.drawing.DrawingManager({drawingMode:Q.current,drawingControl:!1,markerOptions:H(F({},y),{icon:ue(fe)}),polygonOptions:y,polylineOptions:y,circleOptions:y,map:d.current}),u||p.current.addListener("overlaycomplete",g=>{const E=g.overlay;B(E)}),p.current}),x=q.useMemoizedFn((u=k,f=t,y)=>{const g=ht[u];if(!g)return;const E=F(H(F({},J),{icon:ue(fe)}),y);return"transformOptions"in g?Object.assign(E,g.transformOptions(f)):"propertyKey"in g&&(E[g.propertyKey]=Array.isArray(f[0])?f.map(te=>new google.maps.LatLng(te[1],te[0])):new google.maps.LatLng(f[1],f[0])),new google.maps[g.overlay](E)}),L=q.useMemoizedFn((u=k,f=t,y)=>d.current?x(u,f,H(F({},y),{map:d.current})):void 0);h.useEffect(()=>{var f,y;if(!t&&d.current&&(se(),(y=(f=p==null?void 0:p.current)==null?void 0:f.setDrawingMode)==null||y.call(f,Q.current),r==null||r(null)),!d.current||!t||!i&&S.current)return;const u=L();$(u),I([u])},[t,z,k,a,i,L,I,$]),h.useEffect(()=>{if(!A||d.current||!re.current)return;let u;try{u=new pe({apiKey:A,version:"weekly",language:j.auth.getLocale()})}catch(y){G(C("Load google maps failed, Please check the Api key and refresh the page"));return}const f=console.error;return console.error=(y,...g)=>{y!=null&&y.includes("InvalidKeyMapError")&&G(C("Load google maps failed, Please check the Api key and refresh the page")),f(y,...g)},Promise.all([u.importLibrary("drawing"),u.importLibrary("core"),u.importLibrary("geometry")]).then(y=>Me(this,null,function*(){const g=yield mt();d.current=new google.maps.Map(re.current,{zoom:m,center:g,mapTypeId:google.maps.MapTypeId.ROADMAP,zoomControl:!1,streetViewControl:!1,panControl:!1,mapTypeControl:!1,fullscreenControl:!1}),G(""),K([])})).catch(y=>{if(y instanceof Error){G(y.message);return}}),()=>{var y,g;(y=d.current)==null||y.unbindAll(),d.current=null,(g=p.current)==null||g.unbindAll()}},[A,j.auth,k,m]),h.useEffect(()=>{!d.current||!k||a||p.current||Z()},[Z,a,z,k]),h.useImperativeHandle(o,()=>({setOverlay:L,getOverlay:x,setFitView:I,createDraw:Z,map:d.current,overlay:S.current,drawingManager:p.current,errMessage:P}));const v=q.useMemoizedFn(()=>{const u=()=>{se(),p.current.setDrawingMode(Q.current),r==null||r(null)};U.confirm({title:C("Clear the canvas"),content:C("Are you sure to clear the canvas?"),okText:C("Confirm"),cancelText:C("Cancel"),getContainer:()=>re.current,onOk(){u()}})}),T=n.useApp();return!A||P?s.jsx(w.Alert,{action:s.jsx(w.Button,{type:"primary",onClick:()=>de(T.pluginSettingsManager.getRoutePath("map")+"?tab=google"),children:C("Go to the configuration page")}),message:P||C("Please configure the Api key first"),type:"error"}):s.jsxs("div",{className:n.css`
|
|
69
|
-
position: relative;
|
|
70
|
-
height: ${V||500}px !important;
|
|
71
|
-
`,children:[!d.current&&s.jsx("div",{className:n.css`
|
|
72
|
-
position: absolute;
|
|
73
|
-
inset: 0;
|
|
74
|
-
display: flex;
|
|
75
|
-
align-items: center;
|
|
76
|
-
justify-content: center;
|
|
77
|
-
`,children:s.jsx(w.Spin,{})}),a?null:s.jsxs(s.Fragment,{children:[d.current&&s.jsx(ft,{toCenter:le,mapRef:d}),s.jsx("div",{className:n.css`
|
|
78
|
-
position: absolute;
|
|
79
|
-
bottom: 80px;
|
|
80
|
-
right: 20px;
|
|
81
|
-
z-index: 10;
|
|
82
|
-
`,children:s.jsx(w.Button,{onClick:Y,disabled:!S.current,type:"primary",shape:"round",size:"large",icon:s.jsx(R.SyncOutlined,{})})}),k==="lineString"||k==="polygon"?s.jsx("div",{className:n.css`
|
|
83
|
-
position: absolute;
|
|
84
|
-
bottom: 20px;
|
|
85
|
-
left: 10px;
|
|
86
|
-
z-index: 2;
|
|
87
|
-
pointer-events: none;
|
|
88
|
-
`,children:s.jsx(w.Alert,{message:C("Click to select the starting point and double-click to end the drawing"),type:"info"})}):null,s.jsx("div",{className:n.css`
|
|
89
|
-
position: absolute;
|
|
90
|
-
bottom: 20px;
|
|
91
|
-
right: 20px;
|
|
92
|
-
z-index: 2;
|
|
93
|
-
`,children:s.jsx(w.Button,{disabled:!t,style:{height:"40px"},onClick:v,type:"primary",danger:!0,children:C("Clear")})})]}),s.jsx("div",{ref:re,className:n.css`
|
|
94
|
-
width: 100%;
|
|
95
|
-
height: 100%;
|
|
96
|
-
`,style:e==null?void 0:e.style})]})});Pe.displayName="GoogleMapsComponent";const he="google-maps-overlay-id",qe="google-maps-overlay-selected",yt=n.css`
|
|
97
|
-
margin-top: 6px;
|
|
98
|
-
padding: 2px 4px;
|
|
99
|
-
background: #fff;
|
|
100
|
-
border: 1px solid #0000f5;
|
|
101
|
-
`,bt=n.css`
|
|
102
|
-
margin-top: -64px;
|
|
103
|
-
padding: 2px 4px;
|
|
104
|
-
background: #fff;
|
|
105
|
-
border: 1px solid #0000f5;
|
|
106
|
-
`,vt=e=>{var $;const{collectionField:o,fieldNames:t,dataSource:r,fixedBlock:l,zoom:i,setSelectedRecordKeys:a,lineSort:m}=n.useProps(e),{getPrimaryKey:b}=n.useCollection_deprecated(),A=b(),{marker:C="id"}=t,[c,M]=h.useState(!1),p=h.useRef(),[d,S]=h.useState(),[z,K]=h.useState(""),{t:P}=_(),G=n.useCompile(),{isConnected:j,doFilter:U}=n.useFilterAPI(),[,V]=h.useState(null),k=h.useRef(z),Q=h.useRef(null),J=h.useRef([]);k.current=z;const{fields:de}=n.useCollection(),re=($=de.find(I=>I.name===(t==null?void 0:t.marker)))==null?void 0:$.uiSchema,{getCollectionJoinField:W}=n.useCollectionManager_deprecated(),ne=(I,Y)=>{const B=typeof Y!="undefined"?!Y:I.get(qe);I.set(qe,!B),I.setOptions(F({},B?{icon:ue(fe),strokeColor:"#4e9bff",fillColor:"#4e9bff"}:{icon:ue(Ae),strokeColor:"#F18b62",fillColor:"#F18b62"}))};h.useEffect(()=>{var Y,B,Z,x;if(z!=="selection")return;p.current&&!((Y=p.current)!=null&&Y.drawingManager)&&(p.current.drawingManager=(B=p.current)==null?void 0:B.createDraw(!0,{editable:!0,draggable:!0}));const I=new Set;return(Z=p.current)==null||Z.drawingManager.setDrawingMode(google.maps.drawing.OverlayType.POLYGON),(x=p.current)==null||x.drawingManager.addListener("overlaycomplete",L=>{var u;const v=L.overlay;(u=p.current)==null||u.drawingManager.setDrawingMode(null),Q.current=v;const T=v.getPath();["insert_at","remove_at","set_at"].forEach(f=>{I.add(T.addListener(f,()=>{}).remove)})}),()=>{var L,v,T,u;I.forEach(f=>{f()}),p.current&&((L=Q.current)==null||L.unbindAll(),(v=Q.current)==null||v.setMap(null),Q.current=null,(T=p.current)==null||T.drawingManager.setDrawingMode(null),(u=p.current)==null||u.drawingManager.unbindAll())}},[z]),h.useEffect(()=>{if(z)return()=>{k.current||J.current.forEach(I=>{ne(I,!1)})}},[z]);const se=q.useMemoizedFn(()=>{var L;const I=Q.current,Y=J.current,B=google.maps.geometry.poly,x=Y.filter(v=>{if(!(v===I||v.get(he)===void 0))return v instanceof google.maps.Marker?B.containsLocation(v.getPosition(),I):v instanceof google.maps.Circle?B.containsLocation(v.getCenter(),I):v.getPath().getArray().some(T=>B.containsLocation(T,I))}).map(v=>(ne(v,!0),v.get(he)));a(v=>x.concat(v)),I==null||I.unbindAll(),I==null||I.setMap(null),(L=p.current)==null||L.drawingManager.setDrawingMode(google.maps.drawing.OverlayType.POLYGON)});h.useEffect(()=>{var x,L;if(!o||!(r!=null&&r.length)||!((x=p.current)!=null&&x.map))return;const I=Array.isArray(t==null?void 0:t.field)&&(t==null?void 0:t.field.length)>1?t==null?void 0:t.field.slice(0,-1):t==null?void 0:t.field,Y=W([name,...I].flat().join(".")),B=r.map(v=>{const T=Te(v,t==null?void 0:t.field,Y==null?void 0:Y.interface),u=n.getLabelFormatValue(re,v[t.marker]);return T!=null&&T.length?T==null?void 0:T.filter(Boolean).map(f=>{var g;if(!T)return;const y=(g=p.current)==null?void 0:g.setOverlay(o.type,f,{strokeColor:"#4e9bff",fillColor:"#4e9bff",cursor:"pointer",label:{className:yt,fontFamily:"inherit",fontSize:"13px",color:"#333",text:t!=null&&t.marker?G(u):void 0}});return y==null||y.set(he,v[A]),y}):[]}).flat().filter(Boolean);J.current=B;const Z=B.map(v=>{const T=u=>{const f=v,y=f.get(he);if(!y)return;const g=r==null?void 0:r.find(E=>y===E[A]);if(j){V(E=>(E&&je(f),E===v?(je(f),U(null),null):(At(f),U(g[A],ee=>ee.field||A,"$eq"),f)));return}g&&S(g)};return v.addListener("click",T),()=>v.unbindAll()});if(o.type==="point"&&(m!=null&&m.length)&&(B==null?void 0:B.length)>1){const v=B.map(u=>u.getPosition());B[0].setZIndex(138),B[B.length-1].setZIndex(138);const T=(u=!0)=>{var f;if((f=p.current)!=null&&f.map)return new google.maps.Marker({label:{className:bt,fontFamily:"inherit",fontSize:"13px",color:"#333",text:P(u?"Start point":"End point")},icon:ue(fe),position:u?v[0]:v[v.length-1],map:p.current.map})};B.push(...[p.current.setOverlay("lineString",v.map(u=>[u.lng(),u.lat()]),{strokeColor:"#4e9bff",fillColor:"#4e9bff",strokeWeight:2,cursor:"pointer"}),T(),T(!1)].filter(Boolean))}return(L=p.current)==null||L.setFitView(B),()=>{B.forEach(v=>{v.setMap(null),v.unbindAll()}),Z.forEach(v=>v())}},[r,c,C,o.type,j]),h.useEffect(()=>{setTimeout(()=>{a([])})},[r]);const le=I=>{p.current=I,M(!!(I!=null&&I.map)&&!I.errMessage)};return s.jsxs("div",{className:n.css`
|
|
107
|
-
position: relative;
|
|
108
|
-
height: 100%;
|
|
109
|
-
`,children:[c&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:n.css`
|
|
110
|
-
position: absolute;
|
|
111
|
-
left: 10px;
|
|
112
|
-
top: 10px;
|
|
113
|
-
z-index: 999;
|
|
114
|
-
`,children:s.jsxs(w.Space,{direction:"vertical",children:[s.jsx(w.Button,{style:{color:z?void 0:"#F18b62",borderColor:"currentcolor"},onClick:I=>{I.stopPropagation(),K("")},icon:s.jsx(R.EnvironmentOutlined,{})}),s.jsx(w.Button,{style:{color:z==="selection"?"#F18b62":void 0,borderColor:"currentcolor"},onClick:I=>{I.stopPropagation(),K("selection")},icon:s.jsx(R.ExpandOutlined,{})}),z==="selection"?s.jsx(w.Button,{type:"primary",icon:s.jsx(R.CheckOutlined,{}),title:P("Confirm selection"),onClick:se}):null]})}),s.jsx(Mt,{record:d,setVisible:S})]}),s.jsx(Pe,H(F({},e),{ref:le,style:{height:l?"100%":null},zoom:i,disabled:!0,block:!0,overlayCommonOptions:{strokeColor:"#F18b62",fillColor:"#F18b62"}}))]})},Mt=e=>{const{setVisible:o,record:t}=e;_();const r=n.useCollection(),l=n.useCollectionParentRecordData(),i=N.useFieldSchema(),a=h.useMemo(()=>i.reduceProperties((m,b)=>b.name==="drawer"?b:m,null),[i]);return a&&s.jsx(n.ActionContextProvider,{value:{visible:!!t,setVisible:o},children:s.jsx(n.RecordProvider,{record:t,parent:l,children:s.jsx(n.VariablePopupRecordProvider,{recordData:t,collection:r,children:s.jsx(N.RecursionField,{schema:a,name:a.name})})})})};function je(e){if(e instanceof google.maps.Marker)return e.setIcon(ue(fe));e.setOptions({strokeColor:"#4e9bff",fillColor:"#4e9bff"})}function At(e){if(e instanceof google.maps.Marker)return e.setIcon(ue(Ae));e.setOptions({strokeColor:"#F18b62",fillColor:"#F18b62"})}const Ct=()=>{var c;const{getCollectionJoinField:e}=n.useCollectionManager_deprecated(),{getField:o}=n.useCollection_deprecated(),{form:t}=n.useFormBlockContext(),r=N.useField(),l=N.useFieldSchema(),{t:i}=_(),{dn:a,refresh:m}=n.useDesignable(),b=o(l.name)||e(l["x-collection-field"]),A=(c=b==null?void 0:b.uiSchema)==null?void 0:c.title;r.title===A||r.title,r.readPretty||r.required;let C="editable";return l["x-disabled"]===!0&&(C="readonly"),l["x-read-pretty"]===!0&&(C="read-pretty"),s.jsxs(n.GeneralSchemaDesigner,{children:[s.jsx(n.GeneralSchemaItems,{}),t&&!(t!=null&&t.readPretty)&&!n.isPatternDisabled(l)&&s.jsx(n.SchemaSettingsSelectItem,{title:i("Pattern"),options:[{label:i("Editable"),value:"editable"},{label:i("Readonly"),value:"readonly"},{label:i("Easy-reading"),value:"read-pretty"}],value:C,onChange:M=>{const p={"x-uid":l["x-uid"]};switch(M){case"readonly":{l["x-read-pretty"]=!1,l["x-disabled"]=!0,p["x-read-pretty"]=!1,p["x-disabled"]=!0,r.readPretty=!1,r.disabled=!0;break}case"read-pretty":{l["x-read-pretty"]=!0,l["x-disabled"]=!1,p["x-read-pretty"]=!0,p["x-disabled"]=!1,r.readPretty=!0;break}default:{l["x-read-pretty"]=!1,l["x-disabled"]=!1,p["x-read-pretty"]=!1,p["x-disabled"]=!1,r.readPretty=!1,r.disabled=!1;break}}a.emit("patch",{schema:p}),a.refresh()}},"pattern"),s.jsx(n.SchemaSettingsModalItem,{title:i("Set default zoom level"),schema:{type:"object",title:i("Set default zoom level"),properties:{zoom:{title:i("Zoom"),default:r.componentProps.zoom||13,description:i("The default zoom level of the map"),"x-decorator":"FormItem","x-component":"InputNumber","x-component-props":{precision:0}}}},onSubmit:({zoom:M})=>{M&&(Ee.set(l,"x-component-props.zoom",M),Object.assign(r.componentProps,l["x-component-props"]),a.emit("patch",{schema:{"x-uid":l["x-uid"],"x-component-props":r.componentProps}})),a.refresh()}},"map-zoom"),s.jsx(n.SchemaSettingsRemove,{removeParentsIfNoChildren:!0,confirm:{title:i("Delete field")},breakRemoveOn:{"x-component":"Grid"}},"remove")]})},St={amap:we,google:Pe},Ie=h.forwardRef((e,o)=>{const{t}=_(),{mapType:r}=e,l=h.useMemo(()=>St[r],[r]);return l?s.jsx(l,F({ref:o},e)):s.jsx("div",{children:t(`The ${r} cannot found`)})});Ie.displayName="MapComponent";const xt=e=>{var m,b;const{value:o}=e,t=N.useFieldSchema(),{getField:r}=n.useCollection_deprecated(),l=r(t.name),i=e.mapType||((m=l==null?void 0:l.uiSchema["x-component-props"])==null?void 0:m.mapType),a=N.useForm();return n.useFieldTitle(),a.readPretty?s.jsx(Ie,F({readonly:!0,mapType:i},e)):s.jsx("div",{children:s.jsx(n.EllipsisWithTooltip,{ellipsis:!0,children:(b=o==null?void 0:o.map)==null?void 0:b.call(o,A=>Array.isArray(A)?`(${A.join(",")})`:A).join(",")})})},_e=N.connect(e=>s.jsx("div",{className:n.css`
|
|
115
|
-
height: 100%;
|
|
116
|
-
border: 1px solid transparent;
|
|
117
|
-
.ant-formily-item-error & {
|
|
118
|
-
border: 1px solid #ff4d4f;
|
|
119
|
-
}
|
|
120
|
-
`,children:s.jsx(Ie,F({},e))}),N.mapReadPretty(xt));_e.Designer=Ct;const wt={amap:st,google:vt},Pt=e=>{const{t:o}=_(),{mapType:t}=e,r=h.useMemo(()=>wt[t],[t]);return r?s.jsx(r,F({},e)):s.jsx("div",{children:o(`The ${t} cannot found`)})},It=n.withDynamicSchemaProps(e=>{var a;const{fieldNames:o}=n.useProps(e),{getCollectionJoinField:t}=n.useCollectionManager_deprecated(),{name:r}=n.useCollection_deprecated(),l=h.useMemo(()=>t([r,o==null?void 0:o.field].flat().join(".")),[r,o==null?void 0:o.field]),i=(a=l==null?void 0:l.uiSchema)==null?void 0:a["x-component-props"];return s.jsx(Pt,H(F(F({},i),e),{collectionField:l}))}),kt=()=>{const{name:e,title:o}=n.useCollection(),t=n.useSchemaTemplate();return s.jsx(n.GeneralSchemaDesigner,{schemaSettings:"blockSettings:map",template:t,title:o||e})},Ve=(e,o=[])=>(typeof e=="string"&&(e=[e]),e==null?void 0:e.reduce((t,r,l)=>{const i=t==null?void 0:t.find(a=>a.value===r);return l===e.length-1?i:i==null?void 0:i.children},o)),Ft=e=>{const{collectionName:o,fieldNames:t,dataSource:r}=e;return{type:"void","x-acl-action":`${o}:list`,"x-decorator":"MapBlockProvider","x-decorator-props":{collection:o,dataSource:r,action:"list",fieldNames:t,params:{paginate:!1}},"x-toolbar":"BlockSchemaToolbar","x-settings":"blockSettings:map","x-component":"CardItem","x-filter-targets":[],properties:{actions:{type:"void","x-initializer":"map:configureActions","x-component":"ActionBar","x-component-props":{}},[Re.uid()]:{type:"void","x-component":"MapBlock","x-use-component-props":"useMapBlockProps",properties:{drawer:{type:"void","x-component":"Action.Drawer","x-component-props":{className:"nb-action-popup"},title:'{{ t("View record") }}',properties:{tabs:{type:"void","x-component":"Tabs","x-component-props":{},"x-initializer":"popup:addTab",properties:{tab1:{type:"void",title:'{{t("Details")}}',"x-component":"Tabs.TabPane","x-designer":"Tabs.Designer","x-component-props":{},properties:{grid:{type:"void","x-component":"Grid","x-initializer":"popup:common:addBlock"}}}}}}}}}}}},Ot=()=>{const e=n.useSchemaInitializerItem(),{insert:o}=n.useSchemaInitializer(),t=h.useContext(N.SchemaOptionsContext),{getCollectionFieldsOptions:r}=n.useCollectionManager_deprecated(),{t:l}=_(),{theme:i}=n.useGlobalTheme();return s.jsx(n.DataBlockInitializer,F({componentType:"Map",icon:s.jsx(R.TableOutlined,{}),onCreateBlockSchema:m=>Me(this,[m],function*({item:a}){const b=r(a.name,["point","lineString","polygon"],{association:["o2o","obo","oho","o2m","m2o","m2m"],dataSource:a.dataSource}),A=r(a.name,"string",{dataSource:a.dataSource}),C=yield n.FormDialog(l("Create map block"),()=>{var c;return s.jsx(n.SchemaComponentOptions,{scope:t.scope,components:F({},t.components),children:s.jsx($e.FormLayout,{layout:"vertical",children:s.jsx(n.SchemaComponent,{schema:{properties:{field:{title:l("Map field"),enum:b,required:!0,"x-component":"Cascader","x-decorator":"FormItem",default:b.length?[b[0].value,(c=b[0].children)==null?void 0:c[0].value].filter(M=>M!=null):[]},marker:{title:l("Marker field"),enum:A,"x-component":"Select","x-decorator":"FormItem","x-reactions":M=>{const p=M.form.values.field;if(!(p!=null&&p.length))return;const d=Ve(p,b);d&&(M.hidden=d.type!=="point")}}}}})})})},i).open({initialValues:{}});o(Ft({collectionName:a.name,dataSource:a.dataSource,fieldNames:F({},C)}))}),title:l("Map block")},e))},ke=h.createContext({});ke.displayName="MapBlockContext";const Et=e=>{var A;const{fieldNames:o}=e,t=N.useFieldSchema(),r=N.useField(),{resource:l,service:i}=n.useBlockRequestContext(),[a,m]=h.useState([]),{token:b}=w.theme.useToken();return s.jsx(n.FixedBlockWrapper,{children:s.jsx(n.SchemaComponentOptions,{scope:{selectedRecordKeys:a},children:s.jsxs(ke.Provider,{value:{field:r,service:i,resource:l,fieldNames:o,fixedBlock:(A=t==null?void 0:t["x-decorator-props"])==null?void 0:A.fixedBlock,selectedRecordKeys:a,setSelectedRecordKeys:m},children:[" ",s.jsx("div",{className:et.css`
|
|
121
|
-
.nb-action-bar {
|
|
122
|
-
margin-bottom: ${b.margin}px;
|
|
123
|
-
}
|
|
124
|
-
`,children:e.children})]})})})},Lt=e=>{const{filter:o,parseVariableLoading:t}=n.useParsedFilter({filterOption:e==null?void 0:e.filter});return{params:H(F({},e),{filter:o}),parseVariableLoading:t}},Tt=e=>{const o=N.useField(),{fieldNames:t}=e,{params:r,parseVariableLoading:l}=Lt(e.params);if(l)return null;const i=r.appends||[],{field:a}=t||{};return Array.isArray(a)&&a.length>1&&i.push(a[0]),s.jsx(n.BlockProvider,H(F({name:"map"},e),{runWhenParamsChanged:!0,params:H(F({},r),{appends:i,paginate:!1,sort:o.componentProps.lineSort}),children:s.jsx(Et,F({},e))}))},ye=()=>h.useContext(ke),We=()=>{var o,t,r,l,i,a;const e=ye();return H(F({},e),{dataSource:(t=(o=e==null?void 0:e.service)==null?void 0:o.data)==null?void 0:t.data,zoom:((l=(r=e==null?void 0:e.field)==null?void 0:r.componentProps)==null?void 0:l.zoom)||13,lineSort:(a=(i=e==null?void 0:e.field)==null?void 0:i.componentProps)==null?void 0:a.lineSort})},Dt=e=>s.jsx(n.SchemaComponentOptions,{scope:{useMapBlockProps:We},components:{MapBlockInitializer:Ot,MapBlockDesigner:kt,MapBlockProvider:Tt,MapBlock:It},children:e.children}),Ye={title:"{{t('Configure actions')}}",icon:"SettingOutlined",style:{marginLeft:8},items:[{name:"filter",title:"{{t('Filter')}}",Component:"FilterActionInitializer",schema:{"x-align":"left"}},{name:"addNew",title:"{{t('Add new')}}",Component:"CreateActionInitializer",schema:{"x-align":"right","x-decorator":"ACLActionProvider","x-acl-action-props":{skipScopeCheck:!0}},useVisible(){return n.useCollection_deprecated().template!=="sql"}},{name:"refresh",title:"{{t('Refresh')}}",Component:"RefreshActionInitializer",schema:{"x-align":"right"}}]},He=new n.CompatibleSchemaInitializer(F({name:"MapActionInitializers"},Ye)),zt=new n.CompatibleSchemaInitializer(F({name:"map:configureActions"},Ye),He),Je={name:"defaultZoomLevel",Component:n.SchemaSettingsModalItem,useComponentProps(){var i;const{t:e}=_(),o=N.useFieldSchema(),t=N.useField(),{dn:r}=n.useDesignable(),l=((i=o==null?void 0:o["x-component-props"])==null?void 0:i.zoom)||13;return{title:e("The default zoom level of the map"),schema:{type:"object",title:e("Set default zoom level"),properties:{zoom:{title:e("Zoom"),default:l,"x-component":"InputNumber","x-decorator":"FormItem","x-component-props":{precision:0}}}},onSubmit:({zoom:a})=>{Ee.set(o,"x-component-props.zoom",a),t.componentProps.zoom=a,r.emit("patch",{schema:{"x-uid":o["x-uid"],"x-component-props":o["x-component-props"]}}),r.refresh()}}}},Bt=new n.SchemaSettings({name:"blockSettings:map",items:[{name:"title",Component:n.SchemaSettingsBlockTitleItem},{name:"setTheBlockHeight",Component:n.SchemaSettingsBlockHeightItem},{name:"mapField",Component:n.SchemaSettingsCascaderItem,useComponentProps(){var A;const{getCollectionFieldsOptions:e}=n.useCollectionManager_deprecated(),{t:o}=_(),t=N.useFieldSchema(),r=((A=t==null?void 0:t["x-decorator-props"])==null?void 0:A.fieldNames)||{},l=N.useField(),{dn:i}=n.useDesignable(),{service:a}=ye(),{name:m}=n.useCollection(),b=e(m,["point","lineString","polygon"],{association:["o2o","obo","oho","o2m","m2o","m2m"]});return{title:o("Map field"),value:r.field,options:b,allowClear:!1,onChange:C=>{const c=l.decoratorProps.fieldNames||{};c.field=C,l.decoratorProps.fieldNames=c,t["x-decorator-props"].fieldNames=c,a.refresh(),i.emit("patch",{schema:{"x-uid":t["x-uid"],"x-decorator-props":l.decoratorProps}}),i.refresh()}}}},{name:"markerField",Component:n.SchemaSettingsSelectItem,useComponentProps(){var A;const{t:e}=_(),o=N.useFieldSchema(),t=((A=o==null?void 0:o["x-decorator-props"])==null?void 0:A.fieldNames)||{},{service:r}=ye(),l=N.useField(),{dn:i}=n.useDesignable(),{getCollectionFieldsOptions:a}=n.useCollectionManager_deprecated(),{name:m}=n.useCollection(),b=a(m,"string");return{title:e("Marker field"),value:t.marker,options:b,onChange:C=>{const c=l.decoratorProps.fieldNames||{};c.marker=C,l.decoratorProps.fieldNames=c,o["x-decorator-props"].fieldNames=c,r.refresh(),i.emit("patch",{schema:{"x-uid":o["x-uid"],"x-decorator-props":l.decoratorProps}}),i.refresh()}}},useVisible(){var a,m;const e=N.useFieldSchema(),{getCollectionFieldsOptions:o}=n.useCollectionManager_deprecated(),{name:t}=n.useCollection(),r=((a=e==null?void 0:e["x-decorator-props"])==null?void 0:a.fieldNames)||{},l=o(t,["point","lineString","polygon"],{association:["o2o","obo","oho","o2m","m2o","m2m"]});return((m=Ve(r.field,l))==null?void 0:m.type)==="point"}},{name:"setDefaultSortingRules",Component:n.SchemaSettingsDefaultSortingRules,useComponentProps(){const{t:e}=_();return{path:"x-component-props.lineSort",title:e("Concatenation order field")}}},n.setDataLoadingModeSettingsItem,Je,{name:"dataScope",Component:n.SchemaSettingsDataScope,useComponentProps(){var a,m;const{name:e}=n.useCollection(),o=N.useFieldSchema(),{form:t}=n.useFormBlockContext(),r=N.useField(),{service:l}=ye(),{dn:i}=n.useDesignable();return{collectionName:e,defaultFilter:((m=(a=o==null?void 0:o["x-decorator-props"])==null?void 0:a.params)==null?void 0:m.filter)||{},form:t,onSubmit:({filter:b})=>{var C,c;const A=r.decoratorProps.params||{};A.filter=b,r.decoratorProps.params=A,o["x-decorator-props"].params=A,(c=(C=l.params)==null?void 0:C[1])!=null&&c.filters,i.emit("patch",{schema:{"x-uid":o["x-uid"],"x-decorator-props":o["x-decorator-props"]}})}}}},{name:"ConnectDataBlocks",Component:n.SchemaSettingsConnectDataBlocks,useComponentProps(){const{t:e}=_();return{type:n.FilterBlockType.TABLE,emptyDescription:e("No blocks to connect")}}},{name:"divider",type:"divider"},{name:"template",Component:n.SchemaSettingsTemplate,useComponentProps(){var r,l;const{name:e}=n.useCollection(),o=N.useFieldSchema(),t=((r=o==null?void 0:o["x-decorator-props"])==null?void 0:r.resource)||((l=o==null?void 0:o["x-decorator-props"])==null?void 0:l.association);return{componentName:"Map",collectionName:e,resourceName:t}}},{name:"divider2",type:"divider"},{name:"remove",type:"remove",componentProps:{removeParentsIfNoChildren:!0,breakRemoveOn:{"x-component":"Grid"}}}]}),{defaultProps:Kt}=n.interfacesProperties;Array.isArray(n.interfacesProperties.type.enum)&&n.interfacesProperties.type.enum.push({label:"Point",value:"point"},{label:"LineString",value:"lineString"},{label:"Polygon",value:"polygon"},{label:"Circle",value:"circle"});class be extends n.CollectionFieldInterface{constructor(){super(...arguments);O(this,"properties",H(F({},Kt),{"uiSchema.x-component-props.mapType":{title:X("Map type"),type:"string",required:!0,"x-decorator":"FormItem","x-component":"Select","x-component-props":{showSearch:!1,allowClear:!1},"x-disabled":"{{ isOverride || !createOnly }}",default:"amap",enum:Le}}))}schemaInitialize(t,{block:r}){r==="Form"&&Object.assign(t,{"x-designer":"Map.Designer"})}}class Ut extends be{constructor(){super(...arguments);O(this,"name","circle");O(this,"type","object");O(this,"group","map");O(this,"order",3);O(this,"title",X("Circle"));O(this,"availableTypes",["circle"]);O(this,"description",X("Circle"));O(this,"sortable",!0);O(this,"default",{type:"circle",uiSchema:{type:"void","x-component":"Map","x-component-designer":"Map.Designer","x-component-props":{}}})}}class Nt extends be{constructor(){super(...arguments);O(this,"name","lineString");O(this,"type","object");O(this,"group","map");O(this,"order",2);O(this,"title",X("Line"));O(this,"description",X("Line"));O(this,"availableTypes",["lineString"]);O(this,"sortable",!0);O(this,"default",{type:"lineString",uiSchema:{type:"void","x-component":"Map","x-component-designer":"Map.Designer","x-component-props":{}}})}}class Gt extends be{constructor(){super(...arguments);O(this,"name","point");O(this,"type","object");O(this,"group","map");O(this,"order",1);O(this,"title",X("Point"));O(this,"description",X("Point"));O(this,"availableTypes",["point"]);O(this,"sortable",!0);O(this,"default",{type:"point",uiSchema:{type:"void","x-component":"Map","x-component-designer":"Map.Designer","x-component-props":{}}})}}class qt extends be{constructor(){super(...arguments);O(this,"name","polygon");O(this,"type","object");O(this,"group","map");O(this,"order",4);O(this,"title",X("Polygon"));O(this,"description",X("Polygon"));O(this,"availableTypes",["polygon"]);O(this,"sortable",!0);O(this,"default",{type:"polygon",uiSchema:{type:"void","x-component":"Map","x-component-designer":"Map.Designer","x-component-props":{}}})}}const jt=[Gt,qt,Nt,Ut],_t=new n.SchemaSettings({name:"fieldSettings:component:Map",items:[Je]}),Ze=h.memo(e=>s.jsx(n.SchemaComponentOptions,{components:{Map:_e},children:s.jsx(Dt,{children:e.children})}));Ze.displayName="MapProvider";class Xe extends n.Plugin{load(){return Me(this,null,function*(){this.app.use(Ze),this.app.dataSourceManager.addFieldInterfaces(jt),this.app.dataSourceManager.addFieldInterfaceGroups({map:{label:X("Map-based geometry"),order:51}}),this.app.schemaInitializerManager.add(He),this.app.schemaInitializerManager.add(zt),this.schemaSettingsManager.add(Bt),this.schemaSettingsManager.add(_t);const o=this.app.schemaInitializerManager.get("page:addBlock");o==null||o.add("dataBlocks.map",{title:X("Map"),Component:"MapBlockInitializer"}),this.app.pluginSettingsManager.add(ge,{title:`{{t("Map Manager", { ns: "${ge}" })}}`,icon:"EnvironmentOutlined",Component:pt,aclSnippet:"pm.map.configuration"}),this.app.addScopes({useMapBlockProps:We})})}}D.PluginMapClient=Xe,D.default=Xe,Object.defineProperties(D,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
@@ -1,12 +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
|
-
export declare const NAMESPACE = "map";
|
|
10
|
-
export declare function lang(key: string): string;
|
|
11
|
-
export declare function generateNTemplate(key: string): string;
|
|
12
|
-
export declare function useMapTranslation(): import("react-i18next").UseTranslationResponse<("map" | "client")[], undefined>;
|
package/dist/client/types.d.ts
DELETED
|
@@ -1,9 +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
|
-
export type MapEditorType = 'point' | 'polygon' | 'lineString' | 'circle';
|
package/dist/client/utils.d.ts
DELETED
|
@@ -1,9 +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
|
-
export declare const getSource: (data: Record<string, any>, fields?: string[], type?: string) => any;
|
package/dist/externalVersion.js
DELETED
|
@@ -1,28 +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
|
-
module.exports = {
|
|
11
|
-
"@nocobase/client": "1.2.12-alpha",
|
|
12
|
-
"react": "18.2.0",
|
|
13
|
-
"@nocobase/server": "1.2.12-alpha",
|
|
14
|
-
"@nocobase/test": "1.2.12-alpha",
|
|
15
|
-
"@formily/react": "2.3.0",
|
|
16
|
-
"lodash": "4.17.21",
|
|
17
|
-
"@ant-design/icons": "5.2.6",
|
|
18
|
-
"@formily/antd-v5": "1.1.9",
|
|
19
|
-
"@emotion/css": "11.11.2",
|
|
20
|
-
"antd": "5.12.8",
|
|
21
|
-
"@formily/shared": "2.3.0",
|
|
22
|
-
"ahooks": "3.7.8",
|
|
23
|
-
"react-router-dom": "6.21.0",
|
|
24
|
-
"@formily/core": "2.3.0",
|
|
25
|
-
"react-i18next": "11.18.6",
|
|
26
|
-
"@nocobase/actions": "1.2.12-alpha",
|
|
27
|
-
"@nocobase/database": "1.2.12-alpha"
|
|
28
|
-
};
|
package/dist/index.d.ts
DELETED
|
@@ -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
|
-
export * from './server';
|
|
10
|
-
export { default } from './server';
|
package/dist/index.js
DELETED
|
@@ -1,48 +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 __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
29
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
30
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
31
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
32
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
33
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
34
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
35
|
-
mod
|
|
36
|
-
));
|
|
37
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
38
|
-
var src_exports = {};
|
|
39
|
-
__export(src_exports, {
|
|
40
|
-
default: () => import_server.default
|
|
41
|
-
});
|
|
42
|
-
module.exports = __toCommonJS(src_exports);
|
|
43
|
-
__reExport(src_exports, require("./server"), module.exports);
|
|
44
|
-
var import_server = __toESM(require("./server"));
|
|
45
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
46
|
-
0 && (module.exports = {
|
|
47
|
-
...require("./server")
|
|
48
|
-
});
|
package/dist/locale/en-US.json
DELETED
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"Map": "Map",
|
|
3
|
-
"Map-based geometry": "Map-based geometry",
|
|
4
|
-
"Map type": "Map type",
|
|
5
|
-
"Point": "Point",
|
|
6
|
-
"Line": "Line",
|
|
7
|
-
"Circle": "Circle",
|
|
8
|
-
"Polygon": "Polygon",
|
|
9
|
-
"Access key": "Access key",
|
|
10
|
-
"securityJsCode or serviceHost": "securityJsCode or serviceHost",
|
|
11
|
-
"AMap": "AMap",
|
|
12
|
-
"Google Maps": "Google Maps",
|
|
13
|
-
"Clear": "Clear",
|
|
14
|
-
"Click to select the starting point and double-click to end the drawing": "Click to select the starting point and double-click to end the drawing",
|
|
15
|
-
"Clear the canvas": "Clear the canvas",
|
|
16
|
-
"Are you sure to clear the canvas?": "Are you sure to clear the canvas?",
|
|
17
|
-
"Confirm": "Confirm",
|
|
18
|
-
"Cancel": "Cancel",
|
|
19
|
-
"Enter keywords to search": "Enter keywords to search",
|
|
20
|
-
"The AccessKey is incorrect, please check it": "The AccessKey is incorrect, please check it",
|
|
21
|
-
"Please configure the AMap securityCode or serviceHost correctly": "Please configure the AMap securityCode or serviceHost correctly",
|
|
22
|
-
"Map Manager": "Map Manager",
|
|
23
|
-
"Configuration": "Configuration",
|
|
24
|
-
"Saved successfully": "Saved successfully",
|
|
25
|
-
"Saved failed": "Saved failed",
|
|
26
|
-
"Edit": "Edit",
|
|
27
|
-
"Save": "Save",
|
|
28
|
-
"Please configure the AccessKey and SecurityJsCode first": "Please configure the AccessKey and SecurityJsCode first",
|
|
29
|
-
"Go to the configuration page": "Go to the configuration page",
|
|
30
|
-
"Zoom": "Zoom",
|
|
31
|
-
"Set default zoom level": "Set default zoom level",
|
|
32
|
-
"The default zoom level of the map": "The default zoom level of the map",
|
|
33
|
-
"Edit field title": "Edit field title",
|
|
34
|
-
"Field title": "Field title",
|
|
35
|
-
"Edit tooltip": "Edit tooltip",
|
|
36
|
-
"Delete field": "Delete field",
|
|
37
|
-
"Required": "Required",
|
|
38
|
-
"Pattern": "Pattern",
|
|
39
|
-
"Operator": "Operator",
|
|
40
|
-
"Editable": "Editable",
|
|
41
|
-
"Readonly": "Readonly",
|
|
42
|
-
"Easy-reading": "Easy-reading",
|
|
43
|
-
"Edit description": "Edit description",
|
|
44
|
-
"Map field": "Map field",
|
|
45
|
-
"Marker field": "Marker field",
|
|
46
|
-
"Load google maps failed, Please check the Api key and refresh the page": "Load google maps failed, Please check the Api key and refresh the page",
|
|
47
|
-
"Create map block": "Create map block",
|
|
48
|
-
"Start point": "Start point",
|
|
49
|
-
"End point": "End point",
|
|
50
|
-
"Concatenation order field": "Concatenation order field"
|
|
51
|
-
}
|
package/dist/locale/ko_KR.json
DELETED
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"Map": "지도",
|
|
3
|
-
"Map-based geometry": "지도 기반 지오메트리",
|
|
4
|
-
"Map type": "지도 유형",
|
|
5
|
-
"Point": "점",
|
|
6
|
-
"Line": "선",
|
|
7
|
-
"Circle": "원",
|
|
8
|
-
"Polygon": "다각형",
|
|
9
|
-
"Access key": "액세스 키",
|
|
10
|
-
"securityJsCode or serviceHost": "securityJsCode 또는 serviceHost",
|
|
11
|
-
"AMap": "AMap",
|
|
12
|
-
"Google Maps": "Google 지도",
|
|
13
|
-
"Clear": "지우기",
|
|
14
|
-
"Click to select the starting point and double-click to end the drawing": "시작점을 선택하려면 클릭하고 그리기를 종료하려면 두 번 클릭하십시오",
|
|
15
|
-
"Clear the canvas": "캔버스 지우기",
|
|
16
|
-
"Are you sure to clear the canvas?": "캔버스를 지우시겠습니까?",
|
|
17
|
-
"Confirm": "확인",
|
|
18
|
-
"Cancel": "취소",
|
|
19
|
-
"Enter keywords to search": "검색할 키워드 입력 (시/도를 반드시 포함해야 함)",
|
|
20
|
-
"The AccessKey is incorrect, please check it": "액세스 키가 올바르지 않습니다. 확인해 주세요",
|
|
21
|
-
"Please configure the AMap securityCode or serviceHost correctly": "AMap securityCode 또는 serviceHost를 올바르게 구성해 주세요",
|
|
22
|
-
"Map Manager": "지도 관리자",
|
|
23
|
-
"Configuration": "구성",
|
|
24
|
-
"Saved successfully": "성공적으로 저장되었습니다",
|
|
25
|
-
"Saved failed": "저장 실패",
|
|
26
|
-
"Edit": "편집",
|
|
27
|
-
"Save": "저장",
|
|
28
|
-
"Please configure the AccessKey and SecurityJsCode first": "먼저 AccessKey 및 SecurityJsCode를 구성하세요",
|
|
29
|
-
"Go to the configuration page": "구성 페이지로 이동",
|
|
30
|
-
"Zoom": "확대/축소",
|
|
31
|
-
"Set default zoom level": "기본 확대/축소 수준 설정",
|
|
32
|
-
"The default zoom level of the map": "지도의 기본 확대/축소 수준",
|
|
33
|
-
"Edit field title": "필드 제목 편집",
|
|
34
|
-
"Field title": "필드 제목",
|
|
35
|
-
"Edit tooltip": "툴팁 편집",
|
|
36
|
-
"Delete field": "필드 삭제",
|
|
37
|
-
"Required": "필수",
|
|
38
|
-
"Pattern": "패턴",
|
|
39
|
-
"Operator": "연산자",
|
|
40
|
-
"Editable": "편집 가능",
|
|
41
|
-
"Readonly": "읽기 전용",
|
|
42
|
-
"Easy-reading": "읽기 전용 (읽기 전용 모드)",
|
|
43
|
-
"Edit description": "설명 편집",
|
|
44
|
-
"Map field": "지도 필드",
|
|
45
|
-
"Marker field": "마커 필드",
|
|
46
|
-
"Load google maps failed, Please check the Api key and refresh the page": "Google 지도 로드 실패, Api 키를 확인하고 페이지를 새로 고침하세요",
|
|
47
|
-
"Create map block": "지도 블록 생성",
|
|
48
|
-
"Start point": "시작점",
|
|
49
|
-
"End point": "끝점",
|
|
50
|
-
"Concatenation order field": "연결 순서 필드"
|
|
51
|
-
}
|
package/dist/locale/pt-BR.json
DELETED
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"Map-based geometry": "Geometria baseada em mapa",
|
|
3
|
-
"Map type": "Tipo de mapa",
|
|
4
|
-
"Point": "Ponto",
|
|
5
|
-
"Line": "Linha",
|
|
6
|
-
"Circle": "Círculo",
|
|
7
|
-
"Polygon": "Polígono",
|
|
8
|
-
"Access key": "Chave de acesso",
|
|
9
|
-
"securityJsCode or serviceHost": "securityJsCode ou serviceHost",
|
|
10
|
-
"AMap": "AMap",
|
|
11
|
-
"Google Maps": "Google Maps",
|
|
12
|
-
"Clear": "Limpar",
|
|
13
|
-
"Click to select the starting point and double-click to end the drawing": "Clique para selecionar o ponto de partida e dê um duplo clique para terminar a criação",
|
|
14
|
-
"Clear the canvas": "Limpar a tela",
|
|
15
|
-
"Are you sure to clear the canvas?": "Tem certeza de que deseja limpar a tela?",
|
|
16
|
-
"Confirm": "Confirmar",
|
|
17
|
-
"Cancel": "Cancelar",
|
|
18
|
-
"Enter keywords to search": "Digite palavras-chave para buscar",
|
|
19
|
-
"The AccessKey is incorrect, please check it": "A chave de acesso está incorreta, por favor verifique",
|
|
20
|
-
"Please configure the AMap securityCode or serviceHost correctly": "Por favor, configure o securityCode ou serviceHost do AMap corretamente",
|
|
21
|
-
"Map Manager": "Gerenciador de Mapa",
|
|
22
|
-
"Configuration": "Configuração",
|
|
23
|
-
"Saved successfully": "Salvo com sucesso",
|
|
24
|
-
"Saved failed": "Falha ao salvar",
|
|
25
|
-
"Edit": "Editar",
|
|
26
|
-
"Save": "Salvar",
|
|
27
|
-
"Please configure the AccessKey and SecurityJsCode first": "Por favor, configure a AccessKey e o SecurityJsCode primeiro",
|
|
28
|
-
"Go to the configuration page": "Ir para a página de configuração",
|
|
29
|
-
"Zoom": "Zoom",
|
|
30
|
-
"Set default zoom level": "Definir nível de zoom padrão",
|
|
31
|
-
"The default zoom level of the map": "O nível de zoom padrão do mapa",
|
|
32
|
-
"Edit field title": "Editar título do campo",
|
|
33
|
-
"Field title": "Título do campo",
|
|
34
|
-
"Edit tooltip": "Editar dica de ferramenta",
|
|
35
|
-
"Delete field": "Excluir campo",
|
|
36
|
-
"Required": "Obrigatório",
|
|
37
|
-
"Pattern": "Padrão",
|
|
38
|
-
"Operator": "Operador",
|
|
39
|
-
"Editable": "Editável",
|
|
40
|
-
"Readonly": "Somente leitura",
|
|
41
|
-
"Easy-reading": "Apenas leitura (Modo de Leitura)",
|
|
42
|
-
"Edit description": "Editar descrição",
|
|
43
|
-
"Map field": "Campo de mapa",
|
|
44
|
-
"Marker field": "Campo de marcador"
|
|
45
|
-
}
|