@smart-factor/gem-ui-map-component 0.0.6 → 0.0.7
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/{MapButtons-ye29ja9q.js → MapButtons-tHYpv77x.js} +26776 -26715
- package/dist/api/queries/useGetRoads.d.ts +4 -0
- package/dist/api/queryKeys.d.ts +1 -0
- package/dist/api/services/generated/api.d.ts +30 -0
- package/dist/components/Map/Map.d.ts +1 -1
- package/dist/components/Map/config.d.ts +1 -1
- package/dist/components/Map/types.d.ts +2 -10
- package/dist/components/MapButtons/index.js +1 -1
- package/dist/components/Navigation/NavigationContext.d.ts +4 -3
- package/dist/components/Navigation/useGetRoads.d.ts +1 -0
- package/dist/components/Navigation/useSetDefaultValues.d.ts +2 -0
- package/dist/components/Navigation/useUpdateNavigationInfo.d.ts +3 -0
- package/dist/contexts/MapInteractionsContext/MapInteractionsContextProvider.d.ts +2 -6
- package/dist/contexts/MapInteractionsContext/types.d.ts +9 -2
- package/dist/contexts/MapInteractionsContext/useMapInteractionsContext.d.ts +3 -3
- package/dist/hooks/useSetupMap.d.ts +1 -1
- package/dist/main.js +3343 -3274
- package/dist/services/Map/MapService.d.ts +2 -0
- package/dist/services/Navigation/NavigationService.d.ts +2 -1
- package/package.json +1 -1
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { UseQueryOptions } from '@tanstack/react-query';
|
|
2
|
+
import { GEMRoad, RequestParams } from '../services/generated/api';
|
|
3
|
+
declare const useGetRoads: (options?: Omit<UseQueryOptions<GEMRoad[], Error, GEMRoad[]>, 'queryKey' | 'queryFn'>, params?: RequestParams) => import('@tanstack/react-query').UseQueryResult<GEMRoad[], Error>;
|
|
4
|
+
export default useGetRoads;
|
package/dist/api/queryKeys.d.ts
CHANGED
|
@@ -305,6 +305,18 @@ export interface Search3Params extends CaseSearchCriteria, Pageable {
|
|
|
305
305
|
export type Search3Data = {
|
|
306
306
|
response: PageCaseDTO;
|
|
307
307
|
};
|
|
308
|
+
export interface GEMRoad {
|
|
309
|
+
id: number;
|
|
310
|
+
category: string;
|
|
311
|
+
road_name: string;
|
|
312
|
+
name: string;
|
|
313
|
+
road_number: string;
|
|
314
|
+
start_mileage: number;
|
|
315
|
+
end_mileage: number;
|
|
316
|
+
}
|
|
317
|
+
export type QueryRoadsData = {
|
|
318
|
+
response: GEMRoad[];
|
|
319
|
+
};
|
|
308
320
|
export type QueryParamsType = Record<string | number, any>;
|
|
309
321
|
export interface FullRequestParams extends Omit<AxiosRequestConfig, 'data' | 'params' | 'url' | 'responseType'> {
|
|
310
322
|
/** set parameter to `true` for call `securityWorker` for this request */
|
|
@@ -458,4 +470,22 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
|
|
|
458
470
|
*/
|
|
459
471
|
search3: (query: Search3Params, params?: RequestParams) => Promise<AxiosResponse<Search3Data, any>>;
|
|
460
472
|
};
|
|
473
|
+
road: {
|
|
474
|
+
/**
|
|
475
|
+
* No description
|
|
476
|
+
*
|
|
477
|
+
* @tags /road
|
|
478
|
+
* @name QueryRoads1
|
|
479
|
+
* @summary Zwraca listę dróg
|
|
480
|
+
* @request GET:/road
|
|
481
|
+
* @secure
|
|
482
|
+
* @response `200` `QueryRoads1Data` Pobieranie zakończone sukcesem
|
|
483
|
+
* @response `400` `string` Bad Request
|
|
484
|
+
* @response `404` `string` Not Found
|
|
485
|
+
* @response `406` `string` Not Acceptable
|
|
486
|
+
* @response `409` `string` Conflict
|
|
487
|
+
* @response `500` `(GEMRoad)[]` Wewnętrzny błąd serwera
|
|
488
|
+
*/
|
|
489
|
+
queryRoads: (params?: RequestParams) => Promise<AxiosResponse<QueryRoadsData, any>>;
|
|
490
|
+
};
|
|
461
491
|
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { MapExternalProps } from './types';
|
|
2
|
-
declare const MapWithProviders: ({ mapLayers, caseObjectId, sidebarConfig, mapButtonsConfig, mapElementsConfig,
|
|
2
|
+
declare const MapWithProviders: ({ mapLayers, caseObjectId, sidebarConfig, mapButtonsConfig, mapElementsConfig, setOuterDrawnGeometries, }: MapExternalProps) => import("react/jsx-runtime").JSX.Element;
|
|
3
3
|
export default MapWithProviders;
|
|
@@ -4,7 +4,7 @@ interface SidebarConfig {
|
|
|
4
4
|
}
|
|
5
5
|
interface MapButtonsConfig {
|
|
6
6
|
mapButtonsVisible: boolean;
|
|
7
|
-
items: Record<'draw' | 'info' | 'assign' | 'geoLocation', boolean>;
|
|
7
|
+
items: Record<'draw' | 'info' | 'assign' | 'geoLocation' | 'send', boolean>;
|
|
8
8
|
}
|
|
9
9
|
interface MapElementsConfig {
|
|
10
10
|
mapElementsVisible: boolean;
|
|
@@ -93,15 +93,6 @@ export type WMSLayerDetailed = {
|
|
|
93
93
|
key: string;
|
|
94
94
|
type: string;
|
|
95
95
|
};
|
|
96
|
-
export type GEMRoad = {
|
|
97
|
-
id: number;
|
|
98
|
-
category: string;
|
|
99
|
-
road_name: string;
|
|
100
|
-
name: string;
|
|
101
|
-
road_number: string;
|
|
102
|
-
start_mileage: number;
|
|
103
|
-
end_mileage: number;
|
|
104
|
-
};
|
|
105
96
|
export type ItemPositionResponse = {
|
|
106
97
|
net_id: number;
|
|
107
98
|
position: number;
|
|
@@ -163,8 +154,9 @@ export type MapLayer = {
|
|
|
163
154
|
layerId?: number;
|
|
164
155
|
geometryType?: string;
|
|
165
156
|
};
|
|
157
|
+
export type DrawnGeometryParam = Omit<Geometry, 'geometries'>[];
|
|
166
158
|
export interface MapExternalProps extends MapConfig {
|
|
167
159
|
mapLayers: MapLayer[];
|
|
168
|
-
|
|
160
|
+
setOuterDrawnGeometries?: (drawnGeometries: DrawnGeometryParam) => void;
|
|
169
161
|
caseObjectId?: number;
|
|
170
162
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { PrgAddressResponse } from '../../api/queries/useGetPRGAddress';
|
|
2
|
-
import { GEMRoad
|
|
2
|
+
import { GEMRoad } from '../../api/services/generated/api';
|
|
3
|
+
import { GEMRoadNet } from '../Map/types';
|
|
3
4
|
interface NavigationContextProps {
|
|
4
5
|
setSelectedRoad: React.Dispatch<React.SetStateAction<GEMRoad | undefined>>;
|
|
5
6
|
selectedRoad: GEMRoad | undefined;
|
|
@@ -15,8 +16,8 @@ interface NavigationContextProps {
|
|
|
15
16
|
mileageEnd: number;
|
|
16
17
|
setMileageValue: React.Dispatch<React.SetStateAction<number>>;
|
|
17
18
|
mileageValue: number;
|
|
18
|
-
|
|
19
|
-
|
|
19
|
+
setRoads: React.Dispatch<React.SetStateAction<GEMRoad[]>>;
|
|
20
|
+
roads: GEMRoad[];
|
|
20
21
|
nets: GEMRoadNet[];
|
|
21
22
|
setNets: React.Dispatch<React.SetStateAction<GEMRoadNet[]>>;
|
|
22
23
|
prgAddressValue: PrgAddressResponse | undefined;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const useGetRoads: () => () => Promise<import('../../api/services/generated/api').GEMRoad[]>;
|
|
@@ -1,6 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare const MapInteractionsProvider: ({ children, mapLayers, caseObjectId, }:
|
|
3
|
-
children: React.ReactNode;
|
|
4
|
-
mapLayers: MapLayer[];
|
|
5
|
-
caseObjectId: number;
|
|
6
|
-
}) => import("react/jsx-runtime").JSX.Element;
|
|
1
|
+
import { MapInteractionsContextProps } from './types';
|
|
2
|
+
export declare const MapInteractionsProvider: ({ children, mapLayers, caseObjectId, setOuterDrawnGeometries, }: MapInteractionsContextProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Feature } from 'ol';
|
|
2
2
|
import { Geometry, MultiPolygon } from 'ol/geom';
|
|
3
|
-
import { MapLayer } from '../../components/Map/types';
|
|
4
|
-
export interface
|
|
3
|
+
import { MapExternalProps, MapLayer } from '../../components/Map/types';
|
|
4
|
+
export interface MapInteractionsContextValues {
|
|
5
5
|
isSelected: boolean;
|
|
6
6
|
setIsSelected: React.Dispatch<React.SetStateAction<boolean>>;
|
|
7
7
|
allowModify: boolean;
|
|
@@ -38,4 +38,11 @@ export interface MapInteractionsContextProps {
|
|
|
38
38
|
onToggleShowInfoLayer: () => void;
|
|
39
39
|
onAssignMapRepresentation: () => void;
|
|
40
40
|
onToggleShowLocation: () => void;
|
|
41
|
+
handleCollectGeometries: () => void;
|
|
42
|
+
}
|
|
43
|
+
export interface MapInteractionsContextProps {
|
|
44
|
+
children: React.ReactNode;
|
|
45
|
+
mapLayers: MapLayer[];
|
|
46
|
+
caseObjectId: number;
|
|
47
|
+
setOuterDrawnGeometries: MapExternalProps['setOuterDrawnGeometries'];
|
|
41
48
|
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare const MapInteractionsContext: import('react').Context<
|
|
3
|
-
export declare const useMapInteractionsContext: () =>
|
|
1
|
+
import { MapInteractionsContextValues } from './types';
|
|
2
|
+
export declare const MapInteractionsContext: import('react').Context<MapInteractionsContextValues | undefined>;
|
|
3
|
+
export declare const useMapInteractionsContext: () => MapInteractionsContextValues;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { MapExternalProps, MapLayer } from '../components/Map/types';
|
|
2
2
|
export declare const GEOLOCATION_LAYER = "geolocationLayer";
|
|
3
|
-
export declare const useSetupMap: (mapLayers: MapLayer[], caseObjectId: number,
|
|
3
|
+
export declare const useSetupMap: (mapLayers: MapLayer[], caseObjectId: number, setOuterDrawnGeometries: MapExternalProps['setOuterDrawnGeometries']) => void;
|