@dynatrace/strato-geo 3.2.1 → 3.3.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/esm/map/MapView.js +5 -3
- package/esm/map/MapView.js.map +2 -2
- package/esm/map/components/BubbleLayer/BubbleLayerTooltip.js +25 -57
- package/esm/map/components/BubbleLayer/BubbleLayerTooltip.js.map +2 -2
- package/esm/map/components/ChoroplethLayer/ChoroplethLayerTooltip.js +18 -41
- package/esm/map/components/ChoroplethLayer/ChoroplethLayerTooltip.js.map +2 -2
- package/esm/map/components/ConnectionLayer/ConnectionLayerTooltip.js +22 -47
- package/esm/map/components/ConnectionLayer/ConnectionLayerTooltip.js.map +2 -2
- package/esm/map/components/DefaultTooltip/DefaultTooltip.js +70 -29
- package/esm/map/components/DefaultTooltip/DefaultTooltip.js.map +2 -2
- package/esm/map/components/DotLayer/DotLayerTooltip.js +18 -45
- package/esm/map/components/DotLayer/DotLayerTooltip.js.map +2 -2
- package/esm/map/components/toolbar/MapToolbar.js +10 -8
- package/esm/map/components/toolbar/MapToolbar.js.map +2 -2
- package/esm/map/hooks/use-geo-layer-tooltip.js +23 -0
- package/esm/map/hooks/use-geo-layer-tooltip.js.map +7 -0
- package/esm/map/hooks/use-geo-tooltip-sync.js +79 -0
- package/esm/map/hooks/use-geo-tooltip-sync.js.map +7 -0
- package/esm/map/hooks/use-overlay-events.js +98 -29
- package/esm/map/hooks/use-overlay-events.js.map +2 -2
- package/esm/map/hooks/use-tooltip-event-listeners.js +6 -5
- package/esm/map/hooks/use-tooltip-event-listeners.js.map +2 -2
- package/esm/map/hooks/use-tooltip-template.js +22 -2
- package/esm/map/hooks/use-tooltip-template.js.map +2 -2
- package/esm/map/store/map-store.context.js +1 -5
- package/esm/map/store/map-store.context.js.map +2 -2
- package/esm/map/store/selectors.js +0 -10
- package/esm/map/store/selectors.js.map +2 -2
- package/esm/map/store/store.js +1 -67
- package/esm/map/store/store.js.map +2 -2
- package/esm/map/utils/build-geo-tooltip-state.js +28 -0
- package/esm/map/utils/build-geo-tooltip-state.js.map +7 -0
- package/esm/map/utils/tooltip-type-guards.js +2 -0
- package/esm/map/utils/tooltip-type-guards.js.map +2 -2
- package/map/MapView.d.ts +2 -2
- package/map/MapView.js +2 -2
- package/map/components/BubbleLayer/BubbleCircleLayer.d.ts +1 -1
- package/map/components/BubbleLayer/BubbleLayer.d.ts +1 -1
- package/map/components/BubbleLayer/BubbleLayerTooltip.d.ts +1 -1
- package/map/components/BubbleLayer/BubbleLayerTooltip.js +24 -50
- package/map/components/BubbleLayer/BubbleOutlineLayer.d.ts +1 -1
- package/map/components/ChoroplethLayer/ChoroplethLayer.d.ts +1 -1
- package/map/components/ChoroplethLayer/ChoroplethLayerTooltip.d.ts +1 -1
- package/map/components/ChoroplethLayer/ChoroplethLayerTooltip.js +17 -34
- package/map/components/ChoroplethLayer/ChoroplethOutlineLayer.d.ts +1 -1
- package/map/components/ConnectionLayer/ConnectionLayer.d.ts +1 -1
- package/map/components/ConnectionLayer/ConnectionLayerDirection.d.ts +1 -1
- package/map/components/ConnectionLayer/ConnectionLayerLine.d.ts +1 -1
- package/map/components/ConnectionLayer/ConnectionLayerTooltip.d.ts +1 -1
- package/map/components/ConnectionLayer/ConnectionLayerTooltip.js +21 -40
- package/map/components/DefaultTooltip/DefaultTooltip.d.ts +7 -2
- package/map/components/DefaultTooltip/DefaultTooltip.js +74 -27
- package/map/components/DotLayer/BackgroundLayer.d.ts +1 -1
- package/map/components/DotLayer/BackgroundSymbolLayer.d.ts +1 -1
- package/map/components/DotLayer/DotLayer.d.ts +1 -1
- package/map/components/DotLayer/DotLayerTooltip.d.ts +1 -1
- package/map/components/DotLayer/DotLayerTooltip.js +17 -38
- package/map/components/MapUnavailable.d.ts +1 -1
- package/map/components/TooltipWrapper.d.ts +1 -1
- package/map/components/legend/CategoricalLegendRenderer.d.ts +1 -1
- package/map/components/legend/MapLegendRenderer.d.ts +1 -1
- package/map/components/legend/SequentialLegendRenderer.d.ts +1 -1
- package/map/components/legend/ThresholdLegendRenderer.d.ts +1 -1
- package/map/components/toolbar/MapToolbar.d.ts +1 -1
- package/map/components/toolbar/MapToolbar.js +9 -7
- package/map/components/toolbar/buttons/MapDownloadDataButton.d.ts +1 -1
- package/map/components/toolbar/buttons/MapResetButton.d.ts +1 -1
- package/map/components/toolbar/buttons/MapZoomInOutButtons.d.ts +1 -1
- package/map/components/toolbar/buttons/MapZoomToFitButton.d.ts +1 -1
- package/map/hooks/use-geo-layer-tooltip.d.ts +10 -0
- package/map/hooks/use-geo-layer-tooltip.js +38 -0
- package/map/hooks/use-geo-tooltip-sync.d.ts +24 -0
- package/map/hooks/use-geo-tooltip-sync.js +95 -0
- package/map/hooks/use-overlay-events.js +94 -25
- package/map/hooks/use-tooltip-event-listeners.js +6 -5
- package/map/hooks/use-tooltip-template.d.ts +6 -1
- package/map/hooks/use-tooltip-template.js +22 -2
- package/map/providers/color-scale.provider.d.ts +1 -1
- package/map/providers/layer-color-strategy.provider.d.ts +1 -1
- package/map/providers/map-initial-view.provider.d.ts +1 -1
- package/map/slots/BubbleLayer.d.ts +1 -1
- package/map/slots/BubbleLayerTooltip.d.ts +1 -1
- package/map/slots/DotLayer.d.ts +1 -1
- package/map/slots/DotLayerTooltip.d.ts +1 -1
- package/map/store/map-store.context.d.ts +1 -1
- package/map/store/map-store.context.js +1 -5
- package/map/store/map-store.provider.d.ts +1 -1
- package/map/store/selectors.d.ts +6 -15
- package/map/store/selectors.js +0 -10
- package/map/store/store.d.ts +2 -6
- package/map/store/store.js +1 -67
- package/map/types/state.d.ts +3 -7
- package/map/types/tooltip.d.ts +11 -1
- package/map/utils/build-geo-tooltip-state.d.ts +17 -0
- package/map/{components/DefaultTooltip/utils/handle-copy-to-clipboard.js → utils/build-geo-tooltip-state.js} +27 -11
- package/map/utils/tooltip-type-guards.d.ts +6 -4
- package/map/utils/tooltip-type-guards.js +2 -0
- package/package.json +4 -4
- package/esm/map/components/DefaultTooltip/utils/get-default-actions.js +0 -21
- package/esm/map/components/DefaultTooltip/utils/get-default-actions.js.map +0 -7
- package/esm/map/components/DefaultTooltip/utils/handle-copy-to-clipboard.js +0 -12
- package/esm/map/components/DefaultTooltip/utils/handle-copy-to-clipboard.js.map +0 -7
- package/map/components/DefaultTooltip/utils/get-default-actions.d.ts +0 -2
- package/map/components/DefaultTooltip/utils/get-default-actions.js +0 -40
- package/map/components/DefaultTooltip/utils/handle-copy-to-clipboard.d.ts +0 -2
|
@@ -22,17 +22,18 @@ __export(use_tooltip_event_listeners_exports, {
|
|
|
22
22
|
});
|
|
23
23
|
module.exports = __toCommonJS(use_tooltip_event_listeners_exports);
|
|
24
24
|
var import_react = require("react");
|
|
25
|
-
var
|
|
25
|
+
var import_charts = require("@dynatrace/strato-components/charts");
|
|
26
|
+
var import_use_geo_tooltip_sync = require("./use-geo-tooltip-sync.js");
|
|
26
27
|
const useTooltipEventListeners = () => {
|
|
27
|
-
const
|
|
28
|
-
const pinned = (0,
|
|
28
|
+
const dispatch = (0, import_charts._useOverlayTooltipReducer)();
|
|
29
|
+
const pinned = (0, import_use_geo_tooltip_sync.useOverlayTooltipSelector)((state) => state.pinned);
|
|
29
30
|
const onEscapeKeyPressedHandler = (0, import_react.useCallback)(
|
|
30
31
|
(event) => {
|
|
31
32
|
if (pinned && event.key === "Escape") {
|
|
32
|
-
|
|
33
|
+
dispatch({ type: "RESET_TOOLTIP" })();
|
|
33
34
|
}
|
|
34
35
|
},
|
|
35
|
-
[pinned]
|
|
36
|
+
[pinned, dispatch]
|
|
36
37
|
);
|
|
37
38
|
(0, import_react.useEffect)(() => {
|
|
38
39
|
window.addEventListener("keyup", onEscapeKeyPressedHandler);
|
|
@@ -1,9 +1,14 @@
|
|
|
1
1
|
import { type ReactNode, type JSXElementConstructor } from 'react';
|
|
2
2
|
import type { LayerTooltipHandler } from '../types/tooltip.js';
|
|
3
|
+
export declare const defaultTooltipHandler: LayerTooltipHandler;
|
|
4
|
+
export declare const isDefaultTooltipHandler: (handler: LayerTooltipHandler) => boolean;
|
|
3
5
|
/**
|
|
4
6
|
* It returns the tooltip template handler or undefined (tooltip disabled).
|
|
5
7
|
*
|
|
6
|
-
*
|
|
8
|
+
* - No tooltip slot found (undefined) → default tooltip handler.
|
|
9
|
+
* - Tooltip slot with `null` children → `null` (tooltip disabled).
|
|
10
|
+
* - Tooltip slot with `undefined` children → default tooltip handler.
|
|
11
|
+
* - Tooltip slot with a custom handler → that handler.
|
|
7
12
|
* @param children -
|
|
8
13
|
* @param layerType -
|
|
9
14
|
*/
|
|
@@ -18,6 +18,8 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
19
|
var use_tooltip_template_exports = {};
|
|
20
20
|
__export(use_tooltip_template_exports, {
|
|
21
|
+
defaultTooltipHandler: () => defaultTooltipHandler,
|
|
22
|
+
isDefaultTooltipHandler: () => isDefaultTooltipHandler,
|
|
21
23
|
useTooltipTemplate: () => useTooltipTemplate
|
|
22
24
|
});
|
|
23
25
|
module.exports = __toCommonJS(use_tooltip_template_exports);
|
|
@@ -25,12 +27,30 @@ var import_jsx_runtime = require("react/jsx-runtime");
|
|
|
25
27
|
var import_lodash_es = require("lodash");
|
|
26
28
|
var import_react = require("react");
|
|
27
29
|
var import_DefaultTooltip = require("../components/DefaultTooltip/DefaultTooltip.js");
|
|
30
|
+
const defaultTooltipHandler = (closestPoint, layerData) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_DefaultTooltip.DefaultTooltip, { closestPoint, layerData });
|
|
31
|
+
defaultTooltipHandler.__isDefault = true;
|
|
32
|
+
const createDefaultHandlerWithActions = (seriesActions) => {
|
|
33
|
+
const handler = (closestPoint, layerData) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
34
|
+
import_DefaultTooltip.DefaultTooltip,
|
|
35
|
+
{
|
|
36
|
+
closestPoint,
|
|
37
|
+
layerData,
|
|
38
|
+
seriesActions
|
|
39
|
+
}
|
|
40
|
+
);
|
|
41
|
+
handler.__isDefault = true;
|
|
42
|
+
return handler;
|
|
43
|
+
};
|
|
44
|
+
const isDefaultTooltipHandler = (handler) => handler.__isDefault ?? false;
|
|
28
45
|
function useTooltipTemplate(children, layerType) {
|
|
29
46
|
let template = void 0;
|
|
30
47
|
import_react.Children.forEach(children, (child) => {
|
|
31
48
|
if ((0, import_react.isValidElement)(child) && child.type === layerType) {
|
|
32
|
-
|
|
33
|
-
|
|
49
|
+
if ((0, import_lodash_es.isNil)(child.props.children)) {
|
|
50
|
+
template = child.props.seriesActions ? createDefaultHandlerWithActions(child.props.seriesActions) : defaultTooltipHandler;
|
|
51
|
+
} else {
|
|
52
|
+
template = child.props.children;
|
|
53
|
+
}
|
|
34
54
|
}
|
|
35
55
|
});
|
|
36
56
|
return template;
|
|
@@ -17,4 +17,4 @@ import { type PropsWithChildren } from 'react';
|
|
|
17
17
|
export declare const ColorScaleProvider: ({ categories, dataMax, children, }: PropsWithChildren<{
|
|
18
18
|
categories: string[];
|
|
19
19
|
dataMax: number;
|
|
20
|
-
}>) => import("react/jsx-runtime
|
|
20
|
+
}>) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -13,4 +13,4 @@ export declare function buildClampedScale(legend: MapLegendConfig, scale: ScaleQ
|
|
|
13
13
|
*
|
|
14
14
|
* @param children -
|
|
15
15
|
*/
|
|
16
|
-
export declare const LayerColorStrategyProvider: ({ children }: PropsWithChildren) => import("react/jsx-runtime
|
|
16
|
+
export declare const LayerColorStrategyProvider: ({ children }: PropsWithChildren) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -10,4 +10,4 @@ import type { ViewState } from '../types/map-view.js';
|
|
|
10
10
|
* Notice how this Provider is design to not trigger any re-renders and just
|
|
11
11
|
* hold the initial state view.
|
|
12
12
|
*/
|
|
13
|
-
export declare const MapInitialViewProvider: ({ children, }: PropsWithChildren<ViewState>) => import("react/jsx-runtime
|
|
13
|
+
export declare const MapInitialViewProvider: ({ children, }: PropsWithChildren<ViewState>) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -10,7 +10,7 @@ import type { Location } from '../types/location.js';
|
|
|
10
10
|
export declare const BubbleLayer: {
|
|
11
11
|
<T extends Location>(_: PropsWithChildren<BubbleLayerProps<T>>): null;
|
|
12
12
|
Tooltip: {
|
|
13
|
-
({ children, }: import("../index.js").BubbleLayerTooltipHandlerProps): import("react/jsx-runtime
|
|
13
|
+
({ children, }: import("../index.js").BubbleLayerTooltipHandlerProps): import("react/jsx-runtime").JSX.Element;
|
|
14
14
|
displayName: string;
|
|
15
15
|
};
|
|
16
16
|
displayName: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { BubbleLayerTooltipHandlerProps } from '../types/tooltip.js';
|
|
2
2
|
export declare const BubbleLayerTooltip: {
|
|
3
|
-
({ children, }: BubbleLayerTooltipHandlerProps): import("react/jsx-runtime
|
|
3
|
+
({ children, }: BubbleLayerTooltipHandlerProps): import("react/jsx-runtime").JSX.Element;
|
|
4
4
|
displayName: string;
|
|
5
5
|
};
|
package/map/slots/DotLayer.d.ts
CHANGED
|
@@ -12,7 +12,7 @@ import type { Location } from '../types/location.js';
|
|
|
12
12
|
export declare const DotLayer: {
|
|
13
13
|
<T extends Location>(_: PropsWithChildren<DotLayerProps<T>>): null;
|
|
14
14
|
Tooltip: {
|
|
15
|
-
({ children }: import("../index.js").DotLayerTooltipHandlerProps): import("react/jsx-runtime
|
|
15
|
+
({ children }: import("../index.js").DotLayerTooltipHandlerProps): import("react/jsx-runtime").JSX.Element;
|
|
16
16
|
displayName: string;
|
|
17
17
|
};
|
|
18
18
|
displayName: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { DotLayerTooltipHandlerProps } from '../types/tooltip.js';
|
|
2
2
|
export declare const DotLayerTooltip: {
|
|
3
|
-
({ children }: DotLayerTooltipHandlerProps): import("react/jsx-runtime
|
|
3
|
+
({ children }: DotLayerTooltipHandlerProps): import("react/jsx-runtime").JSX.Element;
|
|
4
4
|
displayName: string;
|
|
5
5
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { type Store } from '@dynatrace/strato-components/core';
|
|
2
2
|
import type { MapState } from '../types/state.js';
|
|
3
3
|
export declare const initialState: MapState;
|
|
4
|
-
export declare const MapStore: import("react").Context<Store<MapState
|
|
4
|
+
export declare const MapStore: import("react").Context<Store<MapState>>;
|
|
@@ -27,13 +27,9 @@ var import_core = require("@dynatrace/strato-components/core");
|
|
|
27
27
|
const initialSelection = { highlightedSeries: void 0, visible: void 0 };
|
|
28
28
|
const initialState = {
|
|
29
29
|
tooltip: {
|
|
30
|
-
pinned: false,
|
|
31
|
-
visible: false,
|
|
32
30
|
enabled: true,
|
|
33
|
-
pinnedId: void 0,
|
|
34
|
-
location: void 0,
|
|
35
31
|
hoveredLayerId: void 0,
|
|
36
|
-
|
|
32
|
+
location: void 0
|
|
37
33
|
},
|
|
38
34
|
overlay: {
|
|
39
35
|
mouseInBounds: false
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { type PropsWithChildren } from 'react';
|
|
2
|
-
export declare const MapStoreProvider: ({ children }: PropsWithChildren) => import("react/jsx-runtime
|
|
2
|
+
export declare const MapStoreProvider: ({ children }: PropsWithChildren) => import("react/jsx-runtime").JSX.Element;
|
package/map/store/selectors.d.ts
CHANGED
|
@@ -1,16 +1,7 @@
|
|
|
1
1
|
import type { MapState } from '../types/state.js';
|
|
2
|
-
export declare const useSelector: <
|
|
3
|
-
export declare const useMapSelectionState:
|
|
4
|
-
export declare const
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
data: T[] | undefined;
|
|
9
|
-
pinnedId: string | undefined;
|
|
10
|
-
location: import("maplibre-gl").LngLat | undefined;
|
|
11
|
-
};
|
|
12
|
-
export declare const useMapTooltipLocationState: <T>() => import("maplibre-gl").LngLat | undefined;
|
|
13
|
-
export declare const useMapTooltipHoveredLayerIdState: <T>() => string | undefined;
|
|
14
|
-
export declare const useMapTooltipPinnedState: <T>() => boolean;
|
|
15
|
-
export declare const useMapOverlayState: <T>() => import("../types/state.js").MapOverlayState;
|
|
16
|
-
export declare const useMapZoomState: <T>() => import("../types/state.js").ZoomState;
|
|
2
|
+
export declare const useSelector: <O>(selector: (state: MapState) => O) => O;
|
|
3
|
+
export declare const useMapSelectionState: () => import("../types/state.js").MapSelectionState;
|
|
4
|
+
export declare const useMapTooltipLocationState: () => import("maplibre-gl").LngLat | undefined;
|
|
5
|
+
export declare const useMapTooltipHoveredLayerIdState: () => string | undefined;
|
|
6
|
+
export declare const useMapOverlayState: () => import("../types/state.js").MapOverlayState;
|
|
7
|
+
export declare const useMapZoomState: () => import("../types/state.js").ZoomState;
|
package/map/store/selectors.js
CHANGED
|
@@ -22,8 +22,6 @@ __export(selectors_exports, {
|
|
|
22
22
|
useMapSelectionState: () => useMapSelectionState,
|
|
23
23
|
useMapTooltipHoveredLayerIdState: () => useMapTooltipHoveredLayerIdState,
|
|
24
24
|
useMapTooltipLocationState: () => useMapTooltipLocationState,
|
|
25
|
-
useMapTooltipPinnedState: () => useMapTooltipPinnedState,
|
|
26
|
-
useMapTooltipState: () => useMapTooltipState,
|
|
27
25
|
useMapZoomState: () => useMapZoomState,
|
|
28
26
|
useSelector: () => useSelector
|
|
29
27
|
});
|
|
@@ -33,15 +31,7 @@ var import_core = require("@dynatrace/strato-components/core");
|
|
|
33
31
|
var import_map_store_context = require("./map-store.context.js");
|
|
34
32
|
const useSelector = (selector) => (0, import_core.useStoreSelector)(import_map_store_context.MapStore, selector, import_lodash_es.isEqual);
|
|
35
33
|
const useMapSelectionState = () => useSelector(({ selection }) => selection);
|
|
36
|
-
const useMapTooltipState = () => useSelector(({ tooltip }) => {
|
|
37
|
-
const { pinned, ...tooltipState } = tooltip;
|
|
38
|
-
return tooltipState;
|
|
39
|
-
});
|
|
40
34
|
const useMapTooltipLocationState = () => useSelector(({ tooltip }) => tooltip.location);
|
|
41
35
|
const useMapTooltipHoveredLayerIdState = () => useSelector(({ tooltip }) => tooltip.hoveredLayerId);
|
|
42
|
-
const useMapTooltipPinnedState = () => useSelector(({ tooltip }) => {
|
|
43
|
-
const { pinned } = tooltip;
|
|
44
|
-
return pinned;
|
|
45
|
-
});
|
|
46
36
|
const useMapOverlayState = () => useSelector(({ overlay }) => overlay);
|
|
47
37
|
const useMapZoomState = () => useSelector(({ zoom }) => zoom);
|
package/map/store/store.d.ts
CHANGED
|
@@ -1,10 +1,6 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
|
|
3
|
-
export declare const useSetState: () => (action: MapState<unknown> | ((prev: MapState<unknown>) => MapState<unknown>)) => void;
|
|
1
|
+
import type { MapOverlayState, MapSelectionState, ZoomState } from '../types/state.js';
|
|
2
|
+
export declare const useSetState: () => (action: import("../types/state.js").MapState | ((prev: import("../types/state.js").MapState) => import("../types/state.js").MapState)) => void;
|
|
4
3
|
export * from './selectors.js';
|
|
5
4
|
export declare const useSetStateSelection: () => (newSelectionState: Partial<MapSelectionState>) => void;
|
|
6
|
-
export declare const useSetStateTooltip: <T>() => (newTooltipState: Partial<MapTooltipState<T>>) => void;
|
|
7
|
-
export declare const useClearTooltip: () => () => void;
|
|
8
|
-
export declare const useTooltipPinnedState: () => (event: MapLayerMouseEvent) => void;
|
|
9
5
|
export declare const useSetStateOverlay: () => (newOverlayState: Partial<MapOverlayState>) => void;
|
|
10
6
|
export declare const useSetStateZoom: () => (newZoomState: Partial<ZoomState>) => void;
|
package/map/store/store.js
CHANGED
|
@@ -19,18 +19,14 @@ var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "defau
|
|
|
19
19
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
20
20
|
var store_exports = {};
|
|
21
21
|
__export(store_exports, {
|
|
22
|
-
useClearTooltip: () => useClearTooltip,
|
|
23
22
|
useSetState: () => useSetState,
|
|
24
23
|
useSetStateOverlay: () => useSetStateOverlay,
|
|
25
24
|
useSetStateSelection: () => useSetStateSelection,
|
|
26
|
-
|
|
27
|
-
useSetStateZoom: () => useSetStateZoom,
|
|
28
|
-
useTooltipPinnedState: () => useTooltipPinnedState
|
|
25
|
+
useSetStateZoom: () => useSetStateZoom
|
|
29
26
|
});
|
|
30
27
|
module.exports = __toCommonJS(store_exports);
|
|
31
28
|
var import_react = require("react");
|
|
32
29
|
var import_map_store_context = require("./map-store.context.js");
|
|
33
|
-
var import_parse_tooltip_data = require("../utils/parse-tooltip-data.js");
|
|
34
30
|
__reExport(store_exports, require("./selectors.js"), module.exports);
|
|
35
31
|
const useSetState = () => {
|
|
36
32
|
const { setState } = (0, import_react.useContext)(import_map_store_context.MapStore);
|
|
@@ -48,68 +44,6 @@ const useSetStateSelection = () => {
|
|
|
48
44
|
}));
|
|
49
45
|
};
|
|
50
46
|
};
|
|
51
|
-
const useSetStateTooltip = () => {
|
|
52
|
-
const setState = useSetState();
|
|
53
|
-
return (newTooltipState) => {
|
|
54
|
-
setState((prev) => {
|
|
55
|
-
const { location, data, hoveredLayerId, ...tooltipState } = newTooltipState;
|
|
56
|
-
return {
|
|
57
|
-
...prev,
|
|
58
|
-
tooltip: {
|
|
59
|
-
...prev.tooltip,
|
|
60
|
-
...tooltipState,
|
|
61
|
-
hoveredLayerId: prev.tooltip.pinned ? prev.tooltip.hoveredLayerId : hoveredLayerId,
|
|
62
|
-
data: prev.tooltip.pinned ? prev.tooltip.data : data,
|
|
63
|
-
location: prev.tooltip.pinned ? prev.tooltip.location : location
|
|
64
|
-
}
|
|
65
|
-
};
|
|
66
|
-
});
|
|
67
|
-
};
|
|
68
|
-
};
|
|
69
|
-
const clearTooltip = (prev) => {
|
|
70
|
-
return {
|
|
71
|
-
...prev,
|
|
72
|
-
tooltip: {
|
|
73
|
-
...prev.tooltip,
|
|
74
|
-
pinned: false,
|
|
75
|
-
data: void 0,
|
|
76
|
-
pinnedId: void 0,
|
|
77
|
-
hoveredLayerId: void 0,
|
|
78
|
-
visible: false,
|
|
79
|
-
location: void 0
|
|
80
|
-
}
|
|
81
|
-
};
|
|
82
|
-
};
|
|
83
|
-
const useClearTooltip = () => {
|
|
84
|
-
const setState = useSetState();
|
|
85
|
-
return () => {
|
|
86
|
-
setState(clearTooltip);
|
|
87
|
-
};
|
|
88
|
-
};
|
|
89
|
-
const useTooltipPinnedState = () => {
|
|
90
|
-
const setState = useSetState();
|
|
91
|
-
return (event) => {
|
|
92
|
-
setState((prev) => {
|
|
93
|
-
const { data, featureId, hoveredLayerId } = (0, import_parse_tooltip_data.extractDataFromEvent)(event);
|
|
94
|
-
if (!featureId) {
|
|
95
|
-
return clearTooltip(prev);
|
|
96
|
-
}
|
|
97
|
-
const isPinned = prev.tooltip.pinnedId !== featureId;
|
|
98
|
-
return {
|
|
99
|
-
...prev,
|
|
100
|
-
tooltip: {
|
|
101
|
-
...prev.tooltip,
|
|
102
|
-
data,
|
|
103
|
-
hoveredLayerId,
|
|
104
|
-
visible: true,
|
|
105
|
-
location: event.lngLat,
|
|
106
|
-
pinned: isPinned,
|
|
107
|
-
pinnedId: isPinned ? featureId : void 0
|
|
108
|
-
}
|
|
109
|
-
};
|
|
110
|
-
});
|
|
111
|
-
};
|
|
112
|
-
};
|
|
113
47
|
const useSetStateOverlay = () => {
|
|
114
48
|
const setState = useSetState();
|
|
115
49
|
return (newOverlayState) => {
|
package/map/types/state.d.ts
CHANGED
|
@@ -4,13 +4,9 @@ export interface MapSelectionState {
|
|
|
4
4
|
highlightedSeries: LegendItem | undefined;
|
|
5
5
|
visible: LegendItem[] | undefined;
|
|
6
6
|
}
|
|
7
|
-
export interface MapTooltipState
|
|
8
|
-
pinned: boolean;
|
|
9
|
-
visible: boolean;
|
|
7
|
+
export interface MapTooltipState {
|
|
10
8
|
enabled: boolean;
|
|
11
9
|
hoveredLayerId: string | undefined;
|
|
12
|
-
data: T[] | undefined;
|
|
13
|
-
pinnedId: string | undefined;
|
|
14
10
|
location: LngLat | undefined;
|
|
15
11
|
}
|
|
16
12
|
export interface MapOverlayState {
|
|
@@ -23,9 +19,9 @@ export interface ZoomState {
|
|
|
23
19
|
resetEnabled: boolean;
|
|
24
20
|
zoomToFitInProgress?: boolean;
|
|
25
21
|
}
|
|
26
|
-
export interface MapState
|
|
22
|
+
export interface MapState {
|
|
27
23
|
selection: MapSelectionState;
|
|
28
|
-
tooltip: MapTooltipState
|
|
24
|
+
tooltip: MapTooltipState;
|
|
29
25
|
overlay: MapOverlayState;
|
|
30
26
|
zoom: ZoomState;
|
|
31
27
|
}
|
package/map/types/tooltip.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
|
-
import type { _ChartTooltipSlotsType as ChartTooltipSlotsType, _ChartTooltipTemplateType as ChartTooltipTemplateType } from '@dynatrace/strato-components/charts';
|
|
2
|
+
import type { _ChartTooltipSlotsType as ChartTooltipSlotsType, _ChartTooltipTemplateType as ChartTooltipTemplateType, SeriesActionsTemplate } from '@dynatrace/strato-components/charts';
|
|
3
3
|
import type { Connection } from './connection-layer.js';
|
|
4
4
|
import type { Location } from './location.js';
|
|
5
5
|
/**
|
|
@@ -36,6 +36,8 @@ export type DotLayerTooltipHandler = (dotData: DotLayerTooltipData) => ReactNode
|
|
|
36
36
|
export interface DotLayerTooltipHandlerProps {
|
|
37
37
|
/** The DotLayer tooltip handler template */
|
|
38
38
|
children?: DotLayerTooltipHandler | null;
|
|
39
|
+
/** Series actions callback for the default tooltip */
|
|
40
|
+
seriesActions?: (data: Location) => SeriesActionsTemplate;
|
|
39
41
|
}
|
|
40
42
|
/**
|
|
41
43
|
* Bubble Tooltip data payload for the tooltip handler callback
|
|
@@ -63,6 +65,8 @@ export type BubbleLayerTooltipHandler = (closestDot: BubbleLayerTooltipData, dot
|
|
|
63
65
|
export interface BubbleLayerTooltipHandlerProps {
|
|
64
66
|
/** The BubbleLayer tooltip handler template */
|
|
65
67
|
children?: BubbleLayerTooltipHandler | null;
|
|
68
|
+
/** Series actions callback for the default tooltip */
|
|
69
|
+
seriesActions?: (location: Location) => SeriesActionsTemplate;
|
|
66
70
|
}
|
|
67
71
|
/**
|
|
68
72
|
* Connection Tooltip data payload for the tooltip handler callback
|
|
@@ -89,6 +93,8 @@ export type ConnectionLayerTooltipHandler = (connectionData: ConnectionLayerTool
|
|
|
89
93
|
export interface ConnectionLayerTooltipHandlerProps {
|
|
90
94
|
/** The ConnectionLayer tooltip handler template */
|
|
91
95
|
children?: ConnectionLayerTooltipHandler | null;
|
|
96
|
+
/** Series actions callback for the default tooltip */
|
|
97
|
+
seriesActions?: (data: Location) => SeriesActionsTemplate;
|
|
92
98
|
}
|
|
93
99
|
/**
|
|
94
100
|
* Choropleth Tooltip data payload for the tooltip handler callback
|
|
@@ -102,6 +108,8 @@ export interface ChoroplethLayerTooltipData<T extends Record<string, unknown> =
|
|
|
102
108
|
name: string;
|
|
103
109
|
/** The hovered region custom data */
|
|
104
110
|
data: T;
|
|
111
|
+
/** Series actions callback for the default tooltip */
|
|
112
|
+
seriesActions?: (data: ChoroplethLayerTooltipData<T>) => SeriesActionsTemplate;
|
|
105
113
|
}
|
|
106
114
|
/**
|
|
107
115
|
* Choropleth tooltip handler type
|
|
@@ -115,6 +123,8 @@ export type ChoroplethLayerTooltipHandler = (regionData: ChoroplethLayerTooltipD
|
|
|
115
123
|
export interface ChoroplethLayerTooltipHandlerProps {
|
|
116
124
|
/** The ChoroplethLayer tooltip handler template */
|
|
117
125
|
children?: ChoroplethLayerTooltipHandler | null;
|
|
126
|
+
/** Series actions callback for the default tooltip */
|
|
127
|
+
seriesActions?: (data: ChoroplethLayerTooltipData) => SeriesActionsTemplate;
|
|
118
128
|
}
|
|
119
129
|
/**
|
|
120
130
|
* Map Geo Tooltip Props
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { _OverlayTooltipGeometryTypes as GeometryTypes, _OverlayTooltipState as TooltipState } from '@dynatrace/strato-components/charts';
|
|
2
|
+
/**
|
|
3
|
+
* Builds the full TooltipState object for the geo map context.
|
|
4
|
+
*
|
|
5
|
+
* Centralises the state shape so that both the event-side
|
|
6
|
+
* (`useOverlayEvents`) and the sync-side (`useGeoTooltipSync`)
|
|
7
|
+
* produce the exact same structure.
|
|
8
|
+
*/
|
|
9
|
+
export declare const buildGeoTooltipState: ({ absoluteX, absoluteY, relativeX, relativeY, pinned, geometry, metadata, }: {
|
|
10
|
+
absoluteX: number;
|
|
11
|
+
absoluteY: number;
|
|
12
|
+
relativeX: number;
|
|
13
|
+
relativeY: number;
|
|
14
|
+
pinned: boolean;
|
|
15
|
+
geometry: GeometryTypes;
|
|
16
|
+
metadata: unknown[] | undefined;
|
|
17
|
+
}) => TooltipState;
|
|
@@ -16,16 +16,32 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
16
16
|
return to;
|
|
17
17
|
};
|
|
18
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
var
|
|
20
|
-
__export(
|
|
21
|
-
|
|
19
|
+
var build_geo_tooltip_state_exports = {};
|
|
20
|
+
__export(build_geo_tooltip_state_exports, {
|
|
21
|
+
buildGeoTooltipState: () => buildGeoTooltipState
|
|
22
22
|
});
|
|
23
|
-
module.exports = __toCommonJS(
|
|
24
|
-
const
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
23
|
+
module.exports = __toCommonJS(build_geo_tooltip_state_exports);
|
|
24
|
+
const buildGeoTooltipState = ({
|
|
25
|
+
absoluteX,
|
|
26
|
+
absoluteY,
|
|
27
|
+
relativeX,
|
|
28
|
+
relativeY,
|
|
29
|
+
pinned,
|
|
30
|
+
geometry,
|
|
31
|
+
metadata
|
|
32
|
+
}) => ({
|
|
33
|
+
absoluteX,
|
|
34
|
+
absoluteY,
|
|
35
|
+
relativeX,
|
|
36
|
+
relativeY,
|
|
37
|
+
percentX: 0,
|
|
38
|
+
percentY: 0,
|
|
39
|
+
inBounds: true,
|
|
40
|
+
pinned,
|
|
41
|
+
activeSeries: null,
|
|
42
|
+
data: {
|
|
43
|
+
geometry,
|
|
44
|
+
series: [],
|
|
45
|
+
metadata
|
|
30
46
|
}
|
|
31
|
-
};
|
|
47
|
+
});
|
|
@@ -1,15 +1,17 @@
|
|
|
1
|
+
import { isDefaultTooltipHandler } from '../hooks/use-tooltip-template.js';
|
|
1
2
|
import type { BubbleLayerTooltipHandler, ChoroplethLayerTooltipData, ChoroplethLayerTooltipHandler, ConnectionLayerTooltipData, ConnectionLayerTooltipHandler, DotLayerTooltipHandler, LayerTooltipData, LayerTooltipHandler } from '../types/tooltip.js';
|
|
2
3
|
/**
|
|
3
4
|
* Type guards for tooltip template
|
|
4
5
|
* @param template -
|
|
5
6
|
*/
|
|
6
|
-
export declare const isDotTooltipTemplate: (template?: LayerTooltipHandler) => template is DotLayerTooltipHandler;
|
|
7
|
-
export declare const isBubbleTooltipTemplate: (template?: LayerTooltipHandler) => template is BubbleLayerTooltipHandler;
|
|
8
|
-
export declare const isConnectionTooltipTemplate: (template?: LayerTooltipHandler) => template is ConnectionLayerTooltipHandler;
|
|
9
|
-
export declare const isChoroplethTooltipTemplate: (template?: LayerTooltipHandler) => template is ChoroplethLayerTooltipHandler;
|
|
7
|
+
export declare const isDotTooltipTemplate: (template?: LayerTooltipHandler | null) => template is DotLayerTooltipHandler;
|
|
8
|
+
export declare const isBubbleTooltipTemplate: (template?: LayerTooltipHandler | null) => template is BubbleLayerTooltipHandler;
|
|
9
|
+
export declare const isConnectionTooltipTemplate: (template?: LayerTooltipHandler | null) => template is ConnectionLayerTooltipHandler;
|
|
10
|
+
export declare const isChoroplethTooltipTemplate: (template?: LayerTooltipHandler | null) => template is ChoroplethLayerTooltipHandler;
|
|
10
11
|
/**
|
|
11
12
|
* Type guards for map types in tooltip context
|
|
12
13
|
* @param data -
|
|
13
14
|
*/
|
|
14
15
|
export declare const isConnection: (data: LayerTooltipData) => data is ConnectionLayerTooltipData;
|
|
15
16
|
export declare const isRegion: (data: LayerTooltipData) => data is ChoroplethLayerTooltipData;
|
|
17
|
+
export { isDefaultTooltipHandler };
|
|
@@ -22,10 +22,12 @@ __export(tooltip_type_guards_exports, {
|
|
|
22
22
|
isChoroplethTooltipTemplate: () => isChoroplethTooltipTemplate,
|
|
23
23
|
isConnection: () => isConnection,
|
|
24
24
|
isConnectionTooltipTemplate: () => isConnectionTooltipTemplate,
|
|
25
|
+
isDefaultTooltipHandler: () => import_use_tooltip_template.isDefaultTooltipHandler,
|
|
25
26
|
isDotTooltipTemplate: () => isDotTooltipTemplate,
|
|
26
27
|
isRegion: () => isRegion
|
|
27
28
|
});
|
|
28
29
|
module.exports = __toCommonJS(tooltip_type_guards_exports);
|
|
30
|
+
var import_use_tooltip_template = require("../hooks/use-tooltip-template.js");
|
|
29
31
|
var import_BubbleLayerTooltip = require("../slots/BubbleLayerTooltip.js");
|
|
30
32
|
var import_ChoroplethLayerTooltip = require("../slots/ChoroplethLayerTooltip.js");
|
|
31
33
|
var import_ConnectionLayerTooltip = require("../slots/ConnectionLayerTooltip.js");
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dynatrace/strato-geo",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.3.1",
|
|
4
4
|
"private": false,
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"keywords": [
|
|
@@ -48,15 +48,15 @@
|
|
|
48
48
|
"d3-array": "^3.2.4",
|
|
49
49
|
"d3-interpolate": "^3.0.1",
|
|
50
50
|
"d3-scale": "^4.0.2",
|
|
51
|
-
"maplibre-gl": "~5.
|
|
51
|
+
"maplibre-gl": "~5.22.0"
|
|
52
52
|
},
|
|
53
53
|
"peerDependencies": {
|
|
54
54
|
"@dynatrace-sdk/client-classic-environment-v2": "^5.1.0",
|
|
55
55
|
"@dynatrace-sdk/client-platform-management-service": "^1.7.0",
|
|
56
56
|
"@dynatrace-sdk/units": "^1.5.0",
|
|
57
|
-
"@dynatrace/strato-components": "^3.
|
|
57
|
+
"@dynatrace/strato-components": "^3.3.1",
|
|
58
58
|
"@dynatrace/strato-design-tokens": "^1.3.1",
|
|
59
|
-
"@dynatrace/strato-icons": "^2.
|
|
59
|
+
"@dynatrace/strato-icons": "^2.2.0",
|
|
60
60
|
"react": "^18.0.0",
|
|
61
61
|
"react-dom": "^18.0.0",
|
|
62
62
|
"react-intl": "^6.0.8 || ^7.0.0",
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { FormattedMessage } from "react-intl";
|
|
3
|
-
import { ChartSeriesAction } from "@dynatrace/strato-components/charts";
|
|
4
|
-
import { CopyIcon } from "@dynatrace/strato-icons";
|
|
5
|
-
import { handleCopyToClipboard } from "./handle-copy-to-clipboard.js";
|
|
6
|
-
import { COPY_TO_CLIPBOARD_MESSAGES } from "../../../constants.js";
|
|
7
|
-
const getDefaultActions = (location) => /* @__PURE__ */ jsxs(
|
|
8
|
-
ChartSeriesAction.Item,
|
|
9
|
-
{
|
|
10
|
-
onSelect: () => handleCopyToClipboard(location),
|
|
11
|
-
children: [
|
|
12
|
-
/* @__PURE__ */ jsx(ChartSeriesAction.ItemIcon, { children: /* @__PURE__ */ jsx(CopyIcon, {}) }),
|
|
13
|
-
/* @__PURE__ */ jsx(FormattedMessage, { ...COPY_TO_CLIPBOARD_MESSAGES.copyActionCoords })
|
|
14
|
-
]
|
|
15
|
-
},
|
|
16
|
-
"default-action"
|
|
17
|
-
);
|
|
18
|
-
export {
|
|
19
|
-
getDefaultActions
|
|
20
|
-
};
|
|
21
|
-
//# sourceMappingURL=get-default-actions.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../../../../src/map/components/DefaultTooltip/utils/get-default-actions.tsx"],
|
|
4
|
-
"sourcesContent": ["import { FormattedMessage } from 'react-intl';\n\nimport { ChartSeriesAction } from '@dynatrace/strato-components/charts';\nimport { CopyIcon } from '@dynatrace/strato-icons';\n\nimport { handleCopyToClipboard } from './handle-copy-to-clipboard.js';\nimport { COPY_TO_CLIPBOARD_MESSAGES } from '../../../constants.js';\nimport type { Location } from '../../../types/location.js';\n\nexport const getDefaultActions = (location: Location) => (\n <ChartSeriesAction.Item\n key=\"default-action\"\n onSelect={() => handleCopyToClipboard(location)}\n >\n <ChartSeriesAction.ItemIcon>\n <CopyIcon />\n </ChartSeriesAction.ItemIcon>\n <FormattedMessage {...COPY_TO_CLIPBOARD_MESSAGES.copyActionCoords} />\n </ChartSeriesAction.Item>\n);\n"],
|
|
5
|
-
"mappings": "AAUE,SAKI,KALJ;AAVF,SAAS,wBAAwB;AAEjC,SAAS,yBAAyB;AAClC,SAAS,gBAAgB;AAEzB,SAAS,6BAA6B;AACtC,SAAS,kCAAkC;AAGpC,MAAM,oBAAoB,CAAC,aAChC;AAAA,EAAC,kBAAkB;AAAA,EAAlB;AAAA,IAEC,UAAU,MAAM,sBAAsB,QAAQ;AAAA,IAE9C;AAAA,0BAAC,kBAAkB,UAAlB,EACC,8BAAC,YAAS,GACZ;AAAA,MACA,oBAAC,oBAAkB,GAAG,2BAA2B,kBAAkB;AAAA;AAAA;AAAA,EAN/D;AAON;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
const handleCopyToClipboard = async (location) => {
|
|
2
|
-
try {
|
|
3
|
-
await navigator.clipboard.writeText(
|
|
4
|
-
`${location.latitude}, ${location.longitude}`
|
|
5
|
-
);
|
|
6
|
-
} catch {
|
|
7
|
-
}
|
|
8
|
-
};
|
|
9
|
-
export {
|
|
10
|
-
handleCopyToClipboard
|
|
11
|
-
};
|
|
12
|
-
//# sourceMappingURL=handle-copy-to-clipboard.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../../../../src/map/components/DefaultTooltip/utils/handle-copy-to-clipboard.ts"],
|
|
4
|
-
"sourcesContent": ["import type { Location } from '../../../types/location.js';\n\nexport const handleCopyToClipboard = async (location: Location) => {\n try {\n await navigator.clipboard.writeText(\n `${location.latitude}, ${location.longitude}`,\n );\n } catch {\n // For now, we silently ignore clipboard write errors.\n }\n};\n"],
|
|
5
|
-
"mappings": "AAEO,MAAM,wBAAwB,OAAO,aAAuB;AACjE,MAAI;AACF,UAAM,UAAU,UAAU;AAAA,MACxB,GAAG,SAAS,QAAQ,KAAK,SAAS,SAAS;AAAA,IAC7C;AAAA,EACF,QAAQ;AAAA,EAER;AACF;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
var get_default_actions_exports = {};
|
|
20
|
-
__export(get_default_actions_exports, {
|
|
21
|
-
getDefaultActions: () => getDefaultActions
|
|
22
|
-
});
|
|
23
|
-
module.exports = __toCommonJS(get_default_actions_exports);
|
|
24
|
-
var import_jsx_runtime = require("react/jsx-runtime");
|
|
25
|
-
var import_react_intl = require("react-intl");
|
|
26
|
-
var import_charts = require("@dynatrace/strato-components/charts");
|
|
27
|
-
var import_strato_icons = require("@dynatrace/strato-icons");
|
|
28
|
-
var import_handle_copy_to_clipboard = require("./handle-copy-to-clipboard.js");
|
|
29
|
-
var import_constants = require("../../../constants.js");
|
|
30
|
-
const getDefaultActions = (location) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
31
|
-
import_charts.ChartSeriesAction.Item,
|
|
32
|
-
{
|
|
33
|
-
onSelect: () => (0, import_handle_copy_to_clipboard.handleCopyToClipboard)(location),
|
|
34
|
-
children: [
|
|
35
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_charts.ChartSeriesAction.ItemIcon, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_strato_icons.CopyIcon, {}) }),
|
|
36
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_intl.FormattedMessage, { ...import_constants.COPY_TO_CLIPBOARD_MESSAGES.copyActionCoords })
|
|
37
|
-
]
|
|
38
|
-
},
|
|
39
|
-
"default-action"
|
|
40
|
-
);
|