@mapcomponents/ra-geospatial 1.5.5 → 1.5.7-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/dist/README.md +74 -0
- package/dist/components/GeospatialInput.d.ts +9 -0
- package/dist/components/GeospatialInput.d.ts.map +1 -0
- package/dist/components/GeospatialInputMap.d.ts +18 -0
- package/dist/components/GeospatialInputMap.d.ts.map +1 -0
- package/dist/components/GeospatialShow.d.ts +9 -0
- package/dist/components/GeospatialShow.d.ts.map +1 -0
- package/dist/components/GeospatialShowMap.d.ts +11 -0
- package/dist/components/GeospatialShowMap.d.ts.map +1 -0
- package/dist/contexts/DataContext.d.ts +4 -0
- package/dist/contexts/DataContext.d.ts.map +1 -0
- package/dist/contexts/dataProvider.d.ts +35 -0
- package/dist/contexts/dataProvider.d.ts.map +1 -0
- package/dist/contexts/lsDataProvider.d.ts +44 -0
- package/dist/contexts/lsDataProvider.d.ts.map +1 -0
- package/dist/decorators/ReactAdminDefaultDecorator.d.ts +3 -0
- package/dist/decorators/ReactAdminDefaultDecorator.d.ts.map +1 -0
- package/dist/favicon.ico +0 -0
- package/dist/html2canvas.esm-CUkZERmf.cjs +23 -0
- package/dist/html2canvas.esm-CUkZERmf.cjs.map +1 -0
- package/dist/html2canvas.esm-Dmi1NfiH.js +4872 -0
- package/dist/html2canvas.esm-Dmi1NfiH.js.map +1 -0
- package/dist/index-BYtSitNR.js +61509 -0
- package/dist/index-BYtSitNR.js.map +1 -0
- package/dist/index-DD78QbMh.cjs +1222 -0
- package/dist/index-DD78QbMh.cjs.map +1 -0
- package/dist/index.cjs +2 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.css +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.es-DBcuOIG0.js +6675 -0
- package/dist/index.es-DBcuOIG0.js.map +1 -0
- package/dist/index.es-YxBXdzDQ.cjs +19 -0
- package/dist/index.es-YxBXdzDQ.cjs.map +1 -0
- package/dist/index.js +6 -0
- package/dist/index.js.map +1 -0
- package/dist/layout/GisLayout.d.ts +6 -0
- package/dist/layout/GisLayout.d.ts.map +1 -0
- package/dist/manifest.json +25 -0
- package/dist/package.json +24 -0
- package/dist/purify.es-D1I7B1hP.cjs +3 -0
- package/dist/purify.es-D1I7B1hP.cjs.map +1 -0
- package/dist/purify.es-DHbHSKL1.js +529 -0
- package/dist/purify.es-DHbHSKL1.js.map +1 -0
- package/dist/ra_components/Poi.d.ts +5 -0
- package/dist/ra_components/Poi.d.ts.map +1 -0
- package/dist/ra_components/Property.d.ts +5 -0
- package/dist/ra_components/Property.d.ts.map +1 -0
- package/dist/ra_components/Route.d.ts +5 -0
- package/dist/ra_components/Route.d.ts.map +1 -0
- package/dist/ra_components/raGeospatialProps.d.ts +12 -0
- package/dist/ra_components/raGeospatialProps.d.ts.map +1 -0
- package/dist/ra_components/raGeospatialWebGisProps.d.ts +12 -0
- package/dist/ra_components/raGeospatialWebGisProps.d.ts.map +1 -0
- package/index.html +16 -0
- package/package.json +11 -16
- package/project.json +8 -2
- package/src/components/GeospatialInput.stories.tsx +1 -1
- package/src/components/GeospatialInputMap.tsx +9 -7
- package/src/components/GeospatialShow.stories.tsx +1 -1
- package/src/components/GeospatialShow.tsx +0 -1
- package/src/contexts/lsDataProvider.js +106 -110
- package/src/decorators/ReactAdminDefaultDecorator.tsx +1 -2
- package/src/layout/GisLayout.jsx +8 -15
- package/src/ra_components/raGeospatialProps.ts +3 -3
- package/src/ra_components/raGeospatialWebGisProps.ts +3 -3
- package/src/types.d.ts +1 -1
- package/tsconfig.lib.json +1 -1
- package/vite.config.ts +13 -4
- package/.babelrc +0 -12
- package/.storybook/main.ts +0 -19
- package/.storybook/manager.js +0 -6
- package/.storybook/preview.ts +0 -27
- package/.storybook/style.css +0 -20
- package/.storybook/wheregroupTheme.js +0 -9
- package/tsconfig.json +0 -9
- /package/{.storybook/mapcomponents_logo.png → dist/logo.png} +0 -0
package/dist/README.md
ADDED
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
<img src="https://avatars.githubusercontent.com/u/64851912" alt="MapComponents logo" width="80"/>
|
|
2
|
+
|
|
3
|
+
# @mapcomponents/ra-geospatial
|
|
4
|
+
|
|
5
|
+
[](https://badge.fury.io/js/@mapcomponents%2Fra-geospatial) [](https://opensource.org/licenses/MIT)  
|
|
6
|
+
|
|
7
|
+
Input and view components to work with geospatial data in react admin. This package is based on @mapcomponents/react-maplibre and uses MapLibre-gl to display geospatial data on a map.
|
|
8
|
+
|
|
9
|
+

|
|
10
|
+
|
|
11
|
+
RaGeospatialInput & RaGeospatialShow used to edit a polygon geometry in a react-admin application.
|
|
12
|
+
|
|
13
|
+
## Demos
|
|
14
|
+
|
|
15
|
+
- [react admin & mapcomponents Demo](https://cioddi.github.io/mc-react-admin-apps/react-admin-demo)
|
|
16
|
+
- [webGIS Demo (embeddedMap: false)](https://cioddi.github.io/mc-react-admin-apps/webgis-demo)
|
|
17
|
+
|
|
18
|
+
## Installation
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
yarn add @mapcomponents/ra-geospatial
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## Exports
|
|
25
|
+
|
|
26
|
+
### RaGeospatialInput
|
|
27
|
+
|
|
28
|
+
Input component to edit or create geospatial data.
|
|
29
|
+
|
|
30
|
+
### RaGeospatialShow
|
|
31
|
+
|
|
32
|
+
Show component to display geospatial data.
|
|
33
|
+
|
|
34
|
+
#### Props
|
|
35
|
+
|
|
36
|
+
- **embeddedMap**: boolean (default: false) - If true, the map will be embedded in the component. If false, the component will not create it's own MapContext and add a MapLibreMap component but instead expect a MapContext and a MapLibreMap component to be present in the parent component.
|
|
37
|
+
|
|
38
|
+
## Examples
|
|
39
|
+
|
|
40
|
+
```JSX
|
|
41
|
+
import {
|
|
42
|
+
RaGeospatialInput,
|
|
43
|
+
RaGeospatialShow,
|
|
44
|
+
} from "@mapcomponents/ra-geospatial";
|
|
45
|
+
|
|
46
|
+
export const PoiEdit = () => (
|
|
47
|
+
<Edit>
|
|
48
|
+
<SimpleForm>
|
|
49
|
+
<TextInput source="title" />
|
|
50
|
+
<TextInput source="geom" />
|
|
51
|
+
<RaGeospatialInput source="geom" />
|
|
52
|
+
</SimpleForm>
|
|
53
|
+
</Edit>
|
|
54
|
+
);
|
|
55
|
+
export const PoiCreate = () => (
|
|
56
|
+
<Create>
|
|
57
|
+
<SimpleForm>
|
|
58
|
+
<TextInput source="title" />
|
|
59
|
+
<TextInput source="geom" />
|
|
60
|
+
<RaGeospatialInput source="geom" />
|
|
61
|
+
</SimpleForm>
|
|
62
|
+
</Create>
|
|
63
|
+
);
|
|
64
|
+
|
|
65
|
+
export const PoiShow = () => (
|
|
66
|
+
<Show>
|
|
67
|
+
<SimpleShowLayout>
|
|
68
|
+
<TextField source="id" />
|
|
69
|
+
<TextField source="title" />
|
|
70
|
+
<RaGeospatialShow source="geom" />
|
|
71
|
+
</SimpleShowLayout>
|
|
72
|
+
</Show>
|
|
73
|
+
);
|
|
74
|
+
```
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { GeospatialInputMapProps } from './GeospatialInputMap.js';
|
|
2
|
+
declare function GeospatialInput(props: GeospatialInputMapProps): import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
declare namespace GeospatialInput {
|
|
4
|
+
var defaultProps: {
|
|
5
|
+
embeddedMap: boolean;
|
|
6
|
+
};
|
|
7
|
+
}
|
|
8
|
+
export default GeospatialInput;
|
|
9
|
+
//# sourceMappingURL=GeospatialInput.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GeospatialInput.d.ts","sourceRoot":"","sources":["../../src/components/GeospatialInput.tsx"],"names":[],"mappings":"AACA,OAA2B,EAAE,uBAAuB,EAAE,MAAM,yBAAyB,CAAC;AAEtF,iBAAS,eAAe,CAAC,KAAK,EAAE,uBAAuB,2CAYtD;kBAZQ,eAAe;;;;;AAiBxB,eAAe,eAAe,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { InputProps } from 'react-admin';
|
|
3
|
+
import { MapLibreMap } from '@mapcomponents/react-maplibre';
|
|
4
|
+
export interface GeospatialInputMapProps extends InputProps<any> {
|
|
5
|
+
MapLibreMapProps?: React.ComponentProps<typeof MapLibreMap>;
|
|
6
|
+
geometrytype?: 'point' | 'line' | 'polygon';
|
|
7
|
+
embeddedMap?: boolean;
|
|
8
|
+
mapId?: string;
|
|
9
|
+
}
|
|
10
|
+
declare function GeospatialInputMap(props: GeospatialInputMapProps): import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
declare namespace GeospatialInputMap {
|
|
12
|
+
var defaultProps: {
|
|
13
|
+
type: string;
|
|
14
|
+
embeddedMap: boolean;
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
export default GeospatialInputMap;
|
|
18
|
+
//# sourceMappingURL=GeospatialInputMap.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GeospatialInputMap.d.ts","sourceRoot":"","sources":["../../src/components/GeospatialInputMap.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA8B,MAAM,OAAO,CAAC;AACnD,OAAO,EAAE,UAAU,EAA8B,MAAM,aAAa,CAAC;AAGrE,OAAO,EACN,WAAW,EAIX,MAAM,+BAA+B,CAAC;AAMvC,MAAM,WAAW,uBAAwB,SAAQ,UAAU,CAAC,GAAG,CAAC;IAC/D,gBAAgB,CAAC,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,WAAW,CAAC,CAAC;IAC5D,YAAY,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CAAC;IAC5C,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,KAAK,CAAC,EAAE,MAAM,CAAC;CACf;AAED,iBAAS,kBAAkB,CAAC,KAAK,EAAE,uBAAuB,2CA6JzD;kBA7JQ,kBAAkB;;;;;;AAoK3B,eAAe,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { GeospatialShowMapProps } from './GeospatialShowMap.js';
|
|
2
|
+
declare function GeospatialShow(props: GeospatialShowMapProps): import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
declare namespace GeospatialShow {
|
|
4
|
+
var defaultProps: {
|
|
5
|
+
embeddedMap: boolean;
|
|
6
|
+
};
|
|
7
|
+
}
|
|
8
|
+
export default GeospatialShow;
|
|
9
|
+
//# sourceMappingURL=GeospatialShow.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GeospatialShow.d.ts","sourceRoot":"","sources":["../../src/components/GeospatialShow.tsx"],"names":[],"mappings":"AACA,OAAwB,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AAEjF,iBAAS,cAAc,CAAC,KAAK,EAAE,sBAAsB,2CAYpD;kBAZQ,cAAc;;;;;AAiBvB,eAAe,cAAc,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { InputProps } from 'react-admin';
|
|
3
|
+
import { MapLibreMap } from '@mapcomponents/react-maplibre';
|
|
4
|
+
export interface GeospatialShowMapProps extends InputProps<any> {
|
|
5
|
+
MapLibreMapProps?: React.ComponentProps<typeof MapLibreMap>;
|
|
6
|
+
embeddedMap?: boolean;
|
|
7
|
+
mapId?: string;
|
|
8
|
+
}
|
|
9
|
+
declare function GeospatialShowMap(props: GeospatialShowMapProps): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export default GeospatialShowMap;
|
|
11
|
+
//# sourceMappingURL=GeospatialShowMap.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GeospatialShowMap.d.ts","sourceRoot":"","sources":["../../src/components/GeospatialShowMap.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA8B,MAAM,OAAO,CAAC;AACnD,OAAO,EAAE,UAAU,EAAoB,MAAM,aAAa,CAAC;AAE3D,OAAO,EAAE,WAAW,EAA0B,MAAM,+BAA+B,CAAC;AAKpF,MAAM,WAAW,sBAAuB,SAAQ,UAAU,CAAC,GAAG,CAAC;IAC9D,gBAAgB,CAAC,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,WAAW,CAAC,CAAC;IAC5D,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,KAAK,CAAC,EAAE,MAAM,CAAC;CACf;AAED,iBAAS,iBAAiB,CAAC,KAAK,EAAE,sBAAsB,2CAoDvD;AAED,eAAe,iBAAiB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DataContext.d.ts","sourceRoot":"","sources":["../../src/contexts/DataContext.jsx"],"names":[],"mappings":"AAOA,iGA0DC;AA5DD,6CAAiD;kBALN,OAAO"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
export declare const defaultData: {
|
|
2
|
+
pois: {
|
|
3
|
+
id: number;
|
|
4
|
+
title: string;
|
|
5
|
+
geom: string;
|
|
6
|
+
}[];
|
|
7
|
+
properties: {
|
|
8
|
+
id: number;
|
|
9
|
+
title: string;
|
|
10
|
+
geom: string;
|
|
11
|
+
}[];
|
|
12
|
+
routes: {
|
|
13
|
+
id: number;
|
|
14
|
+
title: string;
|
|
15
|
+
geom: string;
|
|
16
|
+
}[];
|
|
17
|
+
};
|
|
18
|
+
export declare const dataProvider: {
|
|
19
|
+
getList: (resource: any, params: any) => Promise<import('react-admin').GetListResult<any> | {
|
|
20
|
+
data: never[];
|
|
21
|
+
total: number;
|
|
22
|
+
}>;
|
|
23
|
+
getOne: (resource: any, params: any) => Promise<import('react-admin').GetOneResult<any>>;
|
|
24
|
+
getMany: (resource: any, params: any) => Promise<import('react-admin').GetManyResult<any>>;
|
|
25
|
+
getManyReference: (resource: any, params: any) => Promise<import('react-admin').GetManyReferenceResult<any> | {
|
|
26
|
+
data: never[];
|
|
27
|
+
total: number;
|
|
28
|
+
}>;
|
|
29
|
+
update: (resource: any, params: any) => Promise<import('react-admin').UpdateResult<any>>;
|
|
30
|
+
updateMany: (resource: any, params: any) => Promise<import('react-admin').UpdateManyResult<any>>;
|
|
31
|
+
create: (resource: any, params: any) => Promise<import('react-admin').CreateResult<any>>;
|
|
32
|
+
delete: (resource: any, params: any) => Promise<import('react-admin').DeleteResult<any>>;
|
|
33
|
+
deleteMany: (resource: any, params: any) => Promise<import('react-admin').DeleteManyResult<any>>;
|
|
34
|
+
};
|
|
35
|
+
//# sourceMappingURL=dataProvider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dataProvider.d.ts","sourceRoot":"","sources":["../../src/contexts/dataProvider.tsx"],"names":[],"mappings":"AAEA,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;CAsBvB,CAAC;AAEF,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;CAGvB,CAAC"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Respond to react-admin data queries using a local database persisted in localStorage
|
|
3
|
+
*
|
|
4
|
+
* Useful for local-first web apps. The storage is shared between tabs.
|
|
5
|
+
*
|
|
6
|
+
* @example // initialize with no data
|
|
7
|
+
*
|
|
8
|
+
* import localStorageDataProvider from 'ra-data-local-storage';
|
|
9
|
+
* const dataProvider.tsx = localStorageDataProvider();
|
|
10
|
+
*
|
|
11
|
+
* @example // initialize with default data (will be ignored if data has been modified by user)
|
|
12
|
+
*
|
|
13
|
+
* import localStorageDataProvider from 'ra-data-local-storage';
|
|
14
|
+
* const dataProvider.tsx = localStorageDataProvider({
|
|
15
|
+
* defaultData: {
|
|
16
|
+
* posts: [
|
|
17
|
+
* { id: 0, title: 'Hello, world!' },
|
|
18
|
+
* { id: 1, title: 'FooBar' },
|
|
19
|
+
* ],
|
|
20
|
+
* comments: [
|
|
21
|
+
* { id: 0, post_id: 0, author: 'John Doe', body: 'Sensational!' },
|
|
22
|
+
* { id: 1, post_id: 0, author: 'Jane Doe', body: 'I agree' },
|
|
23
|
+
* ],
|
|
24
|
+
* }
|
|
25
|
+
* });
|
|
26
|
+
*/
|
|
27
|
+
export default function localStorageDataProvider(params: any): {
|
|
28
|
+
getList: (resource: any, params: any) => Promise<import('react-admin').GetListResult<any> | {
|
|
29
|
+
data: never[];
|
|
30
|
+
total: number;
|
|
31
|
+
}>;
|
|
32
|
+
getOne: (resource: any, params: any) => Promise<import('react-admin').GetOneResult<any>>;
|
|
33
|
+
getMany: (resource: any, params: any) => Promise<import('react-admin').GetManyResult<any>>;
|
|
34
|
+
getManyReference: (resource: any, params: any) => Promise<import('react-admin').GetManyReferenceResult<any> | {
|
|
35
|
+
data: never[];
|
|
36
|
+
total: number;
|
|
37
|
+
}>;
|
|
38
|
+
update: (resource: any, params: any) => Promise<import('react-admin').UpdateResult<any>>;
|
|
39
|
+
updateMany: (resource: any, params: any) => Promise<import('react-admin').UpdateManyResult<any>>;
|
|
40
|
+
create: (resource: any, params: any) => Promise<import('react-admin').CreateResult<any>>;
|
|
41
|
+
delete: (resource: any, params: any) => Promise<import('react-admin').DeleteResult<any>>;
|
|
42
|
+
deleteMany: (resource: any, params: any) => Promise<import('react-admin').DeleteManyResult<any>>;
|
|
43
|
+
};
|
|
44
|
+
//# sourceMappingURL=lsDataProvider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lsDataProvider.d.ts","sourceRoot":"","sources":["../../src/contexts/lsDataProvider.js"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH;;;;;;;;;;;;;;;;EA4GC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ReactAdminDefaultDecorator.d.ts","sourceRoot":"","sources":["../../src/decorators/ReactAdminDefaultDecorator.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAO1B,eAAO,MAAM,0BAA0B,GAAI,OAAO,KAAK,CAAC,aAAa,EAAE,SAAS,GAAG,4CAgClF,CAAC"}
|
package/dist/favicon.ico
ADDED
|
Binary file
|