@smart-factor/gem-ui-map-component 0.0.17 → 0.0.19
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-II1mKZSY.js → MapButtons-CcIHdsKh.js} +11982 -11840
- package/dist/components/Layers/Layers.d.ts +3 -1
- package/dist/components/Map/Map.d.ts +1 -1
- package/dist/components/Map/config.d.ts +3 -2
- package/dist/components/Map/refManager.d.ts +3 -1
- package/dist/components/Map/types.d.ts +18 -1
- package/dist/components/MapButtons/index.js +1 -1
- package/dist/components/MapSidebar/MapSidebar.style.d.ts +1 -1
- package/dist/components/SnapConfigBar/SnapConfigBar.styles.d.ts +1 -1
- package/dist/contexts/MapInteractionsContext/MapInteractionsContextProvider.d.ts +1 -1
- package/dist/contexts/MapInteractionsContext/types.d.ts +3 -0
- package/dist/hooks/useSetupMap.d.ts +2 -2
- package/dist/main.js +3413 -3357
- package/dist/services/Map/MapService.d.ts +2 -1
- package/package.json +1 -1
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { MapExternalProps } from './types';
|
|
2
|
-
declare const MapWithProviders: ({ mapLayers, caseObjectId, sidebarConfig, mapButtonsConfig, mapElementsConfig, setOuterDrawnGeometries, }: MapExternalProps) => import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
declare const MapWithProviders: ({ mapLayers, caseObjectId, sidebarConfig, mapButtonsConfig, mapElementsConfig, setOuterDrawnGeometries, setOuterSelectedMapObjects, selectedFeatures, multiSelectEnabled, }: MapExternalProps) => import("react/jsx-runtime").JSX.Element;
|
|
3
3
|
export default MapWithProviders;
|
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
interface SidebarConfig {
|
|
2
2
|
sidebarVisible: boolean;
|
|
3
|
-
items: Record<'isStatic' | 'plotSearch' | 'addressSearch' | 'roadNavigation' | 'mapObjectSearch' | 'mapLayers', boolean>;
|
|
3
|
+
items: Record<'isStatic' | 'plotSearch' | 'addressSearch' | 'roadNavigation' | 'mapObjectSearch' | 'mapLayers' | 'onlyGemLayers', boolean>;
|
|
4
4
|
}
|
|
5
5
|
interface MapButtonsConfig {
|
|
6
6
|
mapButtonsVisible: boolean;
|
|
7
|
-
items: Record<'draw' | 'info' | 'assign' | 'geoLocation' | 'send' | 'smartGemSync', boolean>;
|
|
7
|
+
items: Record<'draw' | 'info' | 'assign' | 'geoLocation' | 'send' | 'smartGemSync' | 'centerToInitial', boolean>;
|
|
8
8
|
}
|
|
9
9
|
interface MapElementsConfig {
|
|
10
10
|
mapElementsVisible: boolean;
|
|
11
11
|
items: Record<'snapBar' | 'drawCreator', boolean>;
|
|
12
12
|
}
|
|
13
13
|
export interface MapConfig {
|
|
14
|
+
multiSelectEnabled: boolean;
|
|
14
15
|
sidebarConfig: SidebarConfig;
|
|
15
16
|
mapButtonsConfig: MapButtonsConfig;
|
|
16
17
|
mapElementsConfig: MapElementsConfig;
|
|
@@ -8,7 +8,7 @@ import { default as Select } from 'ol/interaction/Select';
|
|
|
8
8
|
import { default as Snap } from 'ol/interaction/Snap';
|
|
9
9
|
import { default as VectorLayer } from 'ol/layer/Vector';
|
|
10
10
|
import { default as VectorSource } from 'ol/source/Vector';
|
|
11
|
-
import { GEMRoadNetDetails, SnapConfiguration, VectorLayerType } from './types';
|
|
11
|
+
import { GEMRoadNetDetails, SelectedFeature, SnapConfiguration, VectorLayerType } from './types';
|
|
12
12
|
import * as olProj from 'ol/proj';
|
|
13
13
|
export interface Interactions {
|
|
14
14
|
draw?: Draw;
|
|
@@ -59,6 +59,8 @@ type NonNullableRefManager = {
|
|
|
59
59
|
isSnapActive: MutableRefObject<boolean>;
|
|
60
60
|
isSnapToAngleDisabled: MutableRefObject<boolean>;
|
|
61
61
|
snapConfig: MutableRefObject<SnapConfiguration>;
|
|
62
|
+
currentlySelectedFeatureIdsRef: MutableRefObject<Set<string | number>>;
|
|
63
|
+
initialSelectedFeaturesRef: MutableRefObject<SelectedFeature[] | undefined>;
|
|
62
64
|
};
|
|
63
65
|
export declare const useInitializeInteractionsRefs: () => void;
|
|
64
66
|
export declare const getMapRefs: () => NonNullableRefManager;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { Feature } from 'ol';
|
|
2
2
|
import { Coordinate } from 'ol/coordinate';
|
|
3
|
-
import { Geometry as GeometryApi, LineString, Point, Polygon } from 'ol/geom';
|
|
3
|
+
import { Geometry as GeometryApi, Geometry as GeometryOl, LineString, Point, Polygon } from 'ol/geom';
|
|
4
4
|
import { Type } from 'ol/geom/Geometry';
|
|
5
5
|
import { default as VectorLayer } from 'ol/layer/Vector';
|
|
6
6
|
import { default as VectorSource } from 'ol/source/Vector';
|
|
7
|
+
import { Style } from 'ol/style';
|
|
7
8
|
import { MapRepresentationDTO, Coordinate as CoordinateApi } from '../../api/services/generated/api';
|
|
8
9
|
import { GEMLayerConfig, WMSLayerConfig } from '../../services/Map/types';
|
|
9
10
|
import { MapConfig } from './config';
|
|
@@ -155,8 +156,24 @@ export type MapLayer = {
|
|
|
155
156
|
geometryType?: string;
|
|
156
157
|
};
|
|
157
158
|
export type DrawnGeometryParam = Omit<Geometry, 'geometries'>[];
|
|
159
|
+
export type SelectedFeature = {
|
|
160
|
+
id: number;
|
|
161
|
+
road_id?: number;
|
|
162
|
+
item_style?: Style | Style[] | null;
|
|
163
|
+
image?: string | null;
|
|
164
|
+
text?: string | null;
|
|
165
|
+
ref_id?: number | null;
|
|
166
|
+
parent_id?: number | null;
|
|
167
|
+
geometry: {
|
|
168
|
+
type: string;
|
|
169
|
+
coordinates: Coordinate | Coordinate[] | Coordinate[][] | Coordinate[][][];
|
|
170
|
+
geometries?: SelectedFeature['geometry'][] | null;
|
|
171
|
+
};
|
|
172
|
+
};
|
|
158
173
|
export interface MapExternalProps extends MapConfig {
|
|
159
174
|
mapLayers: MapLayer[];
|
|
160
175
|
setOuterDrawnGeometries?: (drawnGeometries: DrawnGeometryParam) => void;
|
|
176
|
+
setOuterSelectedMapObjects?: (selectedMapObjects: Feature<GeometryOl>[] | null) => void;
|
|
161
177
|
caseObjectId?: number;
|
|
178
|
+
selectedFeatures?: SelectedFeature[];
|
|
162
179
|
}
|
|
@@ -14,7 +14,7 @@ export declare const TitleContainer: import('@emotion/styled').StyledComponent<i
|
|
|
14
14
|
}, keyof import('@mui/system').BoxOwnProps<import('@mui/material').Theme>> & import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme>, {}, {}>;
|
|
15
15
|
export declare const CollapseButton: import('@emotion/styled').StyledComponent<import('@mui/material').IconButtonOwnProps & Omit<import('@mui/material').ButtonBaseOwnProps, "classes"> & import('@mui/material/OverridableComponent').CommonProps & Omit<Omit<import('react').DetailedHTMLProps<import('react').ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & {
|
|
16
16
|
ref?: ((instance: HTMLButtonElement | null) => void) | import('react').RefObject<HTMLButtonElement> | null | undefined;
|
|
17
|
-
}, "edge" | "color" | "children" | "style" | "className" | "classes" | "tabIndex" | "sx" | "disabled" | "action" | "loading" | "
|
|
17
|
+
}, "edge" | "color" | "children" | "style" | "size" | "className" | "classes" | "tabIndex" | "sx" | "disabled" | "action" | "loading" | "centerRipple" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "LinkComponent" | "onFocusVisible" | "TouchRippleProps" | "touchRippleRef" | "disableFocusRipple" | "loadingIndicator"> & import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme>, {}, {}>;
|
|
18
18
|
export declare const ContentDivider: import('@emotion/styled').StyledComponent<import('@mui/material').DividerOwnProps & import('@mui/material/OverridableComponent').CommonProps & Omit<Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLHRElement>, HTMLHRElement>, "ref"> & {
|
|
19
19
|
ref?: ((instance: HTMLHRElement | null) => void) | import('react').RefObject<HTMLHRElement> | null | undefined;
|
|
20
20
|
}, "children" | "style" | "textAlign" | "className" | "classes" | "sx" | "variant" | "orientation" | "absolute" | "flexItem" | "light"> & import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme>, {}, {}>;
|
|
@@ -4,5 +4,5 @@ export declare const Container: import('@emotion/styled').StyledComponent<import
|
|
|
4
4
|
}, keyof import('@mui/system').BoxOwnProps<import('@mui/material').Theme>> & import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme>, {}, {}>;
|
|
5
5
|
export declare const SnapSlider: import('@emotion/styled').StyledComponent<import('@mui/material').SliderOwnProps<number | number[]> & import('@mui/material/OverridableComponent').CommonProps & Omit<Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "ref"> & {
|
|
6
6
|
ref?: ((instance: HTMLSpanElement | null) => void) | import('react').RefObject<HTMLSpanElement> | null | undefined;
|
|
7
|
-
}, "name" | "color" | "value" | "style" | "track" | "scale" | "className" | "classes" | "defaultValue" | "tabIndex" | "aria-label" | "aria-labelledby" | "aria-valuetext" | "onChange" | "sx" | "max" | "min" | "orientation" | "disabled" | "
|
|
7
|
+
}, "name" | "color" | "value" | "style" | "track" | "size" | "scale" | "className" | "classes" | "defaultValue" | "tabIndex" | "aria-label" | "aria-labelledby" | "aria-valuetext" | "onChange" | "sx" | "max" | "min" | "orientation" | "disabled" | "step" | "components" | "componentsProps" | "slotProps" | "slots" | "disableSwap" | "getAriaLabel" | "getAriaValueText" | "marks" | "onChangeCommitted" | "shiftStep" | "valueLabelDisplay" | "valueLabelFormat"> & import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme>, {}, {}>;
|
|
8
8
|
export declare const LightTooltip: import('@emotion/styled').StyledComponent<TooltipProps & import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme>, {}, {}>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { MapInteractionsContextProps } from './types';
|
|
2
|
-
export declare const MapInteractionsProvider: ({ children, mapLayers, caseObjectId, setOuterDrawnGeometries, }: MapInteractionsContextProps) => import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
export declare const MapInteractionsProvider: ({ children, mapLayers, caseObjectId, setOuterDrawnGeometries, setOuterSelectedMapObjects, }: MapInteractionsContextProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -40,10 +40,13 @@ export interface MapInteractionsContextValues {
|
|
|
40
40
|
onToggleShowLocation: () => void;
|
|
41
41
|
handleCollectGeometries: () => void;
|
|
42
42
|
onSmartGemSync: () => void;
|
|
43
|
+
centerToInitialFeatures: () => void;
|
|
44
|
+
setOuterSelectedMapObjects: MapExternalProps['setOuterSelectedMapObjects'];
|
|
43
45
|
}
|
|
44
46
|
export interface MapInteractionsContextProps {
|
|
45
47
|
children: React.ReactNode;
|
|
46
48
|
mapLayers: MapLayer[];
|
|
47
49
|
caseObjectId: number;
|
|
48
50
|
setOuterDrawnGeometries: MapExternalProps['setOuterDrawnGeometries'];
|
|
51
|
+
setOuterSelectedMapObjects: MapExternalProps['setOuterSelectedMapObjects'];
|
|
49
52
|
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { MapLayer } from '../components/Map/types';
|
|
1
|
+
import { MapLayer, SelectedFeature } from '../components/Map/types';
|
|
2
2
|
export declare const GEOLOCATION_LAYER = "geolocationLayer";
|
|
3
|
-
export declare const useSetupMap: (mapLayers: MapLayer[], caseObjectId: number) => void;
|
|
3
|
+
export declare const useSetupMap: (mapLayers: MapLayer[], caseObjectId: number, initialSelectedFeatures?: SelectedFeature[], multiSelectEnabled?: boolean) => void;
|