@reltio/components 1.4.1158 → 1.4.1161
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/cjs/components/AttributesFiltersBuilder/AttributesFiltersBuilder.js +2 -2
- package/cjs/components/AttributesFiltersBuilder/components/{ValueEditor/ValueEditor.d.ts → ValuesEditor/ValuesEditor.d.ts} +0 -0
- package/cjs/components/AttributesFiltersBuilder/components/{ValueEditor/ValueEditor.js → ValuesEditor/ValuesEditor.js} +0 -0
- package/cjs/components/AttributesFiltersBuilder/components/{ValueEditor → ValuesEditor}/styles.d.ts +0 -0
- package/cjs/components/AttributesFiltersBuilder/components/{ValueEditor → ValuesEditor}/styles.js +2 -0
- package/cjs/components/ProfilesList/styles.d.ts +1 -1
- package/cjs/components/ReltioMap/MapControls/TopRightMapControls/TopRightMapControls.js +1 -1
- package/cjs/components/ReltioMap/helpers/index.js +1 -1
- package/cjs/components/ReltioMap/index.d.ts +2 -1
- package/cjs/components/ReltioMap/index.js +3 -6
- package/cjs/constants/index.d.ts +1 -1
- package/cjs/constants/index.js +2 -1
- package/cjs/constants/map.d.ts +5 -0
- package/cjs/constants/map.js +6 -1
- package/esm/components/AttributesFiltersBuilder/AttributesFiltersBuilder.js +2 -2
- package/esm/components/AttributesFiltersBuilder/components/{ValueEditor/ValueEditor.d.ts → ValuesEditor/ValuesEditor.d.ts} +0 -0
- package/esm/components/AttributesFiltersBuilder/components/{ValueEditor/ValueEditor.js → ValuesEditor/ValuesEditor.js} +0 -0
- package/esm/components/AttributesFiltersBuilder/components/{ValueEditor → ValuesEditor}/styles.d.ts +0 -0
- package/esm/components/AttributesFiltersBuilder/components/{ValueEditor → ValuesEditor}/styles.js +2 -0
- package/esm/components/ProfilesList/styles.d.ts +1 -1
- package/esm/components/ReltioMap/MapControls/TopRightMapControls/TopRightMapControls.js +1 -1
- package/esm/components/ReltioMap/helpers/index.js +1 -1
- package/esm/components/ReltioMap/index.d.ts +2 -1
- package/esm/components/ReltioMap/index.js +4 -7
- package/esm/constants/index.d.ts +1 -1
- package/esm/constants/index.js +1 -1
- package/esm/constants/map.d.ts +5 -0
- package/esm/constants/map.js +5 -0
- package/package.json +3 -3
- package/cjs/components/ReltioMap/constants.d.ts +0 -14
- package/cjs/components/ReltioMap/constants.js +0 -17
- package/esm/components/ReltioMap/constants.d.ts +0 -14
- package/esm/components/ReltioMap/constants.js +0 -14
|
@@ -37,7 +37,7 @@ var FilterSelector_1 = __importDefault(require("./components/FilterSelector/Filt
|
|
|
37
37
|
var RowActions_1 = __importDefault(require("./components/RowActions/RowActions"));
|
|
38
38
|
var QueryBuilderRowsGroup_1 = __importDefault(require("../QueryBuilderRowsGroup/QueryBuilderRowsGroup"));
|
|
39
39
|
var AttributeSelector_1 = __importDefault(require("./components/AttributeSelector/AttributeSelector"));
|
|
40
|
-
var
|
|
40
|
+
var ValuesEditor_1 = __importDefault(require("./components/ValuesEditor/ValuesEditor"));
|
|
41
41
|
var styles_1 = require("./styles");
|
|
42
42
|
var EMPTY_FILTER = { fieldName: null, filter: null, values: [] };
|
|
43
43
|
var Stub = function () { return null; };
|
|
@@ -107,6 +107,6 @@ var AttributesFiltersBuilder = function (_a) {
|
|
|
107
107
|
var addNewFilter = react_1.useCallback(function (newFilter) {
|
|
108
108
|
onChange(__spreadArray(__spreadArray([], actualFilters.current), [newFilter]));
|
|
109
109
|
}, [onChange]);
|
|
110
|
-
return (react_1.default.createElement(QueryBuilderRowsGroup_1.default, { rowClasses: rowClasses, rowsData: rowsData, AttributeSelectorComponent: AttributeSelector_1.default, FilterSelectorComponent: FilterSelector_1.default, ValuesEditorComponent:
|
|
110
|
+
return (react_1.default.createElement(QueryBuilderRowsGroup_1.default, { rowClasses: rowClasses, rowsData: rowsData, AttributeSelectorComponent: AttributeSelector_1.default, FilterSelectorComponent: FilterSelector_1.default, ValuesEditorComponent: ValuesEditor_1.default, ActionsComponent: RowActions_1.default, LogicOperatorComponent: Stub, filterSelectorRefIndex: lastAttributesCountRef.current, filterSelectorRef: attributeFilterRef, lastRowAttributeSelectorProps: lastRowAttributeSelectorProps, attributesGroup: attributeSelectorItems, changeFilter: changeFilter, addNewFilter: addNewFilter, addRowAfterIndex: addRowAfterIndex, removeRow: removeRow, duplicateRow: duplicateRow }));
|
|
111
111
|
};
|
|
112
112
|
exports.default = react_1.memo(AttributesFiltersBuilder);
|
|
File without changes
|
|
File without changes
|
package/cjs/components/AttributesFiltersBuilder/components/{ValueEditor → ValuesEditor}/styles.d.ts
RENAMED
|
File without changes
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const useStyles: (props?: any) => import("@material-ui/core/styles/withStyles").ClassNameMap<"label" | "
|
|
1
|
+
export declare const useStyles: (props?: any) => import("@material-ui/core/styles/withStyles").ClassNameMap<"label" | "item" | "image" | "secondaryLabel" | "inactive" | "selected" | "avatar" | "clickable" | "info" | "@keyframes animate" | "highlighted" | "justImported" | "businessCard" | "secondRow">;
|
|
@@ -9,7 +9,7 @@ var ui_i18n_1 = __importDefault(require("ui-i18n"));
|
|
|
9
9
|
var Button_1 = __importDefault(require("@material-ui/core/Button"));
|
|
10
10
|
var HOCs_1 = require("../../../../HOCs");
|
|
11
11
|
var HighlightOff_1 = __importDefault(require("@material-ui/icons/HighlightOff"));
|
|
12
|
-
var constants_1 = require("
|
|
12
|
+
var constants_1 = require("../../../../constants");
|
|
13
13
|
var Radius_1 = __importDefault(require("../../../../icons/Radius"));
|
|
14
14
|
var Draw_1 = __importDefault(require("../../../../icons/Draw"));
|
|
15
15
|
var styles_1 = require("./styles");
|
|
@@ -6,7 +6,7 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from) {
|
|
|
6
6
|
};
|
|
7
7
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
8
|
exports.fitMapBoundsForOverlay = exports.fitMapBoundsForMarkers = exports.getDrawingMode = exports.getMapBoundsPolygon = void 0;
|
|
9
|
-
var constants_1 = require("
|
|
9
|
+
var constants_1 = require("../../../constants");
|
|
10
10
|
var getMapBoundsPolygon = function (map) {
|
|
11
11
|
var bounds = map.getBounds();
|
|
12
12
|
var ne = bounds.getNorthEast();
|
|
@@ -15,6 +15,7 @@ declare type Props = {
|
|
|
15
15
|
drawingModes?: DrawingModes;
|
|
16
16
|
markerClusterer?: boolean;
|
|
17
17
|
markerClustererOptions?: MarkerClustererProps['options'];
|
|
18
|
+
mapOptions?: google.maps.MapOptions;
|
|
18
19
|
mapContainerClassName: string;
|
|
19
20
|
onMapBoundsChanged?: (value: MapBounds | null) => void;
|
|
20
21
|
onOverlayUpdated?: (value: {
|
|
@@ -23,5 +24,5 @@ declare type Props = {
|
|
|
23
24
|
}) => void;
|
|
24
25
|
onMarkerClicked?: (value: Marker) => void;
|
|
25
26
|
};
|
|
26
|
-
export declare const ReltioMap: ({ markers, mapKey, defaultZoom, defaultCenter, loadingElement, isSearchOnMapMove, isSearchEnabled, activeOverlay, overlayOptions, drawingModes, markerClusterer, markerClustererOptions, mapContainerClassName, onMapBoundsChanged, onOverlayUpdated, onMarkerClicked }: Props) => JSX.Element;
|
|
27
|
+
export declare const ReltioMap: ({ markers, mapKey, defaultZoom, defaultCenter, loadingElement, isSearchOnMapMove, isSearchEnabled, activeOverlay, overlayOptions, drawingModes, markerClusterer, markerClustererOptions, mapOptions, mapContainerClassName, onMapBoundsChanged, onOverlayUpdated, onMarkerClicked }: Props) => JSX.Element;
|
|
27
28
|
export {};
|
|
@@ -63,7 +63,7 @@ var useFitMapBounds = function (_a) {
|
|
|
63
63
|
}, [map, markers, activeOverlay]);
|
|
64
64
|
};
|
|
65
65
|
var ReltioMap = function (_a) {
|
|
66
|
-
var _b = _a.markers, markers = _b === void 0 ? [] : _b, mapKey = _a.mapKey, defaultZoom = _a.defaultZoom, defaultCenter = _a.defaultCenter, loadingElement = _a.loadingElement, isSearchOnMapMove = _a.isSearchOnMapMove, isSearchEnabled = _a.isSearchEnabled, activeOverlay = _a.activeOverlay, overlayOptions = _a.overlayOptions, _c = _a.drawingModes, drawingModes = _c === void 0 ? [] : _c, markerClusterer = _a.markerClusterer, markerClustererOptions = _a.markerClustererOptions, mapContainerClassName = _a.mapContainerClassName, onMapBoundsChanged = _a.onMapBoundsChanged, onOverlayUpdated = _a.onOverlayUpdated, onMarkerClicked = _a.onMarkerClicked;
|
|
66
|
+
var _b = _a.markers, markers = _b === void 0 ? [] : _b, mapKey = _a.mapKey, defaultZoom = _a.defaultZoom, defaultCenter = _a.defaultCenter, loadingElement = _a.loadingElement, isSearchOnMapMove = _a.isSearchOnMapMove, isSearchEnabled = _a.isSearchEnabled, activeOverlay = _a.activeOverlay, overlayOptions = _a.overlayOptions, _c = _a.drawingModes, drawingModes = _c === void 0 ? [] : _c, markerClusterer = _a.markerClusterer, markerClustererOptions = _a.markerClustererOptions, mapOptions = _a.mapOptions, mapContainerClassName = _a.mapContainerClassName, onMapBoundsChanged = _a.onMapBoundsChanged, onOverlayUpdated = _a.onOverlayUpdated, onMarkerClicked = _a.onMarkerClicked;
|
|
67
67
|
var styles = styles_1.useStyles();
|
|
68
68
|
var _d = api_1.useJsApiLoader({
|
|
69
69
|
googleMapsApiKey: mapKey,
|
|
@@ -75,6 +75,7 @@ var ReltioMap = function (_a) {
|
|
|
75
75
|
var _g = react_1.useState(null), drawingMode = _g[0], setDrawingMode = _g[1];
|
|
76
76
|
useFitMapBounds({ markers: markers, activeOverlay: activeOverlay, map: map, isSearchOnMapMove: isSearchOnMapMove });
|
|
77
77
|
var allOverlayOptions = react_1.useMemo(function () { return (__assign(__assign({}, constants_1.DEFAULT_OVERLAY_OPTIONS), (overlayOptions || {}))); }, [overlayOptions]);
|
|
78
|
+
var googleMapOptions = react_1.useMemo(function () { return (__assign(__assign({}, constants_1.DEFAULT_GOOGLE_MAP_OPTIONS), (mapOptions || {}))); }, [mapOptions]);
|
|
78
79
|
var handleChangeIsSearchOnMapMove = react_1.useCallback(function (isSearchOnMapMove) {
|
|
79
80
|
onMapBoundsChanged(isSearchOnMapMove ? helpers_1.getMapBoundsPolygon(map) : null);
|
|
80
81
|
setDrawingMode(null);
|
|
@@ -140,11 +141,7 @@ var ReltioMap = function (_a) {
|
|
|
140
141
|
if (!isLoaded) {
|
|
141
142
|
return loadingElement;
|
|
142
143
|
}
|
|
143
|
-
return (react_1.default.createElement(api_1.GoogleMap, { mapTypeId: window.google.maps.MapTypeId.ROADMAP, options:
|
|
144
|
-
mapTypeControl: false,
|
|
145
|
-
streetViewControl: false,
|
|
146
|
-
fullscreenControl: false
|
|
147
|
-
}, onLoad: setMap, zoom: defaultZoom, center: defaultCenter, onZoomChanged: handleMapMoveStart, onDragStart: handleMapMoveStart, onIdle: handleMapIdle, mapContainerClassName: mapContainerClassName },
|
|
144
|
+
return (react_1.default.createElement(api_1.GoogleMap, { mapTypeId: window.google.maps.MapTypeId.ROADMAP, options: googleMapOptions, onLoad: setMap, zoom: defaultZoom, center: defaultCenter, onZoomChanged: handleMapMoveStart, onDragStart: handleMapMoveStart, onIdle: handleMapIdle, mapContainerClassName: mapContainerClassName },
|
|
148
145
|
map && isSearchEnabled && Boolean(drawingModes.length) && (react_1.default.createElement(MapControlContrainer_1.MapControlContainer, { className: styles.mapControlContainer, position: window.google.maps.ControlPosition.TOP_RIGHT, map: map },
|
|
149
146
|
react_1.default.createElement(TopRightMapControls_1.TopRightMapControls, { hasActiveOverlay: !!activeOverlay, drawingModes: drawingModes, drawingMode: drawingMode, onDrawingModeChanged: setDrawingMode, onClearOverlay: handleClearOverlay }))),
|
|
150
147
|
map && isSearchEnabled && (react_1.default.createElement(MapControlContrainer_1.MapControlContainer, { className: styles.mapControlContainer, position: window.google.maps.ControlPosition.TOP_CENTER, map: map },
|
package/cjs/constants/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export { COMMENTS_CONTAINER_VISIBILITY_AREA } from "./classnames";
|
|
2
2
|
export { ALWAYS_VISIBLE_TYPE_URIS } from "./attributes";
|
|
3
3
|
export { SortingType, ColumnFilterType, ColumnsDataType, QueryBuilderAttributeType, QueryBuilderAttributeDataType } from "./prop-types";
|
|
4
|
-
export { MAP_DRAWING_MODES, DEFAULT_OVERLAY_OPTIONS, MAP_MINIMUM_SCALE_RADIUS } from "./map";
|
|
4
|
+
export { MAP_DRAWING_MODES, DEFAULT_GOOGLE_MAP_OPTIONS, DEFAULT_OVERLAY_OPTIONS, MAP_MINIMUM_SCALE_RADIUS } from "./map";
|
package/cjs/constants/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.MAP_MINIMUM_SCALE_RADIUS = exports.DEFAULT_OVERLAY_OPTIONS = exports.MAP_DRAWING_MODES = exports.ALWAYS_VISIBLE_TYPE_URIS = exports.COMMENTS_CONTAINER_VISIBILITY_AREA = exports.QueryBuilderAttributeDataType = exports.QueryBuilderAttributeType = exports.ColumnsDataType = exports.ColumnFilterType = exports.SortingType = void 0;
|
|
3
|
+
exports.MAP_MINIMUM_SCALE_RADIUS = exports.DEFAULT_OVERLAY_OPTIONS = exports.DEFAULT_GOOGLE_MAP_OPTIONS = exports.MAP_DRAWING_MODES = exports.ALWAYS_VISIBLE_TYPE_URIS = exports.COMMENTS_CONTAINER_VISIBILITY_AREA = exports.QueryBuilderAttributeDataType = exports.QueryBuilderAttributeType = exports.ColumnsDataType = exports.ColumnFilterType = exports.SortingType = void 0;
|
|
4
4
|
var prop_types_1 = require("./prop-types");
|
|
5
5
|
Object.defineProperty(exports, "SortingType", { enumerable: true, get: function () { return prop_types_1.SortingType; } });
|
|
6
6
|
Object.defineProperty(exports, "ColumnFilterType", { enumerable: true, get: function () { return prop_types_1.ColumnFilterType; } });
|
|
@@ -13,5 +13,6 @@ var attributes_1 = require("./attributes");
|
|
|
13
13
|
Object.defineProperty(exports, "ALWAYS_VISIBLE_TYPE_URIS", { enumerable: true, get: function () { return attributes_1.ALWAYS_VISIBLE_TYPE_URIS; } });
|
|
14
14
|
var map_1 = require("./map");
|
|
15
15
|
Object.defineProperty(exports, "MAP_DRAWING_MODES", { enumerable: true, get: function () { return map_1.MAP_DRAWING_MODES; } });
|
|
16
|
+
Object.defineProperty(exports, "DEFAULT_GOOGLE_MAP_OPTIONS", { enumerable: true, get: function () { return map_1.DEFAULT_GOOGLE_MAP_OPTIONS; } });
|
|
16
17
|
Object.defineProperty(exports, "DEFAULT_OVERLAY_OPTIONS", { enumerable: true, get: function () { return map_1.DEFAULT_OVERLAY_OPTIONS; } });
|
|
17
18
|
Object.defineProperty(exports, "MAP_MINIMUM_SCALE_RADIUS", { enumerable: true, get: function () { return map_1.MAP_MINIMUM_SCALE_RADIUS; } });
|
package/cjs/constants/map.d.ts
CHANGED
|
@@ -11,4 +11,9 @@ export declare const DEFAULT_OVERLAY_OPTIONS: {
|
|
|
11
11
|
editable: boolean;
|
|
12
12
|
zIndex: number;
|
|
13
13
|
};
|
|
14
|
+
export declare const DEFAULT_GOOGLE_MAP_OPTIONS: {
|
|
15
|
+
mapTypeControl: boolean;
|
|
16
|
+
streetViewControl: boolean;
|
|
17
|
+
fullscreenControl: boolean;
|
|
18
|
+
};
|
|
14
19
|
export declare const MAP_MINIMUM_SCALE_RADIUS = 0.001;
|
package/cjs/constants/map.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.MAP_MINIMUM_SCALE_RADIUS = exports.DEFAULT_OVERLAY_OPTIONS = exports.MAP_DRAWING_MODES = void 0;
|
|
3
|
+
exports.MAP_MINIMUM_SCALE_RADIUS = exports.DEFAULT_GOOGLE_MAP_OPTIONS = exports.DEFAULT_OVERLAY_OPTIONS = exports.MAP_DRAWING_MODES = void 0;
|
|
4
4
|
exports.MAP_DRAWING_MODES = {
|
|
5
5
|
CIRCLE: 'circle',
|
|
6
6
|
POLYGON: 'polygon'
|
|
@@ -14,4 +14,9 @@ exports.DEFAULT_OVERLAY_OPTIONS = {
|
|
|
14
14
|
editable: true,
|
|
15
15
|
zIndex: 1
|
|
16
16
|
};
|
|
17
|
+
exports.DEFAULT_GOOGLE_MAP_OPTIONS = {
|
|
18
|
+
mapTypeControl: false,
|
|
19
|
+
streetViewControl: false,
|
|
20
|
+
fullscreenControl: false
|
|
21
|
+
};
|
|
17
22
|
exports.MAP_MINIMUM_SCALE_RADIUS = 0.001;
|
|
@@ -13,7 +13,7 @@ import FilterSelector from './components/FilterSelector/FilterSelector';
|
|
|
13
13
|
import RowActions from './components/RowActions/RowActions';
|
|
14
14
|
import QueryBuilderRowsGroup from '../QueryBuilderRowsGroup/QueryBuilderRowsGroup';
|
|
15
15
|
import AttributeSelector from './components/AttributeSelector/AttributeSelector';
|
|
16
|
-
import
|
|
16
|
+
import ValuesEditor from './components/ValuesEditor/ValuesEditor';
|
|
17
17
|
import { useStyles } from './styles';
|
|
18
18
|
var EMPTY_FILTER = { fieldName: null, filter: null, values: [] };
|
|
19
19
|
var Stub = function () { return null; };
|
|
@@ -83,6 +83,6 @@ var AttributesFiltersBuilder = function (_a) {
|
|
|
83
83
|
var addNewFilter = useCallback(function (newFilter) {
|
|
84
84
|
onChange(__spreadArray(__spreadArray([], actualFilters.current), [newFilter]));
|
|
85
85
|
}, [onChange]);
|
|
86
|
-
return (React.createElement(QueryBuilderRowsGroup, { rowClasses: rowClasses, rowsData: rowsData, AttributeSelectorComponent: AttributeSelector, FilterSelectorComponent: FilterSelector, ValuesEditorComponent:
|
|
86
|
+
return (React.createElement(QueryBuilderRowsGroup, { rowClasses: rowClasses, rowsData: rowsData, AttributeSelectorComponent: AttributeSelector, FilterSelectorComponent: FilterSelector, ValuesEditorComponent: ValuesEditor, ActionsComponent: RowActions, LogicOperatorComponent: Stub, filterSelectorRefIndex: lastAttributesCountRef.current, filterSelectorRef: attributeFilterRef, lastRowAttributeSelectorProps: lastRowAttributeSelectorProps, attributesGroup: attributeSelectorItems, changeFilter: changeFilter, addNewFilter: addNewFilter, addRowAfterIndex: addRowAfterIndex, removeRow: removeRow, duplicateRow: duplicateRow }));
|
|
87
87
|
};
|
|
88
88
|
export default memo(AttributesFiltersBuilder);
|
|
File without changes
|
|
File without changes
|
package/esm/components/AttributesFiltersBuilder/components/{ValueEditor → ValuesEditor}/styles.d.ts
RENAMED
|
File without changes
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const useStyles: (props?: any) => import("@material-ui/core/styles/withStyles").ClassNameMap<"label" | "
|
|
1
|
+
export declare const useStyles: (props?: any) => import("@material-ui/core/styles/withStyles").ClassNameMap<"label" | "item" | "image" | "secondaryLabel" | "inactive" | "selected" | "avatar" | "clickable" | "info" | "@keyframes animate" | "highlighted" | "justImported" | "businessCard" | "secondRow">;
|
|
@@ -3,7 +3,7 @@ import i18n from 'ui-i18n';
|
|
|
3
3
|
import Button from '@material-ui/core/Button';
|
|
4
4
|
import { withTooltip } from '../../../../HOCs';
|
|
5
5
|
import HighlightOffIcon from '@material-ui/icons/HighlightOff';
|
|
6
|
-
import { MAP_DRAWING_MODES } from '
|
|
6
|
+
import { MAP_DRAWING_MODES } from '../../../../constants';
|
|
7
7
|
import RadiusIcon from '../../../../icons/Radius';
|
|
8
8
|
import DrawIcon from '../../../../icons/Draw';
|
|
9
9
|
import { useStyles } from './styles';
|
|
@@ -3,7 +3,7 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from) {
|
|
|
3
3
|
to[j] = from[i];
|
|
4
4
|
return to;
|
|
5
5
|
};
|
|
6
|
-
import { MAP_DRAWING_MODES, MAP_MINIMUM_SCALE_RADIUS } from '
|
|
6
|
+
import { MAP_DRAWING_MODES, MAP_MINIMUM_SCALE_RADIUS } from '../../../constants';
|
|
7
7
|
export var getMapBoundsPolygon = function (map) {
|
|
8
8
|
var bounds = map.getBounds();
|
|
9
9
|
var ne = bounds.getNorthEast();
|
|
@@ -15,6 +15,7 @@ declare type Props = {
|
|
|
15
15
|
drawingModes?: DrawingModes;
|
|
16
16
|
markerClusterer?: boolean;
|
|
17
17
|
markerClustererOptions?: MarkerClustererProps['options'];
|
|
18
|
+
mapOptions?: google.maps.MapOptions;
|
|
18
19
|
mapContainerClassName: string;
|
|
19
20
|
onMapBoundsChanged?: (value: MapBounds | null) => void;
|
|
20
21
|
onOverlayUpdated?: (value: {
|
|
@@ -23,5 +24,5 @@ declare type Props = {
|
|
|
23
24
|
}) => void;
|
|
24
25
|
onMarkerClicked?: (value: Marker) => void;
|
|
25
26
|
};
|
|
26
|
-
export declare const ReltioMap: ({ markers, mapKey, defaultZoom, defaultCenter, loadingElement, isSearchOnMapMove, isSearchEnabled, activeOverlay, overlayOptions, drawingModes, markerClusterer, markerClustererOptions, mapContainerClassName, onMapBoundsChanged, onOverlayUpdated, onMarkerClicked }: Props) => JSX.Element;
|
|
27
|
+
export declare const ReltioMap: ({ markers, mapKey, defaultZoom, defaultCenter, loadingElement, isSearchOnMapMove, isSearchEnabled, activeOverlay, overlayOptions, drawingModes, markerClusterer, markerClustererOptions, mapOptions, mapContainerClassName, onMapBoundsChanged, onOverlayUpdated, onMarkerClicked }: Props) => JSX.Element;
|
|
27
28
|
export {};
|
|
@@ -17,7 +17,7 @@ import { TopRightMapControls } from './MapControls/TopRightMapControls/TopRightM
|
|
|
17
17
|
import { TopCenterMapControls } from './MapControls/TopCenterMapControls/TopCenterMapControls';
|
|
18
18
|
import { getMapBoundsPolygon, getDrawingMode, fitMapBoundsForMarkers, fitMapBoundsForOverlay } from './helpers';
|
|
19
19
|
import EntityMarker from './EntityMarker/EntityMarker';
|
|
20
|
-
import { DEFAULT_OVERLAY_OPTIONS, MAP_DRAWING_MODES } from '../../constants';
|
|
20
|
+
import { DEFAULT_GOOGLE_MAP_OPTIONS, DEFAULT_OVERLAY_OPTIONS, MAP_DRAWING_MODES } from '../../constants';
|
|
21
21
|
import { useStyles } from './styles';
|
|
22
22
|
import { usePrevious } from '../../hooks';
|
|
23
23
|
var ON_MAP_MOVE_DEBOUNCE_INTERVAL = 1000;
|
|
@@ -38,7 +38,7 @@ var useFitMapBounds = function (_a) {
|
|
|
38
38
|
}, [map, markers, activeOverlay]);
|
|
39
39
|
};
|
|
40
40
|
export var ReltioMap = function (_a) {
|
|
41
|
-
var _b = _a.markers, markers = _b === void 0 ? [] : _b, mapKey = _a.mapKey, defaultZoom = _a.defaultZoom, defaultCenter = _a.defaultCenter, loadingElement = _a.loadingElement, isSearchOnMapMove = _a.isSearchOnMapMove, isSearchEnabled = _a.isSearchEnabled, activeOverlay = _a.activeOverlay, overlayOptions = _a.overlayOptions, _c = _a.drawingModes, drawingModes = _c === void 0 ? [] : _c, markerClusterer = _a.markerClusterer, markerClustererOptions = _a.markerClustererOptions, mapContainerClassName = _a.mapContainerClassName, onMapBoundsChanged = _a.onMapBoundsChanged, onOverlayUpdated = _a.onOverlayUpdated, onMarkerClicked = _a.onMarkerClicked;
|
|
41
|
+
var _b = _a.markers, markers = _b === void 0 ? [] : _b, mapKey = _a.mapKey, defaultZoom = _a.defaultZoom, defaultCenter = _a.defaultCenter, loadingElement = _a.loadingElement, isSearchOnMapMove = _a.isSearchOnMapMove, isSearchEnabled = _a.isSearchEnabled, activeOverlay = _a.activeOverlay, overlayOptions = _a.overlayOptions, _c = _a.drawingModes, drawingModes = _c === void 0 ? [] : _c, markerClusterer = _a.markerClusterer, markerClustererOptions = _a.markerClustererOptions, mapOptions = _a.mapOptions, mapContainerClassName = _a.mapContainerClassName, onMapBoundsChanged = _a.onMapBoundsChanged, onOverlayUpdated = _a.onOverlayUpdated, onMarkerClicked = _a.onMarkerClicked;
|
|
42
42
|
var styles = useStyles();
|
|
43
43
|
var _d = useJsApiLoader({
|
|
44
44
|
googleMapsApiKey: mapKey,
|
|
@@ -50,6 +50,7 @@ export var ReltioMap = function (_a) {
|
|
|
50
50
|
var _g = useState(null), drawingMode = _g[0], setDrawingMode = _g[1];
|
|
51
51
|
useFitMapBounds({ markers: markers, activeOverlay: activeOverlay, map: map, isSearchOnMapMove: isSearchOnMapMove });
|
|
52
52
|
var allOverlayOptions = useMemo(function () { return (__assign(__assign({}, DEFAULT_OVERLAY_OPTIONS), (overlayOptions || {}))); }, [overlayOptions]);
|
|
53
|
+
var googleMapOptions = useMemo(function () { return (__assign(__assign({}, DEFAULT_GOOGLE_MAP_OPTIONS), (mapOptions || {}))); }, [mapOptions]);
|
|
53
54
|
var handleChangeIsSearchOnMapMove = useCallback(function (isSearchOnMapMove) {
|
|
54
55
|
onMapBoundsChanged(isSearchOnMapMove ? getMapBoundsPolygon(map) : null);
|
|
55
56
|
setDrawingMode(null);
|
|
@@ -115,11 +116,7 @@ export var ReltioMap = function (_a) {
|
|
|
115
116
|
if (!isLoaded) {
|
|
116
117
|
return loadingElement;
|
|
117
118
|
}
|
|
118
|
-
return (React.createElement(GoogleMap, { mapTypeId: window.google.maps.MapTypeId.ROADMAP, options:
|
|
119
|
-
mapTypeControl: false,
|
|
120
|
-
streetViewControl: false,
|
|
121
|
-
fullscreenControl: false
|
|
122
|
-
}, onLoad: setMap, zoom: defaultZoom, center: defaultCenter, onZoomChanged: handleMapMoveStart, onDragStart: handleMapMoveStart, onIdle: handleMapIdle, mapContainerClassName: mapContainerClassName },
|
|
119
|
+
return (React.createElement(GoogleMap, { mapTypeId: window.google.maps.MapTypeId.ROADMAP, options: googleMapOptions, onLoad: setMap, zoom: defaultZoom, center: defaultCenter, onZoomChanged: handleMapMoveStart, onDragStart: handleMapMoveStart, onIdle: handleMapIdle, mapContainerClassName: mapContainerClassName },
|
|
123
120
|
map && isSearchEnabled && Boolean(drawingModes.length) && (React.createElement(MapControlContainer, { className: styles.mapControlContainer, position: window.google.maps.ControlPosition.TOP_RIGHT, map: map },
|
|
124
121
|
React.createElement(TopRightMapControls, { hasActiveOverlay: !!activeOverlay, drawingModes: drawingModes, drawingMode: drawingMode, onDrawingModeChanged: setDrawingMode, onClearOverlay: handleClearOverlay }))),
|
|
125
122
|
map && isSearchEnabled && (React.createElement(MapControlContainer, { className: styles.mapControlContainer, position: window.google.maps.ControlPosition.TOP_CENTER, map: map },
|
package/esm/constants/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export { COMMENTS_CONTAINER_VISIBILITY_AREA } from "./classnames";
|
|
2
2
|
export { ALWAYS_VISIBLE_TYPE_URIS } from "./attributes";
|
|
3
3
|
export { SortingType, ColumnFilterType, ColumnsDataType, QueryBuilderAttributeType, QueryBuilderAttributeDataType } from "./prop-types";
|
|
4
|
-
export { MAP_DRAWING_MODES, DEFAULT_OVERLAY_OPTIONS, MAP_MINIMUM_SCALE_RADIUS } from "./map";
|
|
4
|
+
export { MAP_DRAWING_MODES, DEFAULT_GOOGLE_MAP_OPTIONS, DEFAULT_OVERLAY_OPTIONS, MAP_MINIMUM_SCALE_RADIUS } from "./map";
|
package/esm/constants/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export { SortingType, ColumnFilterType, ColumnsDataType, QueryBuilderAttributeType, QueryBuilderAttributeDataType } from './prop-types';
|
|
2
2
|
export { COMMENTS_CONTAINER_VISIBILITY_AREA } from './classnames';
|
|
3
3
|
export { ALWAYS_VISIBLE_TYPE_URIS } from './attributes';
|
|
4
|
-
export { MAP_DRAWING_MODES, DEFAULT_OVERLAY_OPTIONS, MAP_MINIMUM_SCALE_RADIUS } from './map';
|
|
4
|
+
export { MAP_DRAWING_MODES, DEFAULT_GOOGLE_MAP_OPTIONS, DEFAULT_OVERLAY_OPTIONS, MAP_MINIMUM_SCALE_RADIUS } from './map';
|
package/esm/constants/map.d.ts
CHANGED
|
@@ -11,4 +11,9 @@ export declare const DEFAULT_OVERLAY_OPTIONS: {
|
|
|
11
11
|
editable: boolean;
|
|
12
12
|
zIndex: number;
|
|
13
13
|
};
|
|
14
|
+
export declare const DEFAULT_GOOGLE_MAP_OPTIONS: {
|
|
15
|
+
mapTypeControl: boolean;
|
|
16
|
+
streetViewControl: boolean;
|
|
17
|
+
fullscreenControl: boolean;
|
|
18
|
+
};
|
|
14
19
|
export declare const MAP_MINIMUM_SCALE_RADIUS = 0.001;
|
package/esm/constants/map.js
CHANGED
package/package.json
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@reltio/components",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.1161",
|
|
4
4
|
"license": "SEE LICENSE IN LICENSE FILE",
|
|
5
5
|
"main": "./cjs/index.js",
|
|
6
6
|
"module": "./esm/index.js",
|
|
7
7
|
"dependencies": {
|
|
8
8
|
"@date-io/moment": "^1.3.5",
|
|
9
9
|
"@react-google-maps/api": "2.7.0",
|
|
10
|
-
"@reltio/mdm-module": "^1.4.
|
|
11
|
-
"@reltio/mdm-sdk": "^1.4.
|
|
10
|
+
"@reltio/mdm-module": "^1.4.1161",
|
|
11
|
+
"@reltio/mdm-sdk": "^1.4.1161",
|
|
12
12
|
"classnames": "^2.2.5",
|
|
13
13
|
"d3-cloud": "^1.2.5",
|
|
14
14
|
"d3-geo": "^2.0.1",
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
export declare const MAP_DRAWING_MODES: {
|
|
2
|
-
CIRCLE: string;
|
|
3
|
-
POLYGON: string;
|
|
4
|
-
};
|
|
5
|
-
export declare const DEFAULT_OVERLAY_OPTIONS: {
|
|
6
|
-
fillColor: string;
|
|
7
|
-
fillOpacity: number;
|
|
8
|
-
strokeWeight: number;
|
|
9
|
-
strokeColor: string;
|
|
10
|
-
clickable: boolean;
|
|
11
|
-
editable: boolean;
|
|
12
|
-
zIndex: number;
|
|
13
|
-
};
|
|
14
|
-
export declare const MAP_MINIMUM_SCALE_RADIUS = 0.001;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.MAP_MINIMUM_SCALE_RADIUS = exports.DEFAULT_OVERLAY_OPTIONS = exports.MAP_DRAWING_MODES = void 0;
|
|
4
|
-
exports.MAP_DRAWING_MODES = {
|
|
5
|
-
CIRCLE: 'circle',
|
|
6
|
-
POLYGON: 'polygon'
|
|
7
|
-
};
|
|
8
|
-
exports.DEFAULT_OVERLAY_OPTIONS = {
|
|
9
|
-
fillColor: 'rgb(242,82,82)',
|
|
10
|
-
fillOpacity: 0.1,
|
|
11
|
-
strokeWeight: 2,
|
|
12
|
-
strokeColor: '#F25252',
|
|
13
|
-
clickable: false,
|
|
14
|
-
editable: true,
|
|
15
|
-
zIndex: 1
|
|
16
|
-
};
|
|
17
|
-
exports.MAP_MINIMUM_SCALE_RADIUS = 0.001;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
export declare const MAP_DRAWING_MODES: {
|
|
2
|
-
CIRCLE: string;
|
|
3
|
-
POLYGON: string;
|
|
4
|
-
};
|
|
5
|
-
export declare const DEFAULT_OVERLAY_OPTIONS: {
|
|
6
|
-
fillColor: string;
|
|
7
|
-
fillOpacity: number;
|
|
8
|
-
strokeWeight: number;
|
|
9
|
-
strokeColor: string;
|
|
10
|
-
clickable: boolean;
|
|
11
|
-
editable: boolean;
|
|
12
|
-
zIndex: number;
|
|
13
|
-
};
|
|
14
|
-
export declare const MAP_MINIMUM_SCALE_RADIUS = 0.001;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
export var MAP_DRAWING_MODES = {
|
|
2
|
-
CIRCLE: 'circle',
|
|
3
|
-
POLYGON: 'polygon'
|
|
4
|
-
};
|
|
5
|
-
export var DEFAULT_OVERLAY_OPTIONS = {
|
|
6
|
-
fillColor: 'rgb(242,82,82)',
|
|
7
|
-
fillOpacity: 0.1,
|
|
8
|
-
strokeWeight: 2,
|
|
9
|
-
strokeColor: '#F25252',
|
|
10
|
-
clickable: false,
|
|
11
|
-
editable: true,
|
|
12
|
-
zIndex: 1
|
|
13
|
-
};
|
|
14
|
-
export var MAP_MINIMUM_SCALE_RADIUS = 0.001;
|