@rio-cloud/rio-uikit 2.3.0-beta.2 → 2.3.0
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/Marker.js +9 -5
- package/Table.js +10 -9
- package/TableNext.js +10 -9
- package/TableRowActionsDropdown.d.ts +2 -0
- package/TableRowActionsDropdown.js +5 -0
- package/TableRowActionsDropdown.js.map +1 -0
- package/components/analyticsAnalysisOverlay/AnalyticsAnalysisBanner.d.ts +38 -3
- package/components/analyticsAnalysisOverlay/AnalyticsAnalysisBanner.js +104 -109
- package/components/analyticsAnalysisOverlay/AnalyticsAnalysisBanner.js.map +1 -1
- package/components/analyticsAnalysisOverlay/AnalyticsAnalysisOverlay.d.ts +24 -5
- package/components/analyticsAnalysisOverlay/AnalyticsAnalysisOverlay.js +60 -56
- package/components/analyticsAnalysisOverlay/AnalyticsAnalysisOverlay.js.map +1 -1
- package/components/datepicker/DayPicker.js +72 -70
- package/components/datepicker/DayPicker.js.map +1 -1
- package/components/datepicker/DayPickerDropdown.d.ts +1 -0
- package/components/datepicker/DayPickerDropdown.js +61 -48
- package/components/datepicker/DayPickerDropdown.js.map +1 -1
- package/components/datepicker/useStackedDayPickerCalendars.js +26 -26
- package/components/datepicker/useStackedDayPickerCalendars.js.map +1 -1
- package/components/dropdown/ButtonDropdown.d.ts +4 -0
- package/components/dropdown/ButtonDropdown.js +82 -80
- package/components/dropdown/ButtonDropdown.js.map +1 -1
- package/components/listMenu/ListMenu.d.ts +8 -0
- package/components/listMenu/ListMenu.js +74 -66
- package/components/listMenu/ListMenu.js.map +1 -1
- package/components/map/components/Map.js +207 -156
- package/components/map/components/Map.js.map +1 -1
- package/components/map/components/MapContext.d.ts +3 -0
- package/components/map/components/MapContext.js +9 -6
- package/components/map/components/MapContext.js.map +1 -1
- package/components/map/components/features/MapZoom.js +19 -19
- package/components/map/components/features/MapZoom.js.map +1 -1
- package/components/map/components/features/Route.d.ts +65 -1
- package/components/map/components/features/Route.js +184 -98
- package/components/map/components/features/Route.js.map +1 -1
- package/components/map/components/features/basics/Marker.d.ts +21 -1
- package/components/map/components/features/basics/Marker.js +99 -40
- package/components/map/components/features/basics/Marker.js.map +1 -1
- package/components/map/components/features/basics/Polygon.d.ts +24 -1
- package/components/map/components/features/basics/Polygon.js +72 -19
- package/components/map/components/features/basics/Polygon.js.map +1 -1
- package/components/map/components/features/basics/Polyline.d.ts +29 -0
- package/components/map/components/features/basics/Polyline.js +69 -39
- package/components/map/components/features/basics/Polyline.js.map +1 -1
- package/components/map/components/features/layers/MarkerLayer.js +8 -8
- package/components/map/components/features/layers/MarkerLayer.js.map +1 -1
- package/components/map/components/features/layers/clustering/SimpleClusterLayer.js +13 -6
- package/components/map/components/features/layers/clustering/SimpleClusterLayer.js.map +1 -1
- package/components/map/utils/clustering.d.ts +1 -1
- package/components/map/utils/clustering.js +30 -30
- package/components/map/utils/clustering.js.map +1 -1
- package/components/map/utils/mapTypes.d.ts +141 -0
- package/components/map/utils/mapTypes.js.map +1 -1
- package/components/map/utils/mapUtils.d.ts +2 -0
- package/components/map/utils/mapUtils.js +4 -0
- package/components/map/utils/mapUtils.js.map +1 -1
- package/components/mapMarker/ClusterMapMarker.d.ts +2 -0
- package/components/mapMarker/ClusterMapMarker.js.map +1 -1
- package/components/mapMarker/SingleMapMarker.d.ts +2 -0
- package/components/mapMarker/SingleMapMarker.js.map +1 -1
- package/components/selects/ClearButton.js +9 -7
- package/components/selects/ClearButton.js.map +1 -1
- package/components/table/Table.d.ts +3 -1
- package/components/table/Table.js +239 -216
- package/components/table/Table.js.map +1 -1
- package/components/table/Table.types.d.ts +62 -4
- package/components/table/TableColumn.d.ts +8 -1
- package/components/table/TableColumn.js +66 -64
- package/components/table/TableColumn.js.map +1 -1
- package/components/table/TableExpandedRow.d.ts +4 -0
- package/components/table/TableExpandedRow.js +70 -67
- package/components/table/TableExpandedRow.js.map +1 -1
- package/components/table/TableGroupRow.d.ts +3 -1
- package/components/table/TableGroupRow.js +15 -14
- package/components/table/TableGroupRow.js.map +1 -1
- package/components/table/TableHeader.d.ts +9 -0
- package/components/table/TableHeader.js +110 -81
- package/components/table/TableHeader.js.map +1 -1
- package/components/table/TableHeaderColumn.d.ts +11 -1
- package/components/table/TableHeaderColumn.js +63 -58
- package/components/table/TableHeaderColumn.js.map +1 -1
- package/components/table/TableRow.d.ts +12 -0
- package/components/table/TableRow.js +78 -74
- package/components/table/TableRow.js.map +1 -1
- package/components/table/TableRowActionsDropdown.d.ts +11 -0
- package/components/table/TableRowActionsDropdown.js +22 -0
- package/components/table/TableRowActionsDropdown.js.map +1 -0
- package/components/table/TableStickyRowButton.d.ts +25 -0
- package/components/table/TableStickyRowButton.js +32 -0
- package/components/table/TableStickyRowButton.js.map +1 -0
- package/components/table/TableToolbar.d.ts +24 -3
- package/components/table/TableToolbar.js +78 -37
- package/components/table/TableToolbar.js.map +1 -1
- package/components/table/TableViewToggles.js +5 -5
- package/components/table/TableViewToggles.js.map +1 -1
- package/components/table/context/TableInteractionContext.d.ts +3 -0
- package/components/table/context/TableInteractionContext.js.map +1 -1
- package/components/table/context/TableLayoutContext.d.ts +1 -0
- package/components/table/context/TableLayoutContext.js.map +1 -1
- package/components/table/context/TableRenderContext.d.ts +1 -0
- package/components/table/context/TableRenderContext.js.map +1 -1
- package/components/table/layout/useHorizontalSectionSync.d.ts +2 -1
- package/components/table/layout/useHorizontalSectionSync.js +32 -31
- package/components/table/layout/useHorizontalSectionSync.js.map +1 -1
- package/components/table/layout/useMeasuredColumnMaxWidths.js +52 -54
- package/components/table/layout/useMeasuredColumnMaxWidths.js.map +1 -1
- package/components/table/layout/useTableLayout.d.ts +6 -2
- package/components/table/layout/useTableLayout.js +61 -48
- package/components/table/layout/useTableLayout.js.map +1 -1
- package/components/table/layout/useTableVirtualization.js +51 -56
- package/components/table/layout/useTableVirtualization.js.map +1 -1
- package/components/table/model/resolveResponsiveViewType.d.ts +2 -0
- package/components/table/model/resolveResponsiveViewType.js +27 -0
- package/components/table/model/resolveResponsiveViewType.js.map +1 -0
- package/components/table/render/header/TableDraggableHeaderCell.js +38 -36
- package/components/table/render/header/TableDraggableHeaderCell.js.map +1 -1
- package/components/table/render/header/TableHeader.types.d.ts +2 -0
- package/components/table/render/header/TableHeaderCellContent.js +16 -16
- package/components/table/render/header/TableHeaderCellContent.js.map +1 -1
- package/components/table/render/header/TableHeaderSelectionCell.d.ts +1 -0
- package/components/table/render/header/TableHeaderSelectionCell.js +13 -12
- package/components/table/render/header/TableHeaderSelectionCell.js.map +1 -1
- package/components/table/render/header/TableStaticHeaderCell.js +31 -29
- package/components/table/render/header/TableStaticHeaderCell.js.map +1 -1
- package/components/table/render/header/resolveHeaderCellClassName.d.ts +1 -0
- package/components/table/render/header/resolveHeaderCellClassName.js +10 -9
- package/components/table/render/header/resolveHeaderCellClassName.js.map +1 -1
- package/components/table/runtime/useResolvedRenderColumns.d.ts +4 -4
- package/components/table/runtime/useResolvedRenderColumns.js +13 -13
- package/components/table/runtime/useResolvedRenderColumns.js.map +1 -1
- package/components/table/runtime/useResolvedRenderHeader.d.ts +1 -1
- package/components/table/runtime/useResolvedRenderHeader.js.map +1 -1
- package/components/table/runtime/useResponsiveResolvedViewType.d.ts +23 -0
- package/components/table/runtime/useResponsiveResolvedViewType.js +22 -0
- package/components/table/runtime/useResponsiveResolvedViewType.js.map +1 -0
- package/components/table/selection/useInternalTableSelectionState.d.ts +2 -0
- package/components/table/selection/useInternalTableSelectionState.js +27 -17
- package/components/table/selection/useInternalTableSelectionState.js.map +1 -1
- package/components/table/selection/useTableSelection.d.ts +5 -1
- package/components/table/selection/useTableSelection.js +37 -26
- package/components/table/selection/useTableSelection.js.map +1 -1
- package/components/table/shared/parsePixelSize.d.ts +2 -0
- package/components/table/shared/parsePixelSize.js +13 -0
- package/components/table/shared/parsePixelSize.js.map +1 -0
- package/hooks/useDraggableElement.d.ts +27 -5
- package/hooks/useDraggableElement.js +100 -23
- package/hooks/useDraggableElement.js.map +1 -1
- package/hooks/usePopperDropdown.d.ts +1 -0
- package/hooks/usePopperDropdown.js +15 -12
- package/hooks/usePopperDropdown.js.map +1 -1
- package/hooks/useResizeObserver.d.ts +25 -6
- package/hooks/useResizeObserver.js +20 -18
- package/hooks/useResizeObserver.js.map +1 -1
- package/package.json +10 -10
- package/utils/analytics/createAnalyticsOverlayTooltip.js.map +1 -1
- package/utils/init/initConfig.js +5 -5
- package/utils/init/initConfig.js.map +1 -1
- package/version.d.ts +1 -1
- package/version.js +2 -2
- package/version.js.map +1 -1
|
@@ -1,11 +1,18 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import
|
|
1
|
+
import { jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import p from "./ClusterLayer.js";
|
|
3
3
|
import { wrapSimpleTheme as s } from "../../../../utils/clustering.js";
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
import { useMapContext as a } from "../../../MapContext.js";
|
|
5
|
+
const u = (r) => {
|
|
6
|
+
const t = a(), { simpleTheme: e, ...m } = r;
|
|
7
|
+
return /* @__PURE__ */ o(
|
|
8
|
+
p,
|
|
9
|
+
{
|
|
10
|
+
...m,
|
|
11
|
+
clusterTheme: e && s(e, t.enableMarkerIconCache)
|
|
12
|
+
}
|
|
13
|
+
);
|
|
7
14
|
};
|
|
8
15
|
export {
|
|
9
|
-
|
|
16
|
+
u as default
|
|
10
17
|
};
|
|
11
18
|
//# sourceMappingURL=SimpleClusterLayer.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SimpleClusterLayer.js","sources":["../../../../../../../src/components/map/components/features/layers/clustering/SimpleClusterLayer.tsx"],"sourcesContent":["import ClusterLayer, { type ClusterLayerProps } from './ClusterLayer';\nimport { type SimpleClusterTheme, wrapSimpleTheme } from '../../../../utils/clustering';\n\nexport type SimpleClusterLayerProps = Omit<ClusterLayerProps, 'clusterTheme'> & {\n simpleTheme?: SimpleClusterTheme;\n};\n\nconst SimpleClusterLayer = (props: SimpleClusterLayerProps) => {\n const { simpleTheme, ...rest } = props;\n return <ClusterLayer
|
|
1
|
+
{"version":3,"file":"SimpleClusterLayer.js","sources":["../../../../../../../src/components/map/components/features/layers/clustering/SimpleClusterLayer.tsx"],"sourcesContent":["import ClusterLayer, { type ClusterLayerProps } from './ClusterLayer';\nimport { type SimpleClusterTheme, wrapSimpleTheme } from '../../../../utils/clustering';\nimport { useMapContext } from '../../../MapContext';\n\nexport type SimpleClusterLayerProps = Omit<ClusterLayerProps, 'clusterTheme'> & {\n simpleTheme?: SimpleClusterTheme;\n};\n\nconst SimpleClusterLayer = (props: SimpleClusterLayerProps) => {\n const mapContext = useMapContext();\n const { simpleTheme, ...rest } = props;\n return (\n <ClusterLayer\n {...rest}\n clusterTheme={simpleTheme && wrapSimpleTheme(simpleTheme, mapContext.enableMarkerIconCache)}\n />\n );\n};\n\nexport default SimpleClusterLayer;\n"],"names":["SimpleClusterLayer","props","mapContext","useMapContext","simpleTheme","rest","jsx","ClusterLayer","wrapSimpleTheme"],"mappings":";;;;AAQA,MAAMA,IAAqB,CAACC,MAAmC;AAC3D,QAAMC,IAAaC,EAAA,GACb,EAAE,aAAAC,GAAa,GAAGC,EAAA,IAASJ;AACjC,SACI,gBAAAK;AAAA,IAACC;AAAA,IAAA;AAAA,MACI,GAAGF;AAAA,MACJ,cAAcD,KAAeI,EAAgBJ,GAAaF,EAAW,qBAAqB;AAAA,IAAA;AAAA,EAAA;AAGtG;"}
|
|
@@ -11,4 +11,4 @@ export type SimpleClusterTheme<T = any> = {
|
|
|
11
11
|
export declare const ClusterUtils: {
|
|
12
12
|
getBoundingBoxForCluster: (cluster: Cluster) => H.geo.Rect;
|
|
13
13
|
};
|
|
14
|
-
export declare const wrapSimpleTheme: (theme: SimpleClusterTheme) => ClusterTheme;
|
|
14
|
+
export declare const wrapSimpleTheme: (theme: SimpleClusterTheme, cacheEnabled?: boolean) => ClusterTheme;
|
|
@@ -1,47 +1,47 @@
|
|
|
1
|
-
import { getOrCreateIcon as
|
|
2
|
-
const
|
|
3
|
-
let
|
|
1
|
+
import { getOrCreateIcon as l, isDomMakerNeeded as c } from "../components/features/basics/Marker.js";
|
|
2
|
+
const m = (a) => {
|
|
3
|
+
let e = null, t = null, o = null, r = null;
|
|
4
4
|
return a.forEachDataPoint((s) => {
|
|
5
|
-
const
|
|
6
|
-
(
|
|
5
|
+
const n = s.getPosition();
|
|
6
|
+
(e === null || e > n.lat) && (e = n.lat), (t === null || t > n.lng) && (t = n.lng), (o === null || o < n.lat) && (o = n.lat), (r === null || r < n.lng) && (r = n.lng);
|
|
7
7
|
}), new H.geo.Rect(
|
|
8
|
-
|
|
9
|
-
n,
|
|
8
|
+
o,
|
|
10
9
|
t,
|
|
10
|
+
e,
|
|
11
11
|
r
|
|
12
12
|
);
|
|
13
|
-
},
|
|
14
|
-
getBoundingBoxForCluster:
|
|
15
|
-
},
|
|
16
|
-
const
|
|
17
|
-
t.forEachDataPoint((
|
|
18
|
-
const
|
|
19
|
-
if (
|
|
20
|
-
return
|
|
21
|
-
const
|
|
22
|
-
icon:
|
|
13
|
+
}, f = {
|
|
14
|
+
getBoundingBoxForCluster: m
|
|
15
|
+
}, u = (a, e) => (t) => {
|
|
16
|
+
const o = [];
|
|
17
|
+
t.forEachDataPoint((g) => o.push(g.getData()));
|
|
18
|
+
const r = a(o, t.getPosition());
|
|
19
|
+
if (r instanceof H.map.Object)
|
|
20
|
+
return r;
|
|
21
|
+
const s = l(r, { cacheEnabled: e }), n = c(s) ? H.map.DomMarker : H.map.Marker, i = new n(t.getPosition(), {
|
|
22
|
+
icon: s,
|
|
23
23
|
// Set min/max zoom with values from the cluster, otherwise
|
|
24
24
|
// clusters will be shown at all zoom levels
|
|
25
25
|
min: t.getMinZoom(),
|
|
26
26
|
max: t.getMaxZoom()
|
|
27
27
|
});
|
|
28
|
-
return
|
|
29
|
-
},
|
|
30
|
-
const
|
|
31
|
-
if (
|
|
32
|
-
return
|
|
33
|
-
const
|
|
34
|
-
icon:
|
|
28
|
+
return i.setData(t), i;
|
|
29
|
+
}, p = (a, e) => (t) => {
|
|
30
|
+
const o = a(t.getData(), t.getPosition());
|
|
31
|
+
if (o instanceof H.map.Object)
|
|
32
|
+
return o;
|
|
33
|
+
const r = l(o, { cacheEnabled: e }), s = c(r) ? H.map.DomMarker : H.map.Marker, n = new s(t.getPosition(), {
|
|
34
|
+
icon: r,
|
|
35
35
|
// Use min zoom from a noise point to show it correctly at certain zoom levels
|
|
36
36
|
min: t.getMinZoom()
|
|
37
37
|
});
|
|
38
|
-
return
|
|
39
|
-
},
|
|
40
|
-
getClusterPresentation:
|
|
41
|
-
getNoisePresentation:
|
|
38
|
+
return n.setData(t), n;
|
|
39
|
+
}, k = (a, e) => ({
|
|
40
|
+
getClusterPresentation: u(a.getClusterPresentation, e),
|
|
41
|
+
getNoisePresentation: p(a.getNoisePresentation, e)
|
|
42
42
|
});
|
|
43
43
|
export {
|
|
44
|
-
|
|
45
|
-
|
|
44
|
+
f as ClusterUtils,
|
|
45
|
+
k as wrapSimpleTheme
|
|
46
46
|
};
|
|
47
47
|
//# sourceMappingURL=clustering.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"clustering.js","sources":["../../../../src/components/map/utils/clustering.ts"],"sourcesContent":["import { getOrCreateIcon, isDomMakerNeeded, type MarkerIcon } from '../components/features/basics/Marker';\nimport type { ClusterTheme } from '../components/features/layers/clustering/ClusterLayer';\n\nexport type Cluster = H.clustering.ICluster;\nexport type DataPoint = H.clustering.DataPoint;\nexport type NoisePoint = H.clustering.INoisePoint;\n\nexport type Theme = H.clustering.ITheme | undefined;\n\n// biome-ignore lint/suspicious/noExplicitAny: keep it less strict\nexport type SimpleClusterTheme<T = any> = {\n getClusterPresentation: (data: T[], position: H.geo.Point) => H.map.Object | MarkerIcon;\n getNoisePresentation: (data: T, position: H.geo.Point) => H.map.Object | MarkerIcon;\n};\n\nconst getBoundingBoxForCluster = (cluster: Cluster): H.geo.Rect => {\n let minLat: number | null = null;\n let minLng: number | null = null;\n let maxLat: number | null = null;\n let maxLng: number | null = null;\n\n cluster.forEachDataPoint((dataPoint: NoisePoint) => {\n const position = dataPoint.getPosition();\n if (minLat === null || minLat > position.lat) {\n minLat = position.lat;\n }\n if (minLng === null || minLng > position.lng) {\n minLng = position.lng;\n }\n if (maxLat === null || maxLat < position.lat) {\n maxLat = position.lat;\n }\n if (maxLng === null || maxLng < position.lng) {\n maxLng = position.lng;\n }\n });\n\n return new H.geo.Rect(\n maxLat as unknown as number,\n minLng as unknown as number,\n minLat as unknown as number,\n maxLng as unknown as number\n );\n};\n\nexport const ClusterUtils = {\n getBoundingBoxForCluster,\n};\n\nconst wrapClusterPresentation = <T>(\n func: (clusterElements: T[], position: H.geo.Point) => H.map.Object | MarkerIcon\n) => {\n return (cluster: Cluster): H.map.Marker => {\n const clusterElements: T[] = [];\n\n cluster.forEachDataPoint((point: NoisePoint) => clusterElements.push(point.getData()));\n\n const presentation = func(clusterElements, cluster.getPosition());\n if (presentation instanceof H.map.Object) {\n return presentation as H.map.Marker;\n }\n\n const clusterIcon = getOrCreateIcon(presentation);\n const MarkerConstructor = isDomMakerNeeded(clusterIcon) ? H.map.DomMarker : H.map.Marker;\n\n const clusterMarker = new MarkerConstructor(cluster.getPosition(), {\n icon: clusterIcon,\n\n // Set min/max zoom with values from the cluster, otherwise\n // clusters will be shown at all zoom levels\n min: cluster.getMinZoom(),\n max: cluster.getMaxZoom(),\n });\n\n // Bind cluster data to the marker\n clusterMarker.setData(cluster);\n\n return clusterMarker;\n };\n};\n\nconst wrapNoisePresentation = <T>(func: (data: T, position: H.geo.Point) => H.map.Object | MarkerIcon) => {\n return (noisePoint: NoisePoint): H.map.Marker => {\n const presentation = func(noisePoint.getData(), noisePoint.getPosition());\n if (presentation instanceof H.map.Object) {\n return presentation as H.map.Marker;\n }\n\n const noiseIcon = getOrCreateIcon(presentation);\n const MarkerConstructor = isDomMakerNeeded(noiseIcon) ? H.map.DomMarker : H.map.Marker;\n\n const noiseMarker = new MarkerConstructor(noisePoint.getPosition(), {\n icon: noiseIcon,\n\n // Use min zoom from a noise point to show it correctly at certain zoom levels\n min: noisePoint.getMinZoom(),\n });\n\n // Bind noise point data to the marker:\n noiseMarker.setData(noisePoint);\n\n return noiseMarker;\n };\n};\n\nexport const wrapSimpleTheme = (theme: SimpleClusterTheme): ClusterTheme => ({\n getClusterPresentation: wrapClusterPresentation(theme.getClusterPresentation),\n getNoisePresentation: wrapNoisePresentation(theme.getNoisePresentation),\n});\n"],"names":["getBoundingBoxForCluster","cluster","minLat","minLng","maxLat","maxLng","dataPoint","position","ClusterUtils","wrapClusterPresentation","func","clusterElements","point","presentation","clusterIcon","getOrCreateIcon","MarkerConstructor","isDomMakerNeeded","clusterMarker","wrapNoisePresentation","noisePoint","noiseIcon","noiseMarker","wrapSimpleTheme","theme"],"mappings":";AAeA,MAAMA,IAA2B,CAACC,MAAiC;AAC/D,MAAIC,IAAwB,MACxBC,IAAwB,MACxBC,IAAwB,MACxBC,IAAwB;AAE5B,SAAAJ,EAAQ,iBAAiB,CAACK,MAA0B;AAChD,UAAMC,IAAWD,EAAU,YAAA;AAC3B,KAAIJ,MAAW,QAAQA,IAASK,EAAS,SACrCL,IAASK,EAAS,OAElBJ,MAAW,QAAQA,IAASI,EAAS,SACrCJ,IAASI,EAAS,OAElBH,MAAW,QAAQA,IAASG,EAAS,SACrCH,IAASG,EAAS,OAElBF,MAAW,QAAQA,IAASE,EAAS,SACrCF,IAASE,EAAS;AAAA,EAE1B,CAAC,GAEM,IAAI,EAAE,IAAI;AAAA,IACbH;AAAA,IACAD;AAAA,IACAD;AAAA,IACAG;AAAA,EAAA;AAER,GAEaG,IAAe;AAAA,EACxB,0BAAAR;AACJ,GAEMS,IAA0B,CAC5BC,MAEO,
|
|
1
|
+
{"version":3,"file":"clustering.js","sources":["../../../../src/components/map/utils/clustering.ts"],"sourcesContent":["import { getOrCreateIcon, isDomMakerNeeded, type MarkerIcon } from '../components/features/basics/Marker';\nimport type { ClusterTheme } from '../components/features/layers/clustering/ClusterLayer';\n\nexport type Cluster = H.clustering.ICluster;\nexport type DataPoint = H.clustering.DataPoint;\nexport type NoisePoint = H.clustering.INoisePoint;\n\nexport type Theme = H.clustering.ITheme | undefined;\n\n// biome-ignore lint/suspicious/noExplicitAny: keep it less strict\nexport type SimpleClusterTheme<T = any> = {\n getClusterPresentation: (data: T[], position: H.geo.Point) => H.map.Object | MarkerIcon;\n getNoisePresentation: (data: T, position: H.geo.Point) => H.map.Object | MarkerIcon;\n};\n\nconst getBoundingBoxForCluster = (cluster: Cluster): H.geo.Rect => {\n let minLat: number | null = null;\n let minLng: number | null = null;\n let maxLat: number | null = null;\n let maxLng: number | null = null;\n\n cluster.forEachDataPoint((dataPoint: NoisePoint) => {\n const position = dataPoint.getPosition();\n if (minLat === null || minLat > position.lat) {\n minLat = position.lat;\n }\n if (minLng === null || minLng > position.lng) {\n minLng = position.lng;\n }\n if (maxLat === null || maxLat < position.lat) {\n maxLat = position.lat;\n }\n if (maxLng === null || maxLng < position.lng) {\n maxLng = position.lng;\n }\n });\n\n return new H.geo.Rect(\n maxLat as unknown as number,\n minLng as unknown as number,\n minLat as unknown as number,\n maxLng as unknown as number\n );\n};\n\nexport const ClusterUtils = {\n getBoundingBoxForCluster,\n};\n\nconst wrapClusterPresentation = <T>(\n func: (clusterElements: T[], position: H.geo.Point) => H.map.Object | MarkerIcon,\n cacheEnabled?: boolean\n) => {\n return (cluster: Cluster): H.map.Marker => {\n const clusterElements: T[] = [];\n\n cluster.forEachDataPoint((point: NoisePoint) => clusterElements.push(point.getData()));\n\n const presentation = func(clusterElements, cluster.getPosition());\n if (presentation instanceof H.map.Object) {\n return presentation as H.map.Marker;\n }\n\n const clusterIcon = getOrCreateIcon(presentation, { cacheEnabled });\n const MarkerConstructor = isDomMakerNeeded(clusterIcon) ? H.map.DomMarker : H.map.Marker;\n\n const clusterMarker = new MarkerConstructor(cluster.getPosition(), {\n icon: clusterIcon,\n\n // Set min/max zoom with values from the cluster, otherwise\n // clusters will be shown at all zoom levels\n min: cluster.getMinZoom(),\n max: cluster.getMaxZoom(),\n });\n\n // Bind cluster data to the marker\n clusterMarker.setData(cluster);\n\n return clusterMarker;\n };\n};\n\nconst wrapNoisePresentation = <T>(\n func: (data: T, position: H.geo.Point) => H.map.Object | MarkerIcon,\n cacheEnabled?: boolean\n) => {\n return (noisePoint: NoisePoint): H.map.Marker => {\n const presentation = func(noisePoint.getData(), noisePoint.getPosition());\n if (presentation instanceof H.map.Object) {\n return presentation as H.map.Marker;\n }\n\n const noiseIcon = getOrCreateIcon(presentation, { cacheEnabled });\n const MarkerConstructor = isDomMakerNeeded(noiseIcon) ? H.map.DomMarker : H.map.Marker;\n\n const noiseMarker = new MarkerConstructor(noisePoint.getPosition(), {\n icon: noiseIcon,\n\n // Use min zoom from a noise point to show it correctly at certain zoom levels\n min: noisePoint.getMinZoom(),\n });\n\n // Bind noise point data to the marker:\n noiseMarker.setData(noisePoint);\n\n return noiseMarker;\n };\n};\n\nexport const wrapSimpleTheme = (theme: SimpleClusterTheme, cacheEnabled?: boolean): ClusterTheme => ({\n getClusterPresentation: wrapClusterPresentation(theme.getClusterPresentation, cacheEnabled),\n getNoisePresentation: wrapNoisePresentation(theme.getNoisePresentation, cacheEnabled),\n});\n"],"names":["getBoundingBoxForCluster","cluster","minLat","minLng","maxLat","maxLng","dataPoint","position","ClusterUtils","wrapClusterPresentation","func","cacheEnabled","clusterElements","point","presentation","clusterIcon","getOrCreateIcon","MarkerConstructor","isDomMakerNeeded","clusterMarker","wrapNoisePresentation","noisePoint","noiseIcon","noiseMarker","wrapSimpleTheme","theme"],"mappings":";AAeA,MAAMA,IAA2B,CAACC,MAAiC;AAC/D,MAAIC,IAAwB,MACxBC,IAAwB,MACxBC,IAAwB,MACxBC,IAAwB;AAE5B,SAAAJ,EAAQ,iBAAiB,CAACK,MAA0B;AAChD,UAAMC,IAAWD,EAAU,YAAA;AAC3B,KAAIJ,MAAW,QAAQA,IAASK,EAAS,SACrCL,IAASK,EAAS,OAElBJ,MAAW,QAAQA,IAASI,EAAS,SACrCJ,IAASI,EAAS,OAElBH,MAAW,QAAQA,IAASG,EAAS,SACrCH,IAASG,EAAS,OAElBF,MAAW,QAAQA,IAASE,EAAS,SACrCF,IAASE,EAAS;AAAA,EAE1B,CAAC,GAEM,IAAI,EAAE,IAAI;AAAA,IACbH;AAAA,IACAD;AAAA,IACAD;AAAA,IACAG;AAAA,EAAA;AAER,GAEaG,IAAe;AAAA,EACxB,0BAAAR;AACJ,GAEMS,IAA0B,CAC5BC,GACAC,MAEO,CAACV,MAAmC;AACvC,QAAMW,IAAuB,CAAA;AAE7B,EAAAX,EAAQ,iBAAiB,CAACY,MAAsBD,EAAgB,KAAKC,EAAM,QAAA,CAAS,CAAC;AAErF,QAAMC,IAAeJ,EAAKE,GAAiBX,EAAQ,aAAa;AAChE,MAAIa,aAAwB,EAAE,IAAI;AAC9B,WAAOA;AAGX,QAAMC,IAAcC,EAAgBF,GAAc,EAAE,cAAAH,GAAc,GAC5DM,IAAoBC,EAAiBH,CAAW,IAAI,EAAE,IAAI,YAAY,EAAE,IAAI,QAE5EI,IAAgB,IAAIF,EAAkBhB,EAAQ,eAAe;AAAA,IAC/D,MAAMc;AAAA;AAAA;AAAA,IAIN,KAAKd,EAAQ,WAAA;AAAA,IACb,KAAKA,EAAQ,WAAA;AAAA,EAAW,CAC3B;AAGD,SAAAkB,EAAc,QAAQlB,CAAO,GAEtBkB;AACX,GAGEC,IAAwB,CAC1BV,GACAC,MAEO,CAACU,MAAyC;AAC7C,QAAMP,IAAeJ,EAAKW,EAAW,WAAWA,EAAW,aAAa;AACxE,MAAIP,aAAwB,EAAE,IAAI;AAC9B,WAAOA;AAGX,QAAMQ,IAAYN,EAAgBF,GAAc,EAAE,cAAAH,GAAc,GAC1DM,IAAoBC,EAAiBI,CAAS,IAAI,EAAE,IAAI,YAAY,EAAE,IAAI,QAE1EC,IAAc,IAAIN,EAAkBI,EAAW,eAAe;AAAA,IAChE,MAAMC;AAAA;AAAA,IAGN,KAAKD,EAAW,WAAA;AAAA,EAAW,CAC9B;AAGD,SAAAE,EAAY,QAAQF,CAAU,GAEvBE;AACX,GAGSC,IAAkB,CAACC,GAA2Bd,OAA0C;AAAA,EACjG,wBAAwBF,EAAwBgB,EAAM,wBAAwBd,CAAY;AAAA,EAC1F,sBAAsBS,EAAsBK,EAAM,sBAAsBd,CAAY;AACxF;"}
|
|
@@ -48,38 +48,179 @@ export type MapCredentials = {
|
|
|
48
48
|
apikey?: string;
|
|
49
49
|
};
|
|
50
50
|
export type MapProps = {
|
|
51
|
+
/**
|
|
52
|
+
* HERE credentials used to initialize the map platform.
|
|
53
|
+
*/
|
|
51
54
|
credentials: MapCredentials;
|
|
55
|
+
/**
|
|
56
|
+
* Height of the map container.
|
|
57
|
+
*/
|
|
52
58
|
height?: number;
|
|
59
|
+
/**
|
|
60
|
+
* Width of the map container.
|
|
61
|
+
*/
|
|
53
62
|
width?: number;
|
|
63
|
+
/**
|
|
64
|
+
* Language used for HERE map labels and controls.
|
|
65
|
+
*
|
|
66
|
+
* @default 'en'
|
|
67
|
+
*/
|
|
54
68
|
language?: string;
|
|
69
|
+
/**
|
|
70
|
+
* Initial center position of the map.
|
|
71
|
+
*/
|
|
55
72
|
center?: Position;
|
|
73
|
+
/**
|
|
74
|
+
* Initial or controlled zoom level of the map.
|
|
75
|
+
*/
|
|
56
76
|
zoom?: number;
|
|
77
|
+
/**
|
|
78
|
+
* Bounding box that should be fitted by the map view.
|
|
79
|
+
*/
|
|
57
80
|
boundingBox?: BoundingBox;
|
|
81
|
+
/**
|
|
82
|
+
* Disables HERE map events entirely.
|
|
83
|
+
*/
|
|
58
84
|
disableMapEvents?: boolean;
|
|
85
|
+
/**
|
|
86
|
+
* Disables the default HERE map behavior such as pan and zoom interaction.
|
|
87
|
+
*
|
|
88
|
+
* @default false
|
|
89
|
+
*/
|
|
59
90
|
disableBehavior?: boolean;
|
|
91
|
+
/**
|
|
92
|
+
* Disables HERE zoom momentum to reduce scroll inertia on zoom.
|
|
93
|
+
*
|
|
94
|
+
* @default true
|
|
95
|
+
*/
|
|
60
96
|
disableZoomMomentum?: boolean;
|
|
97
|
+
/**
|
|
98
|
+
* Event listeners attached to the HERE map instance.
|
|
99
|
+
*/
|
|
61
100
|
eventListenerMap?: EventListenerMap;
|
|
101
|
+
/**
|
|
102
|
+
* Legacy prop for hiding map settings.
|
|
103
|
+
*/
|
|
62
104
|
hideMapSettings?: boolean;
|
|
105
|
+
/**
|
|
106
|
+
* Hides the cluster settings entry in the map settings UI.
|
|
107
|
+
*
|
|
108
|
+
* @default false
|
|
109
|
+
*/
|
|
63
110
|
hideClusterSettings?: boolean;
|
|
111
|
+
/**
|
|
112
|
+
* Hides the map layer settings entry in the map settings UI.
|
|
113
|
+
*
|
|
114
|
+
* @default false
|
|
115
|
+
*/
|
|
64
116
|
hideMapLayerSettings?: boolean;
|
|
117
|
+
/**
|
|
118
|
+
* Base map type to render.
|
|
119
|
+
*
|
|
120
|
+
* @default Map.TYPE_DEFAULT
|
|
121
|
+
*/
|
|
65
122
|
mapType?: MapType;
|
|
123
|
+
/**
|
|
124
|
+
* Active overlay layers such as traffic or incidents.
|
|
125
|
+
*
|
|
126
|
+
* @default []
|
|
127
|
+
*/
|
|
66
128
|
mapLayer?: MapLayer[];
|
|
129
|
+
/**
|
|
130
|
+
* Controls whether marker clustering is enabled.
|
|
131
|
+
*
|
|
132
|
+
* @default true
|
|
133
|
+
*/
|
|
67
134
|
showCluster?: boolean;
|
|
135
|
+
/**
|
|
136
|
+
* Shows the HERE scale bar.
|
|
137
|
+
*
|
|
138
|
+
* @default false
|
|
139
|
+
*/
|
|
68
140
|
showScaleBar?: boolean;
|
|
141
|
+
/**
|
|
142
|
+
* Callback fired when the map type changes.
|
|
143
|
+
*/
|
|
69
144
|
onMapTypeChange?: (type: MapType, previousType?: MapType) => void;
|
|
145
|
+
/**
|
|
146
|
+
* Callback fired when the active map layers change.
|
|
147
|
+
*/
|
|
70
148
|
onMapLayerChange?: (activeLayer: MapLayer[], previousLayer?: MapLayer[]) => void;
|
|
149
|
+
/**
|
|
150
|
+
* Callback fired when the cluster visibility changes.
|
|
151
|
+
*/
|
|
71
152
|
onShowClusterChange?: (show: boolean) => void;
|
|
153
|
+
/**
|
|
154
|
+
* Callback fired when zooming in via the built-in zoom controls.
|
|
155
|
+
*/
|
|
72
156
|
onZoomIn?: (zoom: number) => void;
|
|
157
|
+
/**
|
|
158
|
+
* Callback fired when zooming out via the built-in zoom controls.
|
|
159
|
+
*/
|
|
73
160
|
onZoomOut?: (zoom: number) => void;
|
|
161
|
+
/**
|
|
162
|
+
* Callback used by incidents overlays to report fetched incidents.
|
|
163
|
+
*/
|
|
74
164
|
onIncidentsChange?: (incidentsResult: MapIncidents) => void;
|
|
165
|
+
/**
|
|
166
|
+
* Tooltip content for the map settings entry.
|
|
167
|
+
*/
|
|
75
168
|
mapSettingsTooltip?: string | React.ReactNode;
|
|
169
|
+
/**
|
|
170
|
+
* Custom settings UI rendered on top of the map.
|
|
171
|
+
*/
|
|
76
172
|
mapSettings?: React.ReactNode;
|
|
173
|
+
/**
|
|
174
|
+
* Enables animation when zoom or center changes are applied programmatically.
|
|
175
|
+
*
|
|
176
|
+
* @default false
|
|
177
|
+
*/
|
|
77
178
|
zoomAnimation?: boolean;
|
|
179
|
+
/**
|
|
180
|
+
* Enables the WebGL/HARP rendering engine where supported.
|
|
181
|
+
*
|
|
182
|
+
* @default true
|
|
183
|
+
*/
|
|
78
184
|
enableWebGL?: boolean;
|
|
185
|
+
/**
|
|
186
|
+
* Uses `window.devicePixelRatio` for map rendering.
|
|
187
|
+
*
|
|
188
|
+
* @default true
|
|
189
|
+
*/
|
|
79
190
|
enableDevicePixelRatio?: boolean;
|
|
191
|
+
/**
|
|
192
|
+
* Enables caching for generated marker icons.
|
|
193
|
+
*
|
|
194
|
+
* @default true
|
|
195
|
+
*/
|
|
196
|
+
enableMarkerIconCache?: boolean;
|
|
197
|
+
/**
|
|
198
|
+
* Keeps HERE fractional zoom enabled for smoother trackpad and wheel zoom interaction.
|
|
199
|
+
*
|
|
200
|
+
* @default false
|
|
201
|
+
*/
|
|
202
|
+
enableFractionalZoom?: boolean;
|
|
203
|
+
/**
|
|
204
|
+
* Temporarily disables marker pointer events during zoom interactions to reduce DOM hit-testing overhead.
|
|
205
|
+
*
|
|
206
|
+
* @default false
|
|
207
|
+
*/
|
|
208
|
+
disableMarkerPointerEventsWhileZooming?: boolean;
|
|
209
|
+
/**
|
|
210
|
+
* Fallback pixel ratio used when device pixel ratio support is disabled.
|
|
211
|
+
*/
|
|
80
212
|
pixelRatio?: number;
|
|
213
|
+
/**
|
|
214
|
+
* Minimum allowed zoom level.
|
|
215
|
+
*/
|
|
81
216
|
minZoom?: number;
|
|
217
|
+
/**
|
|
218
|
+
* Maximum allowed zoom level.
|
|
219
|
+
*/
|
|
82
220
|
maxZoom?: number;
|
|
221
|
+
/**
|
|
222
|
+
* Map content or a render function receiving the map API.
|
|
223
|
+
*/
|
|
83
224
|
children?: React.ReactNode | ((api: MapApi, incidents?: MapIncidents) => React.ReactNode);
|
|
84
225
|
};
|
|
85
226
|
export type MapApi = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mapTypes.js","sources":["../../../../src/components/map/utils/mapTypes.ts"],"sourcesContent":["import type { ObjectValues } from '../../../utils/ObjectValues';\nimport type { MapUtils } from './mapUtils';\nimport type { EventListenerMap } from './eventHandling';\n\nexport type Point = H.geo.Point;\n\nexport type NoisePoint = H.clustering.INoisePoint;\nexport type DataPoint = H.clustering.DataPoint;\n\nexport type MapEvent = H.mapevents.Event & {};\n\nexport type MapContextMenuEvent = H.mapevents.ContextMenuEvent;\n\nexport type MapInfoBubble = H.ui.InfoBubble;\n\nexport type MapUtilEvent = H.util.Event;\n\nexport type Position = {\n lat: number;\n lng: number;\n};\n\nexport type BoundingBox = {\n top: number;\n bottom: number;\n left: number;\n right: number;\n};\n\nexport type MapBoundingBox = {\n topLeft: {\n lng: number | undefined;\n lat: number | undefined;\n };\n bottomRight: {\n lng: number | undefined;\n lat: number | undefined;\n };\n};\n\nexport const MapTypeMap = {\n TYPE_DEFAULT: 'DEFAULT',\n TYPE_FLEET_STYLE: 'FLEET_STYLE',\n TYPE_SATELLITE: 'SATELLITE',\n TYPE_TERRAIN: 'TERRAIN',\n TYPE_NIGHT: 'NIGHT',\n} as const;\n\nexport type MapType = ObjectValues<typeof MapTypeMap>;\n\nexport const MapLayerMap = {\n MAP_LAYER_INCIDENTS: 'INCIDENTS',\n MAP_LAYER_TRAFFIC: 'TRAFFIC',\n MAP_LAYER_ROAD_RESTRICTIONS: 'ROAD_RESTRICTIONS',\n} as const;\n\nexport type MapLayer = ObjectValues<typeof MapLayerMap>;\n\nexport type MapCredentials = {\n app_id?: string;\n app_code?: string;\n apikey?: string;\n};\n\nexport type MapProps = {\n credentials: MapCredentials;\n height?: number;\n width?: number;\n language?: string;\n center?: Position;\n zoom?: number;\n boundingBox?: BoundingBox;\n disableMapEvents?: boolean;\n disableBehavior?: boolean;\n disableZoomMomentum?: boolean;\n eventListenerMap?: EventListenerMap;\n hideMapSettings?: boolean;\n hideClusterSettings?: boolean;\n hideMapLayerSettings?: boolean;\n mapType?: MapType;\n mapLayer?: MapLayer[];\n showCluster?: boolean;\n showScaleBar?: boolean;\n onMapTypeChange?: (type: MapType, previousType?: MapType) => void;\n onMapLayerChange?: (activeLayer: MapLayer[], previousLayer?: MapLayer[]) => void;\n onShowClusterChange?: (show: boolean) => void;\n onZoomIn?: (zoom: number) => void;\n onZoomOut?: (zoom: number) => void;\n onIncidentsChange?: (incidentsResult: MapIncidents) => void;\n mapSettingsTooltip?: string | React.ReactNode;\n mapSettings?: React.ReactNode;\n zoomAnimation?: boolean;\n enableWebGL?: boolean;\n enableDevicePixelRatio?: boolean;\n pixelRatio?: number;\n minZoom?: number;\n maxZoom?: number;\n children?: React.ReactNode | ((api: MapApi, incidents?: MapIncidents) => React.ReactNode);\n};\n\nexport type MapApi = {\n credentials?: MapCredentials;\n defaultLayers?: H.service.DefaultLayers;\n map?: H.Map;\n mapEvents?: false | H.mapevents.MapEvents;\n behavior?: false | H.mapevents.Behavior;\n platform?: H.service.Platform;\n ui?: H.ui.UI;\n utils?: MapUtils;\n group?: H.map.Group;\n settings?: {\n enableWebGL?: boolean;\n baseLayer?: MapType;\n activeLayers?: MapLayer[];\n showCluster?: boolean;\n minZoom?: number;\n maxZoom?: number;\n };\n};\n\nexport type MapIncidents = {\n sourceUpdated: string;\n results: IncidentDataPoint[];\n};\n\nexport type Incidents = {\n sourceUpdated: string;\n results: Incident[];\n};\n\nexport type IncidentLocationPoint = {\n length: number;\n points: Position[];\n};\n\nexport type IncidentLocationShape = {\n links: IncidentLocationPoint[];\n};\n\nexport type Incident = {\n incidentDetails: IncidentDetails;\n location: {\n length: number;\n shape: IncidentLocationShape;\n };\n};\n\nexport type IncidentDetails = {\n id: string;\n hrn: string;\n originalId: string;\n originalHrn: string;\n startTime: string;\n endTime: string;\n entryTime: string;\n roadClosed: boolean;\n criticality: 'minor' | 'major' | 'critical';\n type: 'roadClosure' | 'construction' | 'roadHazard' | 'other';\n codes: number[];\n comment: string | undefined;\n description: {\n value: string;\n language?: string;\n };\n summary: {\n value: string;\n language?: string;\n };\n junctionTraversability: string;\n};\n\n// https://www.here.com/docs/bundle/traffic-api-developer-guide-v7/page/topics/concepts/incidents.html#incidents\nexport type IncidentDataPoint = {\n id: string;\n tooltipContent: string;\n criticality: 'low' | 'minor' | 'major' | 'critical';\n description: {\n value: string;\n language?: string;\n };\n summary: {\n value: string;\n language?: string;\n };\n comment: string | undefined;\n type:\n | 'accident'\n | 'construction'\n | 'congestion'\n | 'roadHazard'\n | 'roadClosure'\n | 'disabledVehicle'\n | 'massTransit'\n | 'plannedEvent'\n | 'weather'\n | 'laneRestriction'\n | 'other';\n startTime: string;\n endTime: string;\n roadClosed: boolean;\n position: Position;\n};\n\nexport const markerColorOptions = [\n 'bg-map-marker-asset',\n 'bg-map-marker-poi',\n 'bg-map-marker-geofence',\n 'bg-map-marker-route',\n 'bg-map-marker-info',\n 'bg-map-marker-success',\n 'bg-map-marker-warning',\n 'bg-map-marker-danger',\n 'bg-map-marker-restrictions',\n] as const;\n\nexport type MarkerColor = (typeof markerColorOptions)[number];\n\nexport const markerColorMapping: Record<MarkerColor, string> = {\n 'bg-map-marker-asset': '--color-map-marker-asset',\n 'bg-map-marker-poi': '--color-map-marker-poi',\n 'bg-map-marker-geofence': '--color-map-marker-geofence',\n 'bg-map-marker-route': '--color-map-marker-route',\n 'bg-map-marker-info': '--color-map-marker-info',\n 'bg-map-marker-success': '--color-map-marker-success',\n 'bg-map-marker-warning': '--color-map-marker-warning',\n 'bg-map-marker-danger': '--color-map-marker-danger',\n 'bg-map-marker-restrictions': '--color-map-marker-restrictions',\n};\n"],"names":["MapTypeMap","MapLayerMap","markerColorOptions","markerColorMapping"],"mappings":"AAwCO,MAAMA,IAAa;AAAA,EACtB,cAAc;AAAA,EACd,kBAAkB;AAAA,EAClB,gBAAgB;AAAA,EAChB,cAAc;AAAA,EACd,YAAY;AAChB,GAIaC,IAAc;AAAA,EACvB,qBAAqB;AAAA,EACrB,mBAAmB;AAAA,EACnB,6BAA6B;AACjC,GAqJaC,IAAqB;AAAA,EAC9B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACJ,GAIaC,IAAkD;AAAA,EAC3D,uBAAuB;AAAA,EACvB,qBAAqB;AAAA,EACrB,0BAA0B;AAAA,EAC1B,uBAAuB;AAAA,EACvB,sBAAsB;AAAA,EACtB,yBAAyB;AAAA,EACzB,yBAAyB;AAAA,EACzB,wBAAwB;AAAA,EACxB,8BAA8B;AAClC;"}
|
|
1
|
+
{"version":3,"file":"mapTypes.js","sources":["../../../../src/components/map/utils/mapTypes.ts"],"sourcesContent":["import type { ObjectValues } from '../../../utils/ObjectValues';\nimport type { MapUtils } from './mapUtils';\nimport type { EventListenerMap } from './eventHandling';\n\nexport type Point = H.geo.Point;\n\nexport type NoisePoint = H.clustering.INoisePoint;\nexport type DataPoint = H.clustering.DataPoint;\n\nexport type MapEvent = H.mapevents.Event & {};\n\nexport type MapContextMenuEvent = H.mapevents.ContextMenuEvent;\n\nexport type MapInfoBubble = H.ui.InfoBubble;\n\nexport type MapUtilEvent = H.util.Event;\n\nexport type Position = {\n lat: number;\n lng: number;\n};\n\nexport type BoundingBox = {\n top: number;\n bottom: number;\n left: number;\n right: number;\n};\n\nexport type MapBoundingBox = {\n topLeft: {\n lng: number | undefined;\n lat: number | undefined;\n };\n bottomRight: {\n lng: number | undefined;\n lat: number | undefined;\n };\n};\n\nexport const MapTypeMap = {\n TYPE_DEFAULT: 'DEFAULT',\n TYPE_FLEET_STYLE: 'FLEET_STYLE',\n TYPE_SATELLITE: 'SATELLITE',\n TYPE_TERRAIN: 'TERRAIN',\n TYPE_NIGHT: 'NIGHT',\n} as const;\n\nexport type MapType = ObjectValues<typeof MapTypeMap>;\n\nexport const MapLayerMap = {\n MAP_LAYER_INCIDENTS: 'INCIDENTS',\n MAP_LAYER_TRAFFIC: 'TRAFFIC',\n MAP_LAYER_ROAD_RESTRICTIONS: 'ROAD_RESTRICTIONS',\n} as const;\n\nexport type MapLayer = ObjectValues<typeof MapLayerMap>;\n\nexport type MapCredentials = {\n app_id?: string;\n app_code?: string;\n apikey?: string;\n};\n\nexport type MapProps = {\n /**\n * HERE credentials used to initialize the map platform.\n */\n credentials: MapCredentials;\n\n /**\n * Height of the map container.\n */\n height?: number;\n\n /**\n * Width of the map container.\n */\n width?: number;\n\n /**\n * Language used for HERE map labels and controls.\n *\n * @default 'en'\n */\n language?: string;\n\n /**\n * Initial center position of the map.\n */\n center?: Position;\n\n /**\n * Initial or controlled zoom level of the map.\n */\n zoom?: number;\n\n /**\n * Bounding box that should be fitted by the map view.\n */\n boundingBox?: BoundingBox;\n\n /**\n * Disables HERE map events entirely.\n */\n disableMapEvents?: boolean;\n\n /**\n * Disables the default HERE map behavior such as pan and zoom interaction.\n *\n * @default false\n */\n disableBehavior?: boolean;\n\n /**\n * Disables HERE zoom momentum to reduce scroll inertia on zoom.\n *\n * @default true\n */\n disableZoomMomentum?: boolean;\n\n /**\n * Event listeners attached to the HERE map instance.\n */\n eventListenerMap?: EventListenerMap;\n\n /**\n * Legacy prop for hiding map settings.\n */\n hideMapSettings?: boolean;\n\n /**\n * Hides the cluster settings entry in the map settings UI.\n *\n * @default false\n */\n hideClusterSettings?: boolean;\n\n /**\n * Hides the map layer settings entry in the map settings UI.\n *\n * @default false\n */\n hideMapLayerSettings?: boolean;\n\n /**\n * Base map type to render.\n *\n * @default Map.TYPE_DEFAULT\n */\n mapType?: MapType;\n\n /**\n * Active overlay layers such as traffic or incidents.\n *\n * @default []\n */\n mapLayer?: MapLayer[];\n\n /**\n * Controls whether marker clustering is enabled.\n *\n * @default true\n */\n showCluster?: boolean;\n\n /**\n * Shows the HERE scale bar.\n *\n * @default false\n */\n showScaleBar?: boolean;\n\n /**\n * Callback fired when the map type changes.\n */\n onMapTypeChange?: (type: MapType, previousType?: MapType) => void;\n\n /**\n * Callback fired when the active map layers change.\n */\n onMapLayerChange?: (activeLayer: MapLayer[], previousLayer?: MapLayer[]) => void;\n\n /**\n * Callback fired when the cluster visibility changes.\n */\n onShowClusterChange?: (show: boolean) => void;\n\n /**\n * Callback fired when zooming in via the built-in zoom controls.\n */\n onZoomIn?: (zoom: number) => void;\n\n /**\n * Callback fired when zooming out via the built-in zoom controls.\n */\n onZoomOut?: (zoom: number) => void;\n\n /**\n * Callback used by incidents overlays to report fetched incidents.\n */\n onIncidentsChange?: (incidentsResult: MapIncidents) => void;\n\n /**\n * Tooltip content for the map settings entry.\n */\n mapSettingsTooltip?: string | React.ReactNode;\n\n /**\n * Custom settings UI rendered on top of the map.\n */\n mapSettings?: React.ReactNode;\n\n /**\n * Enables animation when zoom or center changes are applied programmatically.\n *\n * @default false\n */\n zoomAnimation?: boolean;\n\n /**\n * Enables the WebGL/HARP rendering engine where supported.\n *\n * @default true\n */\n enableWebGL?: boolean;\n\n /**\n * Uses `window.devicePixelRatio` for map rendering.\n *\n * @default true\n */\n enableDevicePixelRatio?: boolean;\n\n /**\n * Enables caching for generated marker icons.\n *\n * @default true\n */\n enableMarkerIconCache?: boolean;\n\n /**\n * Keeps HERE fractional zoom enabled for smoother trackpad and wheel zoom interaction.\n *\n * @default false\n */\n enableFractionalZoom?: boolean;\n\n /**\n * Temporarily disables marker pointer events during zoom interactions to reduce DOM hit-testing overhead.\n *\n * @default false\n */\n disableMarkerPointerEventsWhileZooming?: boolean;\n\n /**\n * Fallback pixel ratio used when device pixel ratio support is disabled.\n */\n pixelRatio?: number;\n\n /**\n * Minimum allowed zoom level.\n */\n minZoom?: number;\n\n /**\n * Maximum allowed zoom level.\n */\n maxZoom?: number;\n\n /**\n * Map content or a render function receiving the map API.\n */\n children?: React.ReactNode | ((api: MapApi, incidents?: MapIncidents) => React.ReactNode);\n};\n\nexport type MapApi = {\n credentials?: MapCredentials;\n defaultLayers?: H.service.DefaultLayers;\n map?: H.Map;\n mapEvents?: false | H.mapevents.MapEvents;\n behavior?: false | H.mapevents.Behavior;\n platform?: H.service.Platform;\n ui?: H.ui.UI;\n utils?: MapUtils;\n group?: H.map.Group;\n settings?: {\n enableWebGL?: boolean;\n baseLayer?: MapType;\n activeLayers?: MapLayer[];\n showCluster?: boolean;\n minZoom?: number;\n maxZoom?: number;\n };\n};\n\nexport type MapIncidents = {\n sourceUpdated: string;\n results: IncidentDataPoint[];\n};\n\nexport type Incidents = {\n sourceUpdated: string;\n results: Incident[];\n};\n\nexport type IncidentLocationPoint = {\n length: number;\n points: Position[];\n};\n\nexport type IncidentLocationShape = {\n links: IncidentLocationPoint[];\n};\n\nexport type Incident = {\n incidentDetails: IncidentDetails;\n location: {\n length: number;\n shape: IncidentLocationShape;\n };\n};\n\nexport type IncidentDetails = {\n id: string;\n hrn: string;\n originalId: string;\n originalHrn: string;\n startTime: string;\n endTime: string;\n entryTime: string;\n roadClosed: boolean;\n criticality: 'minor' | 'major' | 'critical';\n type: 'roadClosure' | 'construction' | 'roadHazard' | 'other';\n codes: number[];\n comment: string | undefined;\n description: {\n value: string;\n language?: string;\n };\n summary: {\n value: string;\n language?: string;\n };\n junctionTraversability: string;\n};\n\n// https://www.here.com/docs/bundle/traffic-api-developer-guide-v7/page/topics/concepts/incidents.html#incidents\nexport type IncidentDataPoint = {\n id: string;\n tooltipContent: string;\n criticality: 'low' | 'minor' | 'major' | 'critical';\n description: {\n value: string;\n language?: string;\n };\n summary: {\n value: string;\n language?: string;\n };\n comment: string | undefined;\n type:\n | 'accident'\n | 'construction'\n | 'congestion'\n | 'roadHazard'\n | 'roadClosure'\n | 'disabledVehicle'\n | 'massTransit'\n | 'plannedEvent'\n | 'weather'\n | 'laneRestriction'\n | 'other';\n startTime: string;\n endTime: string;\n roadClosed: boolean;\n position: Position;\n};\n\nexport const markerColorOptions = [\n 'bg-map-marker-asset',\n 'bg-map-marker-poi',\n 'bg-map-marker-geofence',\n 'bg-map-marker-route',\n 'bg-map-marker-info',\n 'bg-map-marker-success',\n 'bg-map-marker-warning',\n 'bg-map-marker-danger',\n 'bg-map-marker-restrictions',\n] as const;\n\nexport type MarkerColor = (typeof markerColorOptions)[number];\n\nexport const markerColorMapping: Record<MarkerColor, string> = {\n 'bg-map-marker-asset': '--color-map-marker-asset',\n 'bg-map-marker-poi': '--color-map-marker-poi',\n 'bg-map-marker-geofence': '--color-map-marker-geofence',\n 'bg-map-marker-route': '--color-map-marker-route',\n 'bg-map-marker-info': '--color-map-marker-info',\n 'bg-map-marker-success': '--color-map-marker-success',\n 'bg-map-marker-warning': '--color-map-marker-warning',\n 'bg-map-marker-danger': '--color-map-marker-danger',\n 'bg-map-marker-restrictions': '--color-map-marker-restrictions',\n};\n"],"names":["MapTypeMap","MapLayerMap","markerColorOptions","markerColorMapping"],"mappings":"AAwCO,MAAMA,IAAa;AAAA,EACtB,cAAc;AAAA,EACd,kBAAkB;AAAA,EAClB,gBAAgB;AAAA,EAChB,cAAc;AAAA,EACd,YAAY;AAChB,GAIaC,IAAc;AAAA,EACvB,qBAAqB;AAAA,EACrB,mBAAmB;AAAA,EACnB,6BAA6B;AACjC,GAqUaC,IAAqB;AAAA,EAC9B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACJ,GAIaC,IAAkD;AAAA,EAC3D,uBAAuB;AAAA,EACvB,qBAAqB;AAAA,EACrB,0BAA0B;AAAA,EAC1B,uBAAuB;AAAA,EACvB,sBAAsB;AAAA,EACtB,yBAAyB;AAAA,EACzB,yBAAyB;AAAA,EACzB,wBAAwB;AAAA,EACxB,8BAA8B;AAClC;"}
|
|
@@ -6,6 +6,7 @@ export type MapUtils = {
|
|
|
6
6
|
getCenter: () => Position;
|
|
7
7
|
setCenter: (position: Position, animate: boolean) => void;
|
|
8
8
|
getZoom: () => number;
|
|
9
|
+
getPreciseZoom: () => number;
|
|
9
10
|
setZoom: (zoom: number, zoomAnimation: boolean) => void;
|
|
10
11
|
getViewPort: () => {
|
|
11
12
|
width: number;
|
|
@@ -40,6 +41,7 @@ export declare const createUtils: (mapApi: H.Map) => {
|
|
|
40
41
|
lng: number;
|
|
41
42
|
};
|
|
42
43
|
setCenter: (position: Position, animate: boolean) => void;
|
|
44
|
+
getPreciseZoom: () => number;
|
|
43
45
|
getZoom: () => number;
|
|
44
46
|
setZoom: (zoom: number, zoomAnimation?: boolean) => void;
|
|
45
47
|
getViewPort: () => {
|
|
@@ -13,6 +13,10 @@ const b = (e) => {
|
|
|
13
13
|
setCenter: (t, o) => {
|
|
14
14
|
e.getViewModel().setLookAtData({ position: t }, o);
|
|
15
15
|
},
|
|
16
|
+
getPreciseZoom: () => {
|
|
17
|
+
const { zoom: t } = e.getViewModel().getLookAtData();
|
|
18
|
+
return t === void 0 ? 0 : t;
|
|
19
|
+
},
|
|
16
20
|
getZoom: () => {
|
|
17
21
|
const { zoom: t } = e.getViewModel().getLookAtData();
|
|
18
22
|
return Math.round(t === void 0 ? 0 : t);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mapUtils.js","sources":["../../../../src/components/map/utils/mapUtils.ts"],"sourcesContent":["import { calculateBoundingBox, isValidBoundingBox, parsePositionFromString } from './positions';\nimport type { BoundingBox, MapBoundingBox, Position } from './mapTypes';\n\n// Internal use for setting the map to a given bounding box\nexport const getMapBounds = (boundingBox: BoundingBox) => {\n const { top, left, bottom, right } = boundingBox;\n return new H.geo.Rect(top, left, bottom, right);\n};\n\nconst typeFilterFunction = (hereType: abstract new (...args: never[]) => H.map.Object) => (obj: H.map.Object) =>\n obj instanceof hereType;\n\nconst markerFilterFunction = typeFilterFunction(H.map.AbstractMarker);\n\nconst groupFilterFunction = typeFilterFunction(H.map.Group);\n\nconst polylineFilterFunction = typeFilterFunction(H.map.Polyline);\n\nconst getPosition = (marker: H.map.AbstractMarker) => marker.getGeometry();\n\nexport type MapUtils = {\n getCenter: () => Position;\n setCenter: (position: Position, animate: boolean) => void;\n getZoom: () => number;\n setZoom: (zoom: number, zoomAnimation: boolean) => void;\n getViewPort: () => {\n width: number;\n height: number;\n margin: number;\n padding: {\n top: number;\n right: number;\n bottom: number;\n left: number;\n };\n center: {\n x: number;\n y: number;\n };\n };\n getBounds: () => MapBoundingBox;\n getObjects: () => H.map.Object[];\n getLayers: () => H.map.DataModel[];\n getBaseLayer: () => H.map.layer.Layer;\n getGroups: () => H.map.Group[];\n getMarkers: () => H.map.Marker[];\n getRoutePolylines: () => H.map.Polyline[];\n getPosition: typeof getPosition;\n calculateBoundingBox: typeof calculateBoundingBox;\n isValidBoundingBox: typeof isValidBoundingBox;\n parsePositionFromString: typeof parsePositionFromString;\n};\n\nexport const createUtils = (mapApi: H.Map) => {\n return {\n getCenter: () => {\n const center = mapApi.getCenter();\n return {\n lat: center.lat,\n lng: center.lng,\n };\n },\n setCenter: (position: Position, animate: boolean) => {\n mapApi.getViewModel().setLookAtData({ position }, animate);\n },\n getZoom: () => {\n const { zoom } = mapApi.getViewModel().getLookAtData();\n return Math.round(zoom === undefined ? 0 : zoom);\n },\n setZoom: (zoom: number, zoomAnimation = false) => {\n mapApi.getViewModel().setLookAtData({ zoom }, zoomAnimation);\n },\n getViewPort: () => {\n const viewPort = mapApi.getViewPort();\n return {\n width: viewPort.width,\n height: viewPort.height,\n margin: viewPort.margin,\n padding: {\n top: viewPort.padding.top,\n right: viewPort.padding.right,\n bottom: viewPort.padding.bottom,\n left: viewPort.padding.left,\n },\n center: {\n x: viewPort.center.x,\n y: viewPort.center.y,\n },\n };\n },\n\n getBounds: () => {\n const { bounds } = mapApi.getViewModel().getLookAtData();\n\n // HERE Maps API for JavaScript 3.1\n const boundingBox = bounds?.getBoundingBox();\n return {\n topLeft: {\n lng: boundingBox?.getTopLeft().lng,\n lat: boundingBox?.getTopLeft().lat,\n },\n bottomRight: {\n lng: boundingBox?.getBottomRight().lng,\n lat: boundingBox?.getBottomRight().lat,\n },\n };\n },\n getObjects: () => mapApi.getObjects(),\n getLayers: () => mapApi.getLayers().asArray(),\n getBaseLayer: () => mapApi.getBaseLayer(),\n getGroups: () => mapApi.getObjects().filter(groupFilterFunction) as H.map.Group[],\n getMarkers: () => mapApi.getObjects().filter(markerFilterFunction) as H.map.Marker[],\n\n getRoutePolylines: () => {\n const groups = mapApi.getObjects().filter(groupFilterFunction) as H.map.Group[];\n const groupObjects = groups.flatMap(group => group.getObjects());\n const filteredPolylines = groupObjects.filter(polylineFilterFunction) as H.map.Polyline[];\n return filteredPolylines;\n },\n\n getPosition,\n calculateBoundingBox,\n isValidBoundingBox,\n parsePositionFromString,\n };\n};\n"],"names":["getMapBounds","boundingBox","top","left","bottom","right","typeFilterFunction","hereType","obj","markerFilterFunction","groupFilterFunction","polylineFilterFunction","getPosition","marker","createUtils","mapApi","center","position","animate","zoom","zoomAnimation","viewPort","bounds","group","calculateBoundingBox","isValidBoundingBox","parsePositionFromString"],"mappings":";AAIO,MAAMA,IAAe,CAACC,MAA6B;AACtD,QAAM,EAAE,KAAAC,GAAK,MAAAC,GAAM,QAAAC,GAAQ,OAAAC,MAAUJ;AACrC,SAAO,IAAI,EAAE,IAAI,KAAKC,GAAKC,GAAMC,GAAQC,CAAK;AAClD,GAEMC,IAAqB,CAACC,MAA8D,CAACC,MACvFA,aAAeD,GAEbE,IAAuBH,EAAmB,EAAE,IAAI,cAAc,GAE9DI,IAAsBJ,EAAmB,EAAE,IAAI,KAAK,GAEpDK,IAAyBL,EAAmB,EAAE,IAAI,QAAQ,GAE1DM,IAAc,CAACC,MAAiCA,EAAO,YAAA,
|
|
1
|
+
{"version":3,"file":"mapUtils.js","sources":["../../../../src/components/map/utils/mapUtils.ts"],"sourcesContent":["import { calculateBoundingBox, isValidBoundingBox, parsePositionFromString } from './positions';\nimport type { BoundingBox, MapBoundingBox, Position } from './mapTypes';\n\n// Internal use for setting the map to a given bounding box\nexport const getMapBounds = (boundingBox: BoundingBox) => {\n const { top, left, bottom, right } = boundingBox;\n return new H.geo.Rect(top, left, bottom, right);\n};\n\nconst typeFilterFunction = (hereType: abstract new (...args: never[]) => H.map.Object) => (obj: H.map.Object) =>\n obj instanceof hereType;\n\nconst markerFilterFunction = typeFilterFunction(H.map.AbstractMarker);\n\nconst groupFilterFunction = typeFilterFunction(H.map.Group);\n\nconst polylineFilterFunction = typeFilterFunction(H.map.Polyline);\n\nconst getPosition = (marker: H.map.AbstractMarker) => marker.getGeometry();\n\nexport type MapUtils = {\n getCenter: () => Position;\n setCenter: (position: Position, animate: boolean) => void;\n getZoom: () => number;\n getPreciseZoom: () => number;\n setZoom: (zoom: number, zoomAnimation: boolean) => void;\n getViewPort: () => {\n width: number;\n height: number;\n margin: number;\n padding: {\n top: number;\n right: number;\n bottom: number;\n left: number;\n };\n center: {\n x: number;\n y: number;\n };\n };\n getBounds: () => MapBoundingBox;\n getObjects: () => H.map.Object[];\n getLayers: () => H.map.DataModel[];\n getBaseLayer: () => H.map.layer.Layer;\n getGroups: () => H.map.Group[];\n getMarkers: () => H.map.Marker[];\n getRoutePolylines: () => H.map.Polyline[];\n getPosition: typeof getPosition;\n calculateBoundingBox: typeof calculateBoundingBox;\n isValidBoundingBox: typeof isValidBoundingBox;\n parsePositionFromString: typeof parsePositionFromString;\n};\n\nexport const createUtils = (mapApi: H.Map) => {\n return {\n getCenter: () => {\n const center = mapApi.getCenter();\n return {\n lat: center.lat,\n lng: center.lng,\n };\n },\n setCenter: (position: Position, animate: boolean) => {\n mapApi.getViewModel().setLookAtData({ position }, animate);\n },\n getPreciseZoom: () => {\n const { zoom } = mapApi.getViewModel().getLookAtData();\n return zoom === undefined ? 0 : zoom;\n },\n getZoom: () => {\n const { zoom } = mapApi.getViewModel().getLookAtData();\n return Math.round(zoom === undefined ? 0 : zoom);\n },\n setZoom: (zoom: number, zoomAnimation = false) => {\n mapApi.getViewModel().setLookAtData({ zoom }, zoomAnimation);\n },\n getViewPort: () => {\n const viewPort = mapApi.getViewPort();\n return {\n width: viewPort.width,\n height: viewPort.height,\n margin: viewPort.margin,\n padding: {\n top: viewPort.padding.top,\n right: viewPort.padding.right,\n bottom: viewPort.padding.bottom,\n left: viewPort.padding.left,\n },\n center: {\n x: viewPort.center.x,\n y: viewPort.center.y,\n },\n };\n },\n\n getBounds: () => {\n const { bounds } = mapApi.getViewModel().getLookAtData();\n\n // HERE Maps API for JavaScript 3.1\n const boundingBox = bounds?.getBoundingBox();\n return {\n topLeft: {\n lng: boundingBox?.getTopLeft().lng,\n lat: boundingBox?.getTopLeft().lat,\n },\n bottomRight: {\n lng: boundingBox?.getBottomRight().lng,\n lat: boundingBox?.getBottomRight().lat,\n },\n };\n },\n getObjects: () => mapApi.getObjects(),\n getLayers: () => mapApi.getLayers().asArray(),\n getBaseLayer: () => mapApi.getBaseLayer(),\n getGroups: () => mapApi.getObjects().filter(groupFilterFunction) as H.map.Group[],\n getMarkers: () => mapApi.getObjects().filter(markerFilterFunction) as H.map.Marker[],\n\n getRoutePolylines: () => {\n const groups = mapApi.getObjects().filter(groupFilterFunction) as H.map.Group[];\n const groupObjects = groups.flatMap(group => group.getObjects());\n const filteredPolylines = groupObjects.filter(polylineFilterFunction) as H.map.Polyline[];\n return filteredPolylines;\n },\n\n getPosition,\n calculateBoundingBox,\n isValidBoundingBox,\n parsePositionFromString,\n };\n};\n"],"names":["getMapBounds","boundingBox","top","left","bottom","right","typeFilterFunction","hereType","obj","markerFilterFunction","groupFilterFunction","polylineFilterFunction","getPosition","marker","createUtils","mapApi","center","position","animate","zoom","zoomAnimation","viewPort","bounds","group","calculateBoundingBox","isValidBoundingBox","parsePositionFromString"],"mappings":";AAIO,MAAMA,IAAe,CAACC,MAA6B;AACtD,QAAM,EAAE,KAAAC,GAAK,MAAAC,GAAM,QAAAC,GAAQ,OAAAC,MAAUJ;AACrC,SAAO,IAAI,EAAE,IAAI,KAAKC,GAAKC,GAAMC,GAAQC,CAAK;AAClD,GAEMC,IAAqB,CAACC,MAA8D,CAACC,MACvFA,aAAeD,GAEbE,IAAuBH,EAAmB,EAAE,IAAI,cAAc,GAE9DI,IAAsBJ,EAAmB,EAAE,IAAI,KAAK,GAEpDK,IAAyBL,EAAmB,EAAE,IAAI,QAAQ,GAE1DM,IAAc,CAACC,MAAiCA,EAAO,YAAA,GAoChDC,IAAc,CAACC,OACjB;AAAA,EACH,WAAW,MAAM;AACb,UAAMC,IAASD,EAAO,UAAA;AACtB,WAAO;AAAA,MACH,KAAKC,EAAO;AAAA,MACZ,KAAKA,EAAO;AAAA,IAAA;AAAA,EAEpB;AAAA,EACA,WAAW,CAACC,GAAoBC,MAAqB;AACjD,IAAAH,EAAO,eAAe,cAAc,EAAE,UAAAE,EAAA,GAAYC,CAAO;AAAA,EAC7D;AAAA,EACA,gBAAgB,MAAM;AAClB,UAAM,EAAE,MAAAC,EAAA,IAASJ,EAAO,aAAA,EAAe,cAAA;AACvC,WAAOI,MAAS,SAAY,IAAIA;AAAA,EACpC;AAAA,EACA,SAAS,MAAM;AACX,UAAM,EAAE,MAAAA,EAAA,IAASJ,EAAO,aAAA,EAAe,cAAA;AACvC,WAAO,KAAK,MAAMI,MAAS,SAAY,IAAIA,CAAI;AAAA,EACnD;AAAA,EACA,SAAS,CAACA,GAAcC,IAAgB,OAAU;AAC9C,IAAAL,EAAO,eAAe,cAAc,EAAE,MAAAI,EAAA,GAAQC,CAAa;AAAA,EAC/D;AAAA,EACA,aAAa,MAAM;AACf,UAAMC,IAAWN,EAAO,YAAA;AACxB,WAAO;AAAA,MACH,OAAOM,EAAS;AAAA,MAChB,QAAQA,EAAS;AAAA,MACjB,QAAQA,EAAS;AAAA,MACjB,SAAS;AAAA,QACL,KAAKA,EAAS,QAAQ;AAAA,QACtB,OAAOA,EAAS,QAAQ;AAAA,QACxB,QAAQA,EAAS,QAAQ;AAAA,QACzB,MAAMA,EAAS,QAAQ;AAAA,MAAA;AAAA,MAE3B,QAAQ;AAAA,QACJ,GAAGA,EAAS,OAAO;AAAA,QACnB,GAAGA,EAAS,OAAO;AAAA,MAAA;AAAA,IACvB;AAAA,EAER;AAAA,EAEA,WAAW,MAAM;AACb,UAAM,EAAE,QAAAC,EAAA,IAAWP,EAAO,aAAA,EAAe,cAAA,GAGnCd,IAAcqB,GAAQ,eAAA;AAC5B,WAAO;AAAA,MACH,SAAS;AAAA,QACL,KAAKrB,GAAa,WAAA,EAAa;AAAA,QAC/B,KAAKA,GAAa,aAAa;AAAA,MAAA;AAAA,MAEnC,aAAa;AAAA,QACT,KAAKA,GAAa,eAAA,EAAiB;AAAA,QACnC,KAAKA,GAAa,iBAAiB;AAAA,MAAA;AAAA,IACvC;AAAA,EAER;AAAA,EACA,YAAY,MAAMc,EAAO,WAAA;AAAA,EACzB,WAAW,MAAMA,EAAO,UAAA,EAAY,QAAA;AAAA,EACpC,cAAc,MAAMA,EAAO,aAAA;AAAA,EAC3B,WAAW,MAAMA,EAAO,WAAA,EAAa,OAAOL,CAAmB;AAAA,EAC/D,YAAY,MAAMK,EAAO,WAAA,EAAa,OAAON,CAAoB;AAAA,EAEjE,mBAAmB,MACAM,EAAO,WAAA,EAAa,OAAOL,CAAmB,EACjC,QAAQ,CAAAa,MAASA,EAAM,YAAY,EACxB,OAAOZ,CAAsB;AAAA,EAIxE,aAAAC;AAAA,EACA,sBAAAY;AAAA,EACA,oBAAAC;AAAA,EACA,yBAAAC;AAAA;"}
|
|
@@ -25,6 +25,8 @@ export type ClusterMapMarkerProps = {
|
|
|
25
25
|
/**
|
|
26
26
|
* Defines if marker is clickable or not.
|
|
27
27
|
*
|
|
28
|
+
* Set this to `false` for large passive marker sets to avoid unnecessary DOM hit-testing during pan and zoom.
|
|
29
|
+
*
|
|
28
30
|
* @default true
|
|
29
31
|
*/
|
|
30
32
|
clickable?: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ClusterMapMarker.js","sources":["../../../src/components/mapMarker/ClusterMapMarker.tsx"],"sourcesContent":["import classNames from '../../utils/classNames';\nimport { markerColorMapping, type MarkerColor } from '../map/utils/mapTypes';\n\nexport type ClusterMapMarkerProps = {\n /**\n * Number displayed in the center.\n */\n count?: number;\n\n /**\n * Displayed in the orange badge if more than 0.\n *\n * @default 0\n */\n warningCount?: number;\n\n /**\n * Displayed in the red badge if more than 0.\n *\n * @default 0\n */\n exceptionCount?: number;\n\n /**\n * Defines if marker is selected or not.\n *\n * @default false\n */\n active?: boolean;\n\n /**\n * Defines if marker is clickable or not.\n *\n * @default true\n */\n clickable?: boolean;\n\n /**\n * Defines the color of the marker.\n *\n * Possible values are:\n * - `bg-map-marker-asset`\n * - `bg-map-marker-poi`\n * - `bg-map-marker-geofence`\n * - `bg-map-marker-route`\n * - `bg-map-marker-info`\n * - `bg-map-marker-success`\n * - `bg-map-marker-warning`\n * - `bg-map-marker-danger`\n *\n * @default 'bg-map-marker-asset'\n */\n markerColor?: MarkerColor;\n\n /**\n * Name of a rioglyph icon.\n */\n iconName?: string;\n\n /**\n * Marker cursor\n */\n cursor?: 'cursor-pointer' | 'cursor-grab' | 'cursor-not-allowed';\n};\n\nconst ClusterMapMarker = (props: ClusterMapMarkerProps) => {\n const {\n count,\n exceptionCount = 0,\n markerColor = 'bg-map-marker-asset',\n warningCount = 0,\n active = false,\n clickable = true,\n iconName,\n cursor = 'cursor-pointer',\n } = props;\n\n const clusterClasses = classNames('rio-map-cluster-circle', active && 'active', cursor);\n const classes = classNames(\n active && 'active',\n 'rio-map-marker',\n 'rio-map-marker-center-center',\n !clickable && 'not-clickable'\n );\n\n const markerBackgroundColor = `var(${markerColorMapping[markerColor]})`;\n\n return (\n <div\n className={classes}\n style={{ color: markerBackgroundColor }}\n data-marker-type={markerColor.replace('bg-', 'cluster-')}\n >\n <div className='rio-map-marker-translate'>\n <div className='rio-map-cluster'>\n <div className={clusterClasses}>\n <div className='rio-map-cluster-content'>\n {iconName && (\n <span className='rio-map-icon'>\n <span className={`rioglyph rioglyph-${iconName}`} />\n </span>\n )}\n <div className='rio-map-count'>{count}</div>\n </div>\n </div>\n {exceptionCount > 0 && <div className='rio-map-bubble exception'>{exceptionCount}</div>}\n {warningCount > 0 && <div className='rio-map-bubble warning'>{warningCount}</div>}\n </div>\n </div>\n </div>\n );\n};\n\nexport default ClusterMapMarker;\n"],"names":["ClusterMapMarker","props","count","exceptionCount","markerColor","warningCount","active","clickable","iconName","cursor","clusterClasses","classNames","classes","markerBackgroundColor","markerColorMapping","jsx","jsxs"],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"ClusterMapMarker.js","sources":["../../../src/components/mapMarker/ClusterMapMarker.tsx"],"sourcesContent":["import classNames from '../../utils/classNames';\nimport { markerColorMapping, type MarkerColor } from '../map/utils/mapTypes';\n\nexport type ClusterMapMarkerProps = {\n /**\n * Number displayed in the center.\n */\n count?: number;\n\n /**\n * Displayed in the orange badge if more than 0.\n *\n * @default 0\n */\n warningCount?: number;\n\n /**\n * Displayed in the red badge if more than 0.\n *\n * @default 0\n */\n exceptionCount?: number;\n\n /**\n * Defines if marker is selected or not.\n *\n * @default false\n */\n active?: boolean;\n\n /**\n * Defines if marker is clickable or not.\n *\n * Set this to `false` for large passive marker sets to avoid unnecessary DOM hit-testing during pan and zoom.\n *\n * @default true\n */\n clickable?: boolean;\n\n /**\n * Defines the color of the marker.\n *\n * Possible values are:\n * - `bg-map-marker-asset`\n * - `bg-map-marker-poi`\n * - `bg-map-marker-geofence`\n * - `bg-map-marker-route`\n * - `bg-map-marker-info`\n * - `bg-map-marker-success`\n * - `bg-map-marker-warning`\n * - `bg-map-marker-danger`\n *\n * @default 'bg-map-marker-asset'\n */\n markerColor?: MarkerColor;\n\n /**\n * Name of a rioglyph icon.\n */\n iconName?: string;\n\n /**\n * Marker cursor\n */\n cursor?: 'cursor-pointer' | 'cursor-grab' | 'cursor-not-allowed';\n};\n\nconst ClusterMapMarker = (props: ClusterMapMarkerProps) => {\n const {\n count,\n exceptionCount = 0,\n markerColor = 'bg-map-marker-asset',\n warningCount = 0,\n active = false,\n clickable = true,\n iconName,\n cursor = 'cursor-pointer',\n } = props;\n\n const clusterClasses = classNames('rio-map-cluster-circle', active && 'active', cursor);\n const classes = classNames(\n active && 'active',\n 'rio-map-marker',\n 'rio-map-marker-center-center',\n !clickable && 'not-clickable'\n );\n\n const markerBackgroundColor = `var(${markerColorMapping[markerColor]})`;\n\n return (\n <div\n className={classes}\n style={{ color: markerBackgroundColor }}\n data-marker-type={markerColor.replace('bg-', 'cluster-')}\n >\n <div className='rio-map-marker-translate'>\n <div className='rio-map-cluster'>\n <div className={clusterClasses}>\n <div className='rio-map-cluster-content'>\n {iconName && (\n <span className='rio-map-icon'>\n <span className={`rioglyph rioglyph-${iconName}`} />\n </span>\n )}\n <div className='rio-map-count'>{count}</div>\n </div>\n </div>\n {exceptionCount > 0 && <div className='rio-map-bubble exception'>{exceptionCount}</div>}\n {warningCount > 0 && <div className='rio-map-bubble warning'>{warningCount}</div>}\n </div>\n </div>\n </div>\n );\n};\n\nexport default ClusterMapMarker;\n"],"names":["ClusterMapMarker","props","count","exceptionCount","markerColor","warningCount","active","clickable","iconName","cursor","clusterClasses","classNames","classes","markerBackgroundColor","markerColorMapping","jsx","jsxs"],"mappings":";;;AAmEA,MAAMA,IAAmB,CAACC,MAAiC;AACvD,QAAM;AAAA,IACF,OAAAC;AAAA,IACA,gBAAAC,IAAiB;AAAA,IACjB,aAAAC,IAAc;AAAA,IACd,cAAAC,IAAe;AAAA,IACf,QAAAC,IAAS;AAAA,IACT,WAAAC,IAAY;AAAA,IACZ,UAAAC;AAAA,IACA,QAAAC,IAAS;AAAA,EAAA,IACTR,GAEES,IAAiBC,EAAW,0BAA0BL,KAAU,UAAUG,CAAM,GAChFG,IAAUD;AAAA,IACZL,KAAU;AAAA,IACV;AAAA,IACA;AAAA,IACA,CAACC,KAAa;AAAA,EAAA,GAGZM,IAAwB,OAAOC,EAAmBV,CAAW,CAAC;AAEpE,SACI,gBAAAW;AAAA,IAAC;AAAA,IAAA;AAAA,MACG,WAAWH;AAAA,MACX,OAAO,EAAE,OAAOC,EAAA;AAAA,MAChB,oBAAkBT,EAAY,QAAQ,OAAO,UAAU;AAAA,MAEvD,4BAAC,OAAA,EAAI,WAAU,4BACX,UAAA,gBAAAY,EAAC,OAAA,EAAI,WAAU,mBACX,UAAA;AAAA,QAAA,gBAAAD,EAAC,SAAI,WAAWL,GACZ,UAAA,gBAAAM,EAAC,OAAA,EAAI,WAAU,2BACV,UAAA;AAAA,UAAAR,KACG,gBAAAO,EAAC,QAAA,EAAK,WAAU,gBACZ,UAAA,gBAAAA,EAAC,UAAK,WAAW,qBAAqBP,CAAQ,GAAA,CAAI,GACtD;AAAA,UAEJ,gBAAAO,EAAC,OAAA,EAAI,WAAU,iBAAiB,UAAAb,EAAA,CAAM;AAAA,QAAA,EAAA,CAC1C,EAAA,CACJ;AAAA,QACCC,IAAiB,KAAK,gBAAAY,EAAC,OAAA,EAAI,WAAU,4BAA4B,UAAAZ,GAAe;AAAA,QAChFE,IAAe,KAAK,gBAAAU,EAAC,OAAA,EAAI,WAAU,0BAA0B,UAAAV,EAAA,CAAa;AAAA,MAAA,EAAA,CAC/E,EAAA,CACJ;AAAA,IAAA;AAAA,EAAA;AAGZ;"}
|
|
@@ -32,6 +32,8 @@ export type SingleMapMarkerProps = ComponentProps<'div'> & {
|
|
|
32
32
|
/**
|
|
33
33
|
* Defines if marker is clickable or not.
|
|
34
34
|
*
|
|
35
|
+
* Set this to `false` for large passive marker sets to avoid unnecessary DOM hit-testing during pan and zoom.
|
|
36
|
+
*
|
|
35
37
|
* @default true
|
|
36
38
|
*/
|
|
37
39
|
clickable?: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SingleMapMarker.js","sources":["../../../src/components/mapMarker/SingleMapMarker.tsx"],"sourcesContent":["import type { ComponentProps, ReactNode } from 'react';\n\nimport classNames from '../../utils/classNames';\nimport { markerColorMapping, type MarkerColor } from '../map/utils/mapTypes';\n\nconst DEFAULT_BEARING = 60;\n\nconst MapStateIndicator = (props: { moving: boolean; bearing: number; stateIconName?: string }) => {\n const { moving, bearing, stateIconName } = props;\n\n if (!moving && !stateIconName) {\n return null;\n }\n\n const iconClassName = classNames('rioglyph', `rioglyph-${stateIconName || 'direction'}`);\n\n const style = stateIconName ? {} : { transform: `rotate(${bearing}deg)` };\n\n return (\n <div className={`rio-map-icon rio-map-marker-state ${stateIconName ? '' : 'rio-map-direction'}`}>\n <span className={iconClassName} style={style} />\n </div>\n );\n};\n\nconst getIcons = (iconNames: string[] = []) =>\n iconNames.map((name, index) => (\n <div key={`rio-map-icon-${name}-${index}`} className='rio-map-icon'>\n <span className={`rioglyph rioglyph-${name}`} />\n </div>\n ));\n\nexport type SingleMapMarkerProps = ComponentProps<'div'> & {\n /**\n * Defines the rotation of the arrow in deg.\n *\n * @default 60\n */\n bearing?: number;\n\n /**\n * Text for the marker.\n */\n name?: string | ReactNode;\n\n /**\n * Displayed in the orange badge if more than 0.\n *\n * @default 0\n */\n warningCount?: number;\n\n /**\n * Displayed in the red badge if more than 0.\n *\n * @default 0\n */\n exceptionCount?: number;\n\n /**\n * Defines if marker is selected.\n *\n * @default false\n */\n active?: boolean;\n\n /**\n * Defines if marker is clickable or not.\n *\n * @default true\n */\n clickable?: boolean;\n\n /**\n * Defines if marker is fixed and has no centering point.\n *\n * @default false\n */\n fixed?: boolean;\n\n /**\n * Defines whether the direction icon is displayed or not.\n *\n * @default false\n */\n moving?: boolean;\n\n /**\n * Optional icon that is shown in the state indicator and used instead of the moving direction arrow.\n */\n stateIconName?: string;\n\n /**\n * Defines if marker is displayed with pinging animation.\n *\n * @default false\n */\n pinging?: boolean;\n\n /**\n * List of rioglyph icon names.\n */\n iconNames?: string[];\n\n /**\n * Defines the color of the marker.\n *\n * Possible values are:\n * - `bg-map-marker-asset`\n * - `bg-map-marker-poi`\n * - `bg-map-marker-geofence`\n * - `bg-map-marker-route`\n * - `bg-map-marker-info`\n * - `bg-map-marker-success`\n * - `bg-map-marker-warning`\n * - `bg-map-marker-danger`\n * - `bg-map-marker-restrictions`\n *\n * @default 'bg-map-marker-asset'\n */\n markerColor?: MarkerColor;\n\n /**\n * Can be used to add a text-color class to the marker div.\n */\n textColor?: string;\n\n /**\n * Used to control the marker's anchor size.\n *\n * Possible values are:\n * - `md`\n * - `lg`\n *\n * @default 'md'\n */\n anchorSize?: 'md' | 'lg';\n\n /**\n * Whether the marker is only visible on hover.\n *\n * @default false\n */\n markerOnHover?: boolean;\n\n /**\n * Optional icon that is shown on the anchor of the DOM marker.\n * Use this when no marker content is shown.\n */\n anchorIconName?: string;\n\n /**\n * Shows only the anchor without the rest of the marker.\n */\n anchorOnly?: boolean;\n\n /**\n * Marker cursor\n */\n cursor?: 'cursor-pointer' | 'cursor-grab' | 'cursor-not-allowed';\n};\n\nconst SingleMapMarker = (props: SingleMapMarkerProps) => {\n const {\n bearing = DEFAULT_BEARING,\n name,\n warningCount = 0,\n exceptionCount = 0,\n active = false,\n clickable = true,\n fixed = false,\n moving = false,\n pinging = false,\n anchorIconName,\n stateIconName,\n iconNames,\n markerColor = 'bg-map-marker-asset',\n textColor,\n anchorSize,\n markerOnHover = false,\n anchorOnly = !name && !iconNames,\n cursor = 'cursor-pointer',\n className,\n style,\n } = props;\n\n const largeAnchor = anchorSize === 'lg';\n\n const classes = classNames(\n active && 'active',\n 'rio-map-marker',\n 'rio-map-marker-bottom-center',\n !clickable && 'not-clickable',\n className\n );\n\n const anchorClasses = classNames('rio-map-anchor', largeAnchor ? 'rio-map-anchor-lg' : '', cursor);\n\n const singleClasses = classNames(\n 'rio-map-single',\n fixed && 'fixed',\n moving && 'moving',\n textColor,\n markerOnHover && 'visible-on-hover',\n active && 'active',\n pinging && 'pinging',\n typeof name === 'string' && name.length === 1 && 'single-letter',\n cursor\n );\n\n const markerBackgroundColor = `var(${markerColorMapping[markerColor]})`;\n\n return (\n <div\n className={classes}\n style={{ ...style, color: markerBackgroundColor }}\n data-marker-type={markerColor.replace('bg-', 'single-')}\n >\n <div className='rio-map-marker-translate'>\n {!anchorOnly && (\n <>\n <div className={singleClasses}>\n <MapStateIndicator moving={moving} bearing={bearing} stateIconName={stateIconName} />\n {getIcons(iconNames)}\n {name && <div className='rio-map-name'>{name}</div>}\n {exceptionCount > 0 && <div className='rio-map-bubble exception'>{exceptionCount}</div>}\n {warningCount > 0 && <div className='rio-map-bubble warning'>{warningCount}</div>}\n </div>\n <div className='rio-map-anchor-arrow' />\n </>\n )}\n <div className={anchorClasses}>\n {anchorIconName && largeAnchor && <span className={`rioglyph rioglyph-${anchorIconName}`} />}\n </div>\n </div>\n </div>\n );\n};\n\nexport default SingleMapMarker;\n"],"names":["DEFAULT_BEARING","MapStateIndicator","props","moving","bearing","stateIconName","iconClassName","classNames","style","jsx","getIcons","iconNames","name","index","SingleMapMarker","warningCount","exceptionCount","active","clickable","fixed","pinging","anchorIconName","markerColor","textColor","anchorSize","markerOnHover","anchorOnly","cursor","className","largeAnchor","classes","anchorClasses","singleClasses","markerBackgroundColor","markerColorMapping","jsxs","Fragment"],"mappings":";;;AAKA,MAAMA,IAAkB,IAElBC,IAAoB,CAACC,MAAwE;AAC/F,QAAM,EAAE,QAAAC,GAAQ,SAAAC,GAAS,eAAAC,EAAA,IAAkBH;AAE3C,MAAI,CAACC,KAAU,CAACE;AACZ,WAAO;AAGX,QAAMC,IAAgBC,EAAW,YAAY,YAAYF,KAAiB,WAAW,EAAE,GAEjFG,IAAQH,IAAgB,KAAK,EAAE,WAAW,UAAUD,CAAO,OAAA;AAEjE,SACI,gBAAAK,EAAC,OAAA,EAAI,WAAW,qCAAqCJ,IAAgB,KAAK,mBAAmB,IACzF,UAAA,gBAAAI,EAAC,QAAA,EAAK,WAAWH,GAAe,OAAAE,GAAc,GAClD;AAER,GAEME,IAAW,CAACC,IAAsB,OACpCA,EAAU,IAAI,CAACC,GAAMC,MACjB,gBAAAJ,EAAC,OAAA,EAA0C,WAAU,gBACjD,UAAA,gBAAAA,EAAC,QAAA,EAAK,WAAW,qBAAqBG,CAAI,GAAA,CAAI,KADxC,gBAAgBA,CAAI,IAAIC,CAAK,EAEvC,CACH,
|
|
1
|
+
{"version":3,"file":"SingleMapMarker.js","sources":["../../../src/components/mapMarker/SingleMapMarker.tsx"],"sourcesContent":["import type { ComponentProps, ReactNode } from 'react';\n\nimport classNames from '../../utils/classNames';\nimport { markerColorMapping, type MarkerColor } from '../map/utils/mapTypes';\n\nconst DEFAULT_BEARING = 60;\n\nconst MapStateIndicator = (props: { moving: boolean; bearing: number; stateIconName?: string }) => {\n const { moving, bearing, stateIconName } = props;\n\n if (!moving && !stateIconName) {\n return null;\n }\n\n const iconClassName = classNames('rioglyph', `rioglyph-${stateIconName || 'direction'}`);\n\n const style = stateIconName ? {} : { transform: `rotate(${bearing}deg)` };\n\n return (\n <div className={`rio-map-icon rio-map-marker-state ${stateIconName ? '' : 'rio-map-direction'}`}>\n <span className={iconClassName} style={style} />\n </div>\n );\n};\n\nconst getIcons = (iconNames: string[] = []) =>\n iconNames.map((name, index) => (\n <div key={`rio-map-icon-${name}-${index}`} className='rio-map-icon'>\n <span className={`rioglyph rioglyph-${name}`} />\n </div>\n ));\n\nexport type SingleMapMarkerProps = ComponentProps<'div'> & {\n /**\n * Defines the rotation of the arrow in deg.\n *\n * @default 60\n */\n bearing?: number;\n\n /**\n * Text for the marker.\n */\n name?: string | ReactNode;\n\n /**\n * Displayed in the orange badge if more than 0.\n *\n * @default 0\n */\n warningCount?: number;\n\n /**\n * Displayed in the red badge if more than 0.\n *\n * @default 0\n */\n exceptionCount?: number;\n\n /**\n * Defines if marker is selected.\n *\n * @default false\n */\n active?: boolean;\n\n /**\n * Defines if marker is clickable or not.\n *\n * Set this to `false` for large passive marker sets to avoid unnecessary DOM hit-testing during pan and zoom.\n *\n * @default true\n */\n clickable?: boolean;\n\n /**\n * Defines if marker is fixed and has no centering point.\n *\n * @default false\n */\n fixed?: boolean;\n\n /**\n * Defines whether the direction icon is displayed or not.\n *\n * @default false\n */\n moving?: boolean;\n\n /**\n * Optional icon that is shown in the state indicator and used instead of the moving direction arrow.\n */\n stateIconName?: string;\n\n /**\n * Defines if marker is displayed with pinging animation.\n *\n * @default false\n */\n pinging?: boolean;\n\n /**\n * List of rioglyph icon names.\n */\n iconNames?: string[];\n\n /**\n * Defines the color of the marker.\n *\n * Possible values are:\n * - `bg-map-marker-asset`\n * - `bg-map-marker-poi`\n * - `bg-map-marker-geofence`\n * - `bg-map-marker-route`\n * - `bg-map-marker-info`\n * - `bg-map-marker-success`\n * - `bg-map-marker-warning`\n * - `bg-map-marker-danger`\n * - `bg-map-marker-restrictions`\n *\n * @default 'bg-map-marker-asset'\n */\n markerColor?: MarkerColor;\n\n /**\n * Can be used to add a text-color class to the marker div.\n */\n textColor?: string;\n\n /**\n * Used to control the marker's anchor size.\n *\n * Possible values are:\n * - `md`\n * - `lg`\n *\n * @default 'md'\n */\n anchorSize?: 'md' | 'lg';\n\n /**\n * Whether the marker is only visible on hover.\n *\n * @default false\n */\n markerOnHover?: boolean;\n\n /**\n * Optional icon that is shown on the anchor of the DOM marker.\n * Use this when no marker content is shown.\n */\n anchorIconName?: string;\n\n /**\n * Shows only the anchor without the rest of the marker.\n */\n anchorOnly?: boolean;\n\n /**\n * Marker cursor\n */\n cursor?: 'cursor-pointer' | 'cursor-grab' | 'cursor-not-allowed';\n};\n\nconst SingleMapMarker = (props: SingleMapMarkerProps) => {\n const {\n bearing = DEFAULT_BEARING,\n name,\n warningCount = 0,\n exceptionCount = 0,\n active = false,\n clickable = true,\n fixed = false,\n moving = false,\n pinging = false,\n anchorIconName,\n stateIconName,\n iconNames,\n markerColor = 'bg-map-marker-asset',\n textColor,\n anchorSize,\n markerOnHover = false,\n anchorOnly = !name && !iconNames,\n cursor = 'cursor-pointer',\n className,\n style,\n } = props;\n\n const largeAnchor = anchorSize === 'lg';\n\n const classes = classNames(\n active && 'active',\n 'rio-map-marker',\n 'rio-map-marker-bottom-center',\n !clickable && 'not-clickable',\n className\n );\n\n const anchorClasses = classNames('rio-map-anchor', largeAnchor ? 'rio-map-anchor-lg' : '', cursor);\n\n const singleClasses = classNames(\n 'rio-map-single',\n fixed && 'fixed',\n moving && 'moving',\n textColor,\n markerOnHover && 'visible-on-hover',\n active && 'active',\n pinging && 'pinging',\n typeof name === 'string' && name.length === 1 && 'single-letter',\n cursor\n );\n\n const markerBackgroundColor = `var(${markerColorMapping[markerColor]})`;\n\n return (\n <div\n className={classes}\n style={{ ...style, color: markerBackgroundColor }}\n data-marker-type={markerColor.replace('bg-', 'single-')}\n >\n <div className='rio-map-marker-translate'>\n {!anchorOnly && (\n <>\n <div className={singleClasses}>\n <MapStateIndicator moving={moving} bearing={bearing} stateIconName={stateIconName} />\n {getIcons(iconNames)}\n {name && <div className='rio-map-name'>{name}</div>}\n {exceptionCount > 0 && <div className='rio-map-bubble exception'>{exceptionCount}</div>}\n {warningCount > 0 && <div className='rio-map-bubble warning'>{warningCount}</div>}\n </div>\n <div className='rio-map-anchor-arrow' />\n </>\n )}\n <div className={anchorClasses}>\n {anchorIconName && largeAnchor && <span className={`rioglyph rioglyph-${anchorIconName}`} />}\n </div>\n </div>\n </div>\n );\n};\n\nexport default SingleMapMarker;\n"],"names":["DEFAULT_BEARING","MapStateIndicator","props","moving","bearing","stateIconName","iconClassName","classNames","style","jsx","getIcons","iconNames","name","index","SingleMapMarker","warningCount","exceptionCount","active","clickable","fixed","pinging","anchorIconName","markerColor","textColor","anchorSize","markerOnHover","anchorOnly","cursor","className","largeAnchor","classes","anchorClasses","singleClasses","markerBackgroundColor","markerColorMapping","jsxs","Fragment"],"mappings":";;;AAKA,MAAMA,IAAkB,IAElBC,IAAoB,CAACC,MAAwE;AAC/F,QAAM,EAAE,QAAAC,GAAQ,SAAAC,GAAS,eAAAC,EAAA,IAAkBH;AAE3C,MAAI,CAACC,KAAU,CAACE;AACZ,WAAO;AAGX,QAAMC,IAAgBC,EAAW,YAAY,YAAYF,KAAiB,WAAW,EAAE,GAEjFG,IAAQH,IAAgB,KAAK,EAAE,WAAW,UAAUD,CAAO,OAAA;AAEjE,SACI,gBAAAK,EAAC,OAAA,EAAI,WAAW,qCAAqCJ,IAAgB,KAAK,mBAAmB,IACzF,UAAA,gBAAAI,EAAC,QAAA,EAAK,WAAWH,GAAe,OAAAE,GAAc,GAClD;AAER,GAEME,IAAW,CAACC,IAAsB,OACpCA,EAAU,IAAI,CAACC,GAAMC,MACjB,gBAAAJ,EAAC,OAAA,EAA0C,WAAU,gBACjD,UAAA,gBAAAA,EAAC,QAAA,EAAK,WAAW,qBAAqBG,CAAI,GAAA,CAAI,KADxC,gBAAgBA,CAAI,IAAIC,CAAK,EAEvC,CACH,GAsICC,IAAkB,CAACZ,MAAgC;AACrD,QAAM;AAAA,IACF,SAAAE,IAAUJ;AAAA,IACV,MAAAY;AAAA,IACA,cAAAG,IAAe;AAAA,IACf,gBAAAC,IAAiB;AAAA,IACjB,QAAAC,IAAS;AAAA,IACT,WAAAC,IAAY;AAAA,IACZ,OAAAC,IAAQ;AAAA,IACR,QAAAhB,IAAS;AAAA,IACT,SAAAiB,IAAU;AAAA,IACV,gBAAAC;AAAA,IACA,eAAAhB;AAAA,IACA,WAAAM;AAAA,IACA,aAAAW,IAAc;AAAA,IACd,WAAAC;AAAA,IACA,YAAAC;AAAA,IACA,eAAAC,IAAgB;AAAA,IAChB,YAAAC,IAAa,CAACd,KAAQ,CAACD;AAAA,IACvB,QAAAgB,IAAS;AAAA,IACT,WAAAC;AAAA,IACA,OAAApB;AAAA,EAAA,IACAN,GAEE2B,IAAcL,MAAe,MAE7BM,IAAUvB;AAAA,IACZU,KAAU;AAAA,IACV;AAAA,IACA;AAAA,IACA,CAACC,KAAa;AAAA,IACdU;AAAA,EAAA,GAGEG,IAAgBxB,EAAW,kBAAkBsB,IAAc,sBAAsB,IAAIF,CAAM,GAE3FK,IAAgBzB;AAAA,IAClB;AAAA,IACAY,KAAS;AAAA,IACThB,KAAU;AAAA,IACVoB;AAAA,IACAE,KAAiB;AAAA,IACjBR,KAAU;AAAA,IACVG,KAAW;AAAA,IACX,OAAOR,KAAS,YAAYA,EAAK,WAAW,KAAK;AAAA,IACjDe;AAAA,EAAA,GAGEM,IAAwB,OAAOC,EAAmBZ,CAAW,CAAC;AAEpE,SACI,gBAAAb;AAAA,IAAC;AAAA,IAAA;AAAA,MACG,WAAWqB;AAAA,MACX,OAAO,EAAE,GAAGtB,GAAO,OAAOyB,EAAA;AAAA,MAC1B,oBAAkBX,EAAY,QAAQ,OAAO,SAAS;AAAA,MAEtD,UAAA,gBAAAa,EAAC,OAAA,EAAI,WAAU,4BACV,UAAA;AAAA,QAAA,CAACT,KACE,gBAAAS,EAAAC,GAAA,EACI,UAAA;AAAA,UAAA,gBAAAD,EAAC,OAAA,EAAI,WAAWH,GACZ,UAAA;AAAA,YAAA,gBAAAvB,EAACR,GAAA,EAAkB,QAAAE,GAAgB,SAAAC,GAAkB,eAAAC,EAAA,CAA8B;AAAA,YAClFK,EAASC,CAAS;AAAA,YAClBC,KAAQ,gBAAAH,EAAC,OAAA,EAAI,WAAU,gBAAgB,UAAAG,GAAK;AAAA,YAC5CI,IAAiB,KAAK,gBAAAP,EAAC,OAAA,EAAI,WAAU,4BAA4B,UAAAO,GAAe;AAAA,YAChFD,IAAe,KAAK,gBAAAN,EAAC,OAAA,EAAI,WAAU,0BAA0B,UAAAM,EAAA,CAAa;AAAA,UAAA,GAC/E;AAAA,UACA,gBAAAN,EAAC,OAAA,EAAI,WAAU,uBAAA,CAAuB;AAAA,QAAA,GAC1C;AAAA,QAEJ,gBAAAA,EAAC,OAAA,EAAI,WAAWsB,GACX,UAAAV,KAAkBQ,KAAe,gBAAApB,EAAC,QAAA,EAAK,WAAW,qBAAqBY,CAAc,GAAA,CAAI,EAAA,CAC9F;AAAA,MAAA,EAAA,CACJ;AAAA,IAAA;AAAA,EAAA;AAGZ;"}
|
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
import { jsx as e } from "react/jsx-runtime";
|
|
2
|
-
import { isNil as
|
|
3
|
-
import
|
|
4
|
-
const
|
|
5
|
-
const { showClear: s, selectedItem: t, onClear:
|
|
2
|
+
import { isNil as r } from "es-toolkit/predicate";
|
|
3
|
+
import c from "../../utils/classNames.js";
|
|
4
|
+
const C = (o) => {
|
|
5
|
+
const { showClear: s, selectedItem: t, onClear: n } = o, a = c(
|
|
6
6
|
"clearButton",
|
|
7
|
-
(!s ||
|
|
7
|
+
(!s || r(t)) && "hide pointer-events-none"
|
|
8
8
|
);
|
|
9
|
-
return /* @__PURE__ */ e("span", { className:
|
|
9
|
+
return /* @__PURE__ */ e("span", { className: a, onClick: (l) => {
|
|
10
|
+
l.stopPropagation(), n();
|
|
11
|
+
}, children: /* @__PURE__ */ e("span", { className: "clearButtonIcon rioglyph rioglyph-remove-sign" }) });
|
|
10
12
|
};
|
|
11
13
|
export {
|
|
12
|
-
|
|
14
|
+
C as default
|
|
13
15
|
};
|
|
14
16
|
//# sourceMappingURL=ClearButton.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ClearButton.js","sources":["../../../src/components/selects/ClearButton.tsx"],"sourcesContent":["import { isNil } from 'es-toolkit/predicate';\n\nimport classNames from '../../utils/classNames';\nimport type { SelectOption } from './Select';\n\nexport type ClearButtonProps = {\n showClear: boolean;\n selectedItem: SelectOption | null;\n onClear: () => void;\n};\n\nconst ClearButton = (props: ClearButtonProps) => {\n const { showClear, selectedItem, onClear } = props;\n\n const clearButtonClassNames = classNames(\n 'clearButton',\n (!showClear || isNil(selectedItem)) && 'hide pointer-events-none'\n );\n\n return (\n <span className={clearButtonClassNames} onClick={
|
|
1
|
+
{"version":3,"file":"ClearButton.js","sources":["../../../src/components/selects/ClearButton.tsx"],"sourcesContent":["import { isNil } from 'es-toolkit/predicate';\nimport type React from 'react';\n\nimport classNames from '../../utils/classNames';\nimport type { SelectOption } from './Select';\n\nexport type ClearButtonProps = {\n showClear: boolean;\n selectedItem: SelectOption | null;\n onClear: () => void;\n};\n\nconst ClearButton = (props: ClearButtonProps) => {\n const { showClear, selectedItem, onClear } = props;\n\n const clearButtonClassNames = classNames(\n 'clearButton',\n (!showClear || isNil(selectedItem)) && 'hide pointer-events-none'\n );\n\n const handleClick = (event: React.MouseEvent<HTMLSpanElement>) => {\n event.stopPropagation();\n onClear();\n };\n\n return (\n <span className={clearButtonClassNames} onClick={handleClick}>\n <span className='clearButtonIcon rioglyph rioglyph-remove-sign' />\n </span>\n );\n};\n\nexport default ClearButton;\n"],"names":["ClearButton","props","showClear","selectedItem","onClear","clearButtonClassNames","classNames","isNil","jsx","event"],"mappings":";;;AAYA,MAAMA,IAAc,CAACC,MAA4B;AAC7C,QAAM,EAAE,WAAAC,GAAW,cAAAC,GAAc,SAAAC,EAAA,IAAYH,GAEvCI,IAAwBC;AAAA,IAC1B;AAAA,KACC,CAACJ,KAAaK,EAAMJ,CAAY,MAAM;AAAA,EAAA;AAQ3C,SACI,gBAAAK,EAAC,QAAA,EAAK,WAAWH,GAAuB,SANxB,CAACI,MAA6C;AAC9D,IAAAA,EAAM,gBAAA,GACNL,EAAA;AAAA,EACJ,GAIQ,UAAA,gBAAAI,EAAC,QAAA,EAAK,WAAU,gDAAA,CAAgD,EAAA,CACpE;AAER;"}
|
|
@@ -2,7 +2,7 @@ import { ReactElement, ReactNode, RefAttributes } from 'react';
|
|
|
2
2
|
import { TableFooterProps } from './TableFooter';
|
|
3
3
|
import { TableHeaderProps } from './TableHeader';
|
|
4
4
|
import { TableProps, TableRowData } from './Table.types';
|
|
5
|
-
export type { TableCellOverflow, TableCellClassName, TableCardsStyleSettings, TableColumnDefinition, TableExpandedRowAnimation, TableHorizontalAlign, TableProps, TableRowAnimationProps, TableRowId, TableRowClassName, TableStickyColumns, TableSortDirection, TableVerticalAlign, TableViewType, } from './Table.types';
|
|
5
|
+
export type { TableCellOverflow, TableCellClassName, TableCardsStyleSettings, TableColumnDefinition, TableExpandedRowAnimation, TableHorizontalAlign, TableProps, TableResponsiveBreakpoint, TableRowAnimationProps, TableRowId, TableRowClassName, TableRowSelectable, TableStickyReference, TableStickyColumns, TableSortDirection, TableVerticalAlign, TableViewType, } from './Table.types';
|
|
6
6
|
export { default as useTableSelection } from './selection/useTableSelection';
|
|
7
7
|
export type { UseTableSelectionOptions, UseTableSelectionReturn } from './selection/useTableSelection';
|
|
8
8
|
export declare const TableBody: import('react').ForwardRefExoticComponent<import('./Table.types').TableHtmlAttributes & {
|
|
@@ -26,6 +26,8 @@ export declare const TableExpanderButton: (props: import('./TableExpanderButton'
|
|
|
26
26
|
export type { TableExpanderButtonProps } from './TableExpanderButton';
|
|
27
27
|
export declare const TableRow: <RowType extends TableRowData = TableRowData>(props: import('./TableRow').TableRowProps<RowType>) => import("react/jsx-runtime").JSX.Element | null;
|
|
28
28
|
export type { TableRowProps } from './TableRow';
|
|
29
|
+
export declare const TableStickyRowButton: (props: import('./TableStickyRowButton').TableStickyRowButtonProps) => import("react/jsx-runtime").JSX.Element;
|
|
30
|
+
export type { TableStickyRowButtonProps } from './TableStickyRowButton';
|
|
29
31
|
export declare const TableSpacerRow: (props: import('./TableSpacerRow').TableSpacerRowProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
30
32
|
export type { TableSpacerRowProps } from './TableSpacerRow';
|
|
31
33
|
export declare const TableExpandedRow: <RowType extends TableRowData = TableRowData>(props: import('./TableExpandedRow').TableExpandedRowProps<RowType>) => import("react/jsx-runtime").JSX.Element | null;
|