@smart-factor/gem-ui-map-component 0.0.18 → 0.0.20

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.
@@ -1,5 +1,3 @@
1
1
  import { MapExternalProps } from './types';
2
- declare const MapWithProviders: ({ mapLayers, caseObjectId, sidebarConfig, mapButtonsConfig, mapElementsConfig, setOuterDrawnGeometries, setOuterSelectedMapObjects, selectedFeatureIds, multiSelectEnabled, }: MapExternalProps & {
3
- selectedFeatureIds?: number[];
4
- }) => import("react/jsx-runtime").JSX.Element;
2
+ declare const MapWithProviders: ({ id, mapLayers, caseObjectId, sidebarConfig, mapButtonsConfig, mapElementsConfig, setOuterDrawnGeometries, setOuterSelectedMapObjects, selectedFeatures, multiSelectEnabled, }: MapExternalProps) => import("react/jsx-runtime").JSX.Element;
5
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' | 'send' | 'smartGemSync', boolean>;
7
+ items: Record<'draw' | 'info' | 'assign' | 'geoLocation' | 'send' | 'smartGemSync' | 'centerToInitial', boolean>;
8
8
  }
9
9
  interface MapElementsConfig {
10
10
  mapElementsVisible: boolean;
@@ -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;
@@ -4,6 +4,7 @@ import { Geometry as GeometryApi, Geometry as GeometryOl, LineString, Point, Pol
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,10 +156,25 @@ 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 {
174
+ id?: string;
159
175
  mapLayers: MapLayer[];
160
176
  setOuterDrawnGeometries?: (drawnGeometries: DrawnGeometryParam) => void;
161
177
  setOuterSelectedMapObjects?: (selectedMapObjects: Feature<GeometryOl>[] | null) => void;
162
178
  caseObjectId?: number;
163
- selectedFeatureIds?: number[];
179
+ selectedFeatures?: SelectedFeature[];
164
180
  }
@@ -1,4 +1,4 @@
1
- import { M as f } from "../../MapButtons-DjsRiW1d.js";
1
+ import { M as f } from "../../MapButtons-jqCWr3CL.js";
2
2
  export {
3
3
  f as default
4
4
  };
@@ -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" | "size" | "centerRipple" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "LinkComponent" | "onFocusVisible" | "TouchRippleProps" | "touchRippleRef" | "disableFocusRipple" | "loadingIndicator"> & import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme>, {}, {}>;
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" | "size" | "step" | "components" | "componentsProps" | "slotProps" | "slots" | "disableSwap" | "getAriaLabel" | "getAriaValueText" | "marks" | "onChangeCommitted" | "shiftStep" | "valueLabelDisplay" | "valueLabelFormat"> & import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme>, {}, {}>;
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>, {}, {}>;
@@ -40,6 +40,7 @@ export interface MapInteractionsContextValues {
40
40
  onToggleShowLocation: () => void;
41
41
  handleCollectGeometries: () => void;
42
42
  onSmartGemSync: () => void;
43
+ centerToInitialFeatures: () => void;
43
44
  setOuterSelectedMapObjects: MapExternalProps['setOuterSelectedMapObjects'];
44
45
  }
45
46
  export interface MapInteractionsContextProps {
@@ -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, initialSelectedFeatureIds?: number[], multiSelectEnabled?: boolean) => void;
3
+ export declare const useSetupMap: (id: string, mapLayers: MapLayer[], caseObjectId: number, initialSelectedFeatures?: SelectedFeature[], multiSelectEnabled?: boolean) => void;