@rio-cloud/rio-uikit 1.4.1 → 1.5.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/.DS_Store +0 -0
- package/FadeExpander.d.ts +2 -0
- package/FadeExpander.js +2 -0
- package/FadeUp.d.ts +2 -0
- package/FadeUp.js +2 -0
- package/XAxis.d.ts +2 -0
- package/XAxis.js +2 -0
- package/YAxis.d.ts +2 -0
- package/YAxis.js +2 -0
- package/components/applicationLayout/ApplicationLayoutBody.d.ts +5 -0
- package/components/applicationLayout/ApplicationLayoutBody.js +10 -1
- package/components/charts/Area.d.ts +11 -3
- package/components/charts/Area.js +9 -1
- package/components/charts/AreaChart.d.ts +4 -3
- package/components/charts/AreaChart.js +9 -8
- package/components/charts/Bar.d.ts +6 -2
- package/components/charts/Bar.js +3 -4
- package/components/charts/BarChart.d.ts +2 -1
- package/components/charts/BarChart.js +8 -4
- package/components/charts/ComposedChart.d.ts +6 -5
- package/components/charts/ComposedChart.js +16 -11
- package/components/charts/Line.d.ts +11 -3
- package/components/charts/Line.js +9 -1
- package/components/charts/LineChart.d.ts +6 -4
- package/components/charts/LineChart.js +10 -9
- package/components/charts/ReferenceLine.d.ts +8 -4
- package/components/charts/ReferenceLine.js +18 -2
- package/components/charts/XAxis.d.ts +7 -0
- package/components/charts/XAxis.js +18 -0
- package/components/charts/YAxis.d.ts +5 -0
- package/components/charts/YAxis.js +2 -0
- package/components/collapse/Collapse.js +3 -2
- package/components/fade/FadeExpander.d.ts +27 -0
- package/components/fade/FadeExpander.js +41 -0
- package/components/fade/FadeUp.d.ts +27 -0
- package/components/fade/FadeUp.js +28 -0
- package/components/listMenu/ListMenu.d.ts +7 -0
- package/components/listMenu/ListMenu.js +6 -3
- package/components/map/components/features/Route.d.ts +13 -2
- package/components/map/components/features/Route.js +19 -11
- package/components/map/components/features/basics/Polygon.d.ts +1 -0
- package/components/map/components/features/basics/Polygon.js +1 -0
- package/components/map/components/features/basics/Polyline.d.ts +3 -1
- package/components/map/components/features/basics/Polyline.js +5 -16
- package/components/map/components/features/basics/polygonColors.d.ts +252 -0
- package/components/map/components/features/basics/polygonColors.js +252 -0
- package/components/map/utils/mapTypes.d.ts +1 -1
- package/components/map/utils/mapTypes.js +2 -0
- package/components/mapMarker/SingleMapMarker.d.ts +3 -2
- package/components/mapMarker/SingleMapMarker.js +3 -3
- package/components/selects/BaseSelectDropdown.d.ts +0 -1
- package/components/selects/BaseSelectDropdown.js +7 -1
- package/components/selects/Multiselect.js +1 -4
- package/components/selects/Select.d.ts +1 -1
- package/components/selects/Select.js +1 -4
- package/components/smoothScrollbars/SmoothScrollbars.js +28 -3
- package/hooks/useSorting.d.ts +29 -0
- package/hooks/useSorting.js +41 -0
- package/lib/es/FadeExpander.d.ts +2 -0
- package/lib/es/FadeExpander.js +7 -0
- package/lib/es/FadeUp.d.ts +2 -0
- package/lib/es/FadeUp.js +7 -0
- package/lib/es/XAxis.d.ts +2 -0
- package/lib/es/XAxis.js +7 -0
- package/lib/es/YAxis.d.ts +2 -0
- package/lib/es/YAxis.js +7 -0
- package/lib/es/components/applicationLayout/ApplicationLayoutBody.d.ts +5 -0
- package/lib/es/components/applicationLayout/ApplicationLayoutBody.js +10 -1
- package/lib/es/components/charts/Area.d.ts +11 -3
- package/lib/es/components/charts/Area.js +11 -1
- package/lib/es/components/charts/AreaChart.d.ts +4 -3
- package/lib/es/components/charts/AreaChart.js +8 -7
- package/lib/es/components/charts/Bar.d.ts +6 -2
- package/lib/es/components/charts/Bar.js +5 -4
- package/lib/es/components/charts/BarChart.d.ts +2 -1
- package/lib/es/components/charts/BarChart.js +7 -3
- package/lib/es/components/charts/ComposedChart.d.ts +6 -5
- package/lib/es/components/charts/ComposedChart.js +15 -10
- package/lib/es/components/charts/Line.d.ts +11 -3
- package/lib/es/components/charts/Line.js +11 -1
- package/lib/es/components/charts/LineChart.d.ts +6 -4
- package/lib/es/components/charts/LineChart.js +9 -8
- package/lib/es/components/charts/ReferenceLine.d.ts +8 -4
- package/lib/es/components/charts/ReferenceLine.js +21 -2
- package/lib/es/components/charts/XAxis.d.ts +7 -0
- package/lib/es/components/charts/XAxis.js +23 -0
- package/lib/es/components/charts/YAxis.d.ts +5 -0
- package/lib/es/components/charts/YAxis.js +4 -0
- package/lib/es/components/collapse/Collapse.js +3 -2
- package/lib/es/components/fade/FadeExpander.d.ts +27 -0
- package/lib/es/components/fade/FadeExpander.js +43 -0
- package/lib/es/components/fade/FadeUp.d.ts +27 -0
- package/lib/es/components/fade/FadeUp.js +30 -0
- package/lib/es/components/listMenu/ListMenu.d.ts +7 -0
- package/lib/es/components/listMenu/ListMenu.js +6 -3
- package/lib/es/components/map/components/features/Route.d.ts +13 -2
- package/lib/es/components/map/components/features/Route.js +20 -12
- package/lib/es/components/map/components/features/basics/Polygon.d.ts +1 -0
- package/lib/es/components/map/components/features/basics/Polygon.js +10 -0
- package/lib/es/components/map/components/features/basics/Polyline.d.ts +3 -1
- package/lib/es/components/map/components/features/basics/Polyline.js +5 -16
- package/lib/es/components/map/components/features/basics/polygonColors.d.ts +252 -0
- package/lib/es/components/map/components/features/basics/polygonColors.js +255 -0
- package/lib/es/components/map/utils/mapTypes.d.ts +1 -1
- package/lib/es/components/map/utils/mapTypes.js +2 -0
- package/lib/es/components/mapMarker/SingleMapMarker.d.ts +3 -2
- package/lib/es/components/mapMarker/SingleMapMarker.js +3 -3
- package/lib/es/components/selects/BaseSelectDropdown.d.ts +0 -1
- package/lib/es/components/selects/BaseSelectDropdown.js +6 -0
- package/lib/es/components/selects/Multiselect.js +1 -4
- package/lib/es/components/selects/Select.d.ts +1 -1
- package/lib/es/components/selects/Select.js +1 -4
- package/lib/es/components/smoothScrollbars/SmoothScrollbars.js +27 -2
- package/lib/es/hooks/useSorting.d.ts +29 -0
- package/lib/es/hooks/useSorting.js +43 -0
- package/lib/es/storageUtils.d.ts +1 -0
- package/lib/es/storageUtils.js +4 -0
- package/lib/es/styles/variables/colors/colors.json +4 -3
- package/lib/es/urlFeatureToggles.d.ts +1 -0
- package/lib/es/urlFeatureToggles.js +4 -0
- package/lib/es/useSorting.d.ts +2 -0
- package/lib/es/useSorting.js +7 -0
- package/lib/es/utils/storageUtils.d.ts +5 -0
- package/lib/es/utils/storageUtils.js +32 -0
- package/lib/es/utils/urlFeatureToggles.d.ts +10 -0
- package/lib/es/utils/urlFeatureToggles.js +41 -0
- package/lib/es/version.json +1 -1
- package/package.json +15 -4
- package/storageUtils.d.ts +1 -0
- package/storageUtils.js +1 -0
- package/styles/variables/colors/colors.json +4 -3
- package/urlFeatureToggles.d.ts +1 -0
- package/urlFeatureToggles.js +1 -0
- package/useSorting.d.ts +2 -0
- package/useSorting.js +2 -0
- package/utils/storageUtils.d.ts +5 -0
- package/utils/storageUtils.js +29 -0
- package/utils/urlFeatureToggles.d.ts +10 -0
- package/utils/urlFeatureToggles.js +32 -0
- package/version.json +1 -1
|
@@ -27,6 +27,13 @@ export type ListMenuProps<T extends ListMenuNavItem> = {
|
|
|
27
27
|
* The placeholder text for the filter input.
|
|
28
28
|
*/
|
|
29
29
|
filterPlaceholder?: string;
|
|
30
|
+
/**
|
|
31
|
+
* Gets called when the filter input changes.
|
|
32
|
+
*
|
|
33
|
+
* @param value
|
|
34
|
+
* @returns
|
|
35
|
+
*/
|
|
36
|
+
onFilterChange?: (value: string) => void;
|
|
30
37
|
/**
|
|
31
38
|
* A localized message to be shown when the filter result is empty.
|
|
32
39
|
*/
|
|
@@ -18,7 +18,7 @@ const MOBILE_MAX_WIDTH = 580;
|
|
|
18
18
|
const filterMenuItems = (items, value, filterKey) => items.map(item => (Object.assign(Object.assign({}, item), { navItems: item.navItems.filter(navItem => navItem[filterKey].toLowerCase().includes(value.toLowerCase())) })));
|
|
19
19
|
const hasMenuItems = (items) => items.find(({ navItems }) => !(0, isEmpty_1.default)(navItems));
|
|
20
20
|
const ListMenu = (props) => {
|
|
21
|
-
const { menuItems, focusFilter = false, enableFilter = false, filterPlaceholder, notFoundMessage, className = '', groupClassName = '', responsive = true, autoClose = true, filterKey = 'key', trailingInputAddon } = props, remainingProps = tslib_1.__rest(props, ["menuItems", "focusFilter", "enableFilter", "filterPlaceholder", "notFoundMessage", "className", "groupClassName", "responsive", "autoClose", "filterKey", "trailingInputAddon"]);
|
|
21
|
+
const { menuItems, focusFilter = false, enableFilter = false, filterPlaceholder, onFilterChange = () => { }, notFoundMessage, className = '', groupClassName = '', responsive = true, autoClose = true, filterKey = 'key', trailingInputAddon } = props, remainingProps = tslib_1.__rest(props, ["menuItems", "focusFilter", "enableFilter", "filterPlaceholder", "onFilterChange", "notFoundMessage", "className", "groupClassName", "responsive", "autoClose", "filterKey", "trailingInputAddon"]);
|
|
22
22
|
const [filterValue, setFilterValue] = (0, react_1.useState)('');
|
|
23
23
|
const [isMobileMode, setIsMobileMode] = (0, react_1.useState)(false);
|
|
24
24
|
const [isExpanderOpen, setIsExpanderOpen] = (0, react_1.useState)(false);
|
|
@@ -59,7 +59,10 @@ const ListMenu = (props) => {
|
|
|
59
59
|
});
|
|
60
60
|
(0, react_1.useLayoutEffect)(() => buildMobileHeader, [menuItems]);
|
|
61
61
|
const handleClear = () => focusFilter && focusInput();
|
|
62
|
-
const handleFilterChange = (value) =>
|
|
62
|
+
const handleFilterChange = (value) => {
|
|
63
|
+
setFilterValue(value);
|
|
64
|
+
onFilterChange(value);
|
|
65
|
+
};
|
|
63
66
|
const filteredMenuItems = filterMenuItems(menuItems, filterValue, filterKey);
|
|
64
67
|
const handleExpanderBodyClick = (event) => {
|
|
65
68
|
var _a;
|
|
@@ -68,7 +71,7 @@ const ListMenu = (props) => {
|
|
|
68
71
|
setIsExpanderOpen(false);
|
|
69
72
|
}
|
|
70
73
|
};
|
|
71
|
-
const formClassNames = (0, classnames_1.default)('form-group', 'margin-
|
|
74
|
+
const formClassNames = (0, classnames_1.default)('form-group', 'margin-bottom-5', 'padding-left-15', 'padding-right-15', 'padding-bottom-15', 'position-sticky', 'top-0');
|
|
72
75
|
const listMenu = ((0, jsx_runtime_1.jsxs)("div", Object.assign({}, remainingProps, { className: `ListMenu ${className}`, ref: listRef }, { children: [enableFilter && ((0, jsx_runtime_1.jsx)("div", Object.assign({ className: formClassNames }, { children: (0, jsx_runtime_1.jsxs)("div", Object.assign({ className: 'input-group width-100pct' }, { children: [(0, jsx_runtime_1.jsx)("span", Object.assign({ className: 'input-group-addon' }, { children: (0, jsx_runtime_1.jsx)("span", { className: 'rioglyph rioglyph-search', "aria-hidden": 'true' }) })), (0, jsx_runtime_1.jsx)(ClearableInput_1.default, { value: filterValue, inputRef: inputRef, placeholder: filterPlaceholder, onChange: handleFilterChange, onClear: handleClear }), trailingInputAddon && trailingInputAddon] })) }))), !hasMenuItems(filteredMenuItems) && ((0, jsx_runtime_1.jsx)("div", Object.assign({ className: 'padding-top-25 text-center text-color-gray' }, { children: notFoundMessage }))), filteredMenuItems.map(menuGroup => ((0, jsx_runtime_1.jsx)(ListMenuGroup_1.default, { className: groupClassName, menuGroup: menuGroup }, crypto.randomUUID())))] })));
|
|
73
76
|
if (responsive && isMobileMode) {
|
|
74
77
|
return ((0, jsx_runtime_1.jsx)(ExpanderPanel_1.default, Object.assign({ title: mobileHeader, bsStyle: 'default', open: isExpanderOpen, onToggle: () => setIsExpanderOpen(!isExpanderOpen), unmountOnExit: false, className: 'shadow-default' }, { children: (0, jsx_runtime_1.jsx)("div", Object.assign({ onClick: handleExpanderBodyClick }, { children: listMenu })) })));
|
|
@@ -1,10 +1,20 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
+
import { type ArrowStyle } from './basics/Polyline';
|
|
2
3
|
import type { Position } from '../../utils/mapTypes';
|
|
3
4
|
import type { EventListenerMap } from '../../utils/eventHandling';
|
|
4
5
|
export declare const MISSING_POSITIONS_EXCEPTION_MSG = "Route requires a minimum of 1 positions";
|
|
5
6
|
export declare const TO_LESS_LINE_WIDTH_EXCEPTION_MSG = "If isBorderIncludedInWidth is set to true than width has to be greater than twice of borderWidth";
|
|
7
|
+
export declare const DEFAULT_LINE_STROKE_COLOR = "rgba(48, 194, 255, 1)";
|
|
8
|
+
export declare const DEFAULT_LINE_STROKE_COLOR_REDUCED = "rgba(48, 194, 255, 0.5)";
|
|
9
|
+
export declare const DEFAULT_LINE_STROKE_COLOR_ALTERNATIVE = "rgb(200, 243, 247)";
|
|
10
|
+
export declare const DEFAULT_BORDER_STROKE_COLOR = "rgba(22, 100, 141, 1)";
|
|
11
|
+
export declare const DEFAULT_BORDER_STROKE_COLOR_REDUCED = "rgba(255, 255, 255, 0)";
|
|
12
|
+
export declare const ROUTE_COLOR_DANGER = "#e22837";
|
|
13
|
+
export declare const ROUTE_COLOR_WARNING = "#ff8e3c";
|
|
14
|
+
export declare const ROUTE_COLOR_SUCCESS = "#5cb85c";
|
|
15
|
+
export declare const ROUTE_COLOR_WHITE = "rgba(255, 255, 255, 1)";
|
|
6
16
|
export type RouteStyle = {
|
|
7
|
-
width
|
|
17
|
+
width?: number;
|
|
8
18
|
color?: string;
|
|
9
19
|
borderWidth?: number;
|
|
10
20
|
borderColor?: string;
|
|
@@ -12,7 +22,7 @@ export type RouteStyle = {
|
|
|
12
22
|
lineDash?: number[];
|
|
13
23
|
};
|
|
14
24
|
export type RouteProps = {
|
|
15
|
-
arrowStyle?:
|
|
25
|
+
arrowStyle?: ArrowStyle;
|
|
16
26
|
hasArrows?: boolean;
|
|
17
27
|
positions: Position[];
|
|
18
28
|
style?: RouteStyle;
|
|
@@ -23,6 +33,7 @@ export type RouteProps = {
|
|
|
23
33
|
middleIcon?: JSX.Element;
|
|
24
34
|
endIcon?: JSX.Element;
|
|
25
35
|
markers?: JSX.Element[];
|
|
36
|
+
customData?: object;
|
|
26
37
|
};
|
|
27
38
|
declare const Route: (props: RouteProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
28
39
|
export default Route;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.TO_LESS_LINE_WIDTH_EXCEPTION_MSG = exports.MISSING_POSITIONS_EXCEPTION_MSG = void 0;
|
|
3
|
+
exports.ROUTE_COLOR_WHITE = exports.ROUTE_COLOR_SUCCESS = exports.ROUTE_COLOR_WARNING = exports.ROUTE_COLOR_DANGER = exports.DEFAULT_BORDER_STROKE_COLOR_REDUCED = exports.DEFAULT_BORDER_STROKE_COLOR = exports.DEFAULT_LINE_STROKE_COLOR_ALTERNATIVE = exports.DEFAULT_LINE_STROKE_COLOR_REDUCED = exports.DEFAULT_LINE_STROKE_COLOR = exports.TO_LESS_LINE_WIDTH_EXCEPTION_MSG = exports.MISSING_POSITIONS_EXCEPTION_MSG = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
6
|
const react_1 = require("react");
|
|
@@ -11,21 +11,29 @@ const Marker_1 = tslib_1.__importDefault(require("./basics/Marker"));
|
|
|
11
11
|
const MapException_1 = tslib_1.__importDefault(require("../../exceptions/MapException"));
|
|
12
12
|
exports.MISSING_POSITIONS_EXCEPTION_MSG = 'Route requires a minimum of 1 positions';
|
|
13
13
|
exports.TO_LESS_LINE_WIDTH_EXCEPTION_MSG = 'If isBorderIncludedInWidth is set to true than width has to be greater than twice of borderWidth';
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
exports.DEFAULT_LINE_STROKE_COLOR = 'rgba(48, 194, 255, 1)';
|
|
15
|
+
exports.DEFAULT_LINE_STROKE_COLOR_REDUCED = 'rgba(48, 194, 255, 0.5)';
|
|
16
|
+
exports.DEFAULT_LINE_STROKE_COLOR_ALTERNATIVE = 'rgb(200, 243, 247)';
|
|
17
|
+
exports.DEFAULT_BORDER_STROKE_COLOR = 'rgba(22, 100, 141, 1)';
|
|
18
|
+
exports.DEFAULT_BORDER_STROKE_COLOR_REDUCED = 'rgba(255, 255, 255, 0)';
|
|
19
|
+
// Both works, rgb or hex - keep in mind that these state colors may change
|
|
20
|
+
// so use this constants instead of actual color values in the service
|
|
21
|
+
exports.ROUTE_COLOR_DANGER = '#e22837';
|
|
22
|
+
exports.ROUTE_COLOR_WARNING = '#ff8e3c';
|
|
23
|
+
exports.ROUTE_COLOR_SUCCESS = '#5cb85c';
|
|
24
|
+
exports.ROUTE_COLOR_WHITE = 'rgba(255, 255, 255, 1)';
|
|
17
25
|
const DEFAULT_WIDTH = 5;
|
|
18
26
|
const DEFAULT_BORDER_WIDTH = 2;
|
|
19
27
|
const defaultStyle = {
|
|
20
28
|
width: DEFAULT_WIDTH,
|
|
21
|
-
color:
|
|
29
|
+
color: exports.DEFAULT_LINE_STROKE_COLOR,
|
|
22
30
|
borderWidth: DEFAULT_BORDER_WIDTH,
|
|
23
|
-
borderColor:
|
|
31
|
+
borderColor: exports.DEFAULT_BORDER_STROKE_COLOR,
|
|
24
32
|
isBorderIncludedInWidth: false,
|
|
25
33
|
};
|
|
26
|
-
const alternativeRouteStyle = Object.assign(Object.assign({}, defaultStyle), { color:
|
|
34
|
+
const alternativeRouteStyle = Object.assign(Object.assign({}, defaultStyle), { color: exports.DEFAULT_LINE_STROKE_COLOR_ALTERNATIVE });
|
|
27
35
|
const Route = (props) => {
|
|
28
|
-
const { style, isReduced = false, isRouteAlternative = false, positions, startIcon, middleIcon, endIcon, arrowStyle = {}, hasArrows = true, markers = [], eventListenerMap, } = props;
|
|
36
|
+
const { style, isReduced = false, isRouteAlternative = false, positions, startIcon, middleIcon, endIcon, arrowStyle = {}, hasArrows = true, markers = [], customData, eventListenerMap, } = props;
|
|
29
37
|
const [lineString, setLineString] = (0, react_1.useState)();
|
|
30
38
|
const [routeStyle, setRouteStyle] = (0, react_1.useState)();
|
|
31
39
|
const [borderStyle, setBorderStyle] = (0, react_1.useState)();
|
|
@@ -55,17 +63,17 @@ const Route = (props) => {
|
|
|
55
63
|
};
|
|
56
64
|
const updateStyle = (updatedStyle, isReducedStyle, isRouteAlternativeStyle) => {
|
|
57
65
|
const mergedStyle = Object.assign(Object.assign({}, (isRouteAlternativeStyle ? alternativeRouteStyle : defaultStyle)), updatedStyle);
|
|
58
|
-
const { color, width, borderColor, borderWidth: mergedBorderWidth = 0, isBorderIncludedInWidth, lineDash, } = mergedStyle;
|
|
66
|
+
const { color, width = DEFAULT_WIDTH, borderColor, borderWidth: mergedBorderWidth = 0, isBorderIncludedInWidth, lineDash, } = mergedStyle;
|
|
59
67
|
setBorderWidth(isReducedStyle ? 0 : mergedBorderWidth);
|
|
60
68
|
if (isBorderIncludedInWidth && mergedBorderWidth >= width) {
|
|
61
69
|
throw new MapException_1.default(exports.TO_LESS_LINE_WIDTH_EXCEPTION_MSG);
|
|
62
70
|
}
|
|
63
|
-
setRouteStyle(new H.map.SpatialStyle(Object.assign({ strokeColor: isReducedStyle ?
|
|
64
|
-
setBorderStyle(new H.map.SpatialStyle(Object.assign({ strokeColor: isReduced ?
|
|
71
|
+
setRouteStyle(new H.map.SpatialStyle(Object.assign({ strokeColor: isReducedStyle ? exports.DEFAULT_LINE_STROKE_COLOR_REDUCED : color, lineWidth: isReducedStyle ? mergedBorderWidth + width : width, lineCap: 'round', lineJoin: 'bevel' }, (lineDash && lineDash))));
|
|
72
|
+
setBorderStyle(new H.map.SpatialStyle(Object.assign({ strokeColor: isReduced ? exports.DEFAULT_BORDER_STROKE_COLOR_REDUCED : borderColor, lineWidth: mergedBorderWidth + width, lineCap: 'round', lineJoin: 'bevel' }, (lineDash && lineDash))));
|
|
65
73
|
};
|
|
66
74
|
if (!lineString) {
|
|
67
75
|
return null;
|
|
68
76
|
}
|
|
69
|
-
return ((0, jsx_runtime_1.jsxs)("div", { children: [borderWidth > 0 && ((0, jsx_runtime_1.jsx)(Polyline_1.default, { eventListenerMap: eventListenerMap, geometry: lineString, style: borderStyle })), (0, jsx_runtime_1.jsx)(Polyline_1.default, { hasArrows: hasArrows, arrowStyle: arrowStyle, eventListenerMap: eventListenerMap, geometry: lineString, style: routeStyle }), startIcon && (0, jsx_runtime_1.jsx)(Marker_1.default, { position: positions[0], icon: startIcon }, 'startIcon'), middleIcon && ((0, jsx_runtime_1.jsx)(Marker_1.default, { position: positions[Math.floor(positions.length / 2)], icon: middleIcon }, 'middleIcon')), endIcon && (0, jsx_runtime_1.jsx)(Marker_1.default, { position: positions[positions.length - 1], icon: endIcon }, 'endIcon'), (0, isArray_1.default)(markers) && markers.map(marker => marker)] }));
|
|
77
|
+
return ((0, jsx_runtime_1.jsxs)("div", { children: [borderWidth > 0 && ((0, jsx_runtime_1.jsx)(Polyline_1.default, { eventListenerMap: eventListenerMap, geometry: lineString, style: borderStyle, customData: customData })), (0, jsx_runtime_1.jsx)(Polyline_1.default, { hasArrows: hasArrows, arrowStyle: arrowStyle, eventListenerMap: eventListenerMap, geometry: lineString, style: routeStyle, customData: customData }), startIcon && (0, jsx_runtime_1.jsx)(Marker_1.default, { position: positions[0], icon: startIcon }, 'startIcon'), middleIcon && ((0, jsx_runtime_1.jsx)(Marker_1.default, { position: positions[Math.floor(positions.length / 2)], icon: middleIcon }, 'middleIcon')), endIcon && (0, jsx_runtime_1.jsx)(Marker_1.default, { position: positions[positions.length - 1], icon: endIcon }, 'endIcon'), (0, isArray_1.default)(markers) && markers.map(marker => marker)] }));
|
|
70
78
|
};
|
|
71
79
|
exports.default = Route;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/// <reference types="heremaps" />
|
|
2
2
|
import type { Position } from '../../../utils/mapTypes';
|
|
3
3
|
import type { EventListenerMap } from '../../../utils/eventHandling';
|
|
4
|
+
export { colorMapColdplay, colorMapWarmup, colorMapGray, colorMapBrand, colorMapStatus, colorMapMarker, colorMapRating, colorMapHighlight, } from './polygonColors';
|
|
4
5
|
export type PolygonPoints = Position[] & Record<string, any>;
|
|
5
6
|
export type PolygonProps = {
|
|
6
7
|
points: PolygonPoints;
|
|
@@ -1,10 +1,20 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.colorMapHighlight = exports.colorMapRating = exports.colorMapMarker = exports.colorMapStatus = exports.colorMapBrand = exports.colorMapGray = exports.colorMapWarmup = exports.colorMapColdplay = void 0;
|
|
3
4
|
const tslib_1 = require("tslib");
|
|
4
5
|
const react_1 = require("react");
|
|
5
6
|
const isNil_1 = tslib_1.__importDefault(require("lodash/fp/isNil"));
|
|
6
7
|
const MapContext_1 = require("../../MapContext");
|
|
7
8
|
const hooks_1 = require("../../../utils/hooks");
|
|
9
|
+
var polygonColors_1 = require("./polygonColors");
|
|
10
|
+
Object.defineProperty(exports, "colorMapColdplay", { enumerable: true, get: function () { return polygonColors_1.colorMapColdplay; } });
|
|
11
|
+
Object.defineProperty(exports, "colorMapWarmup", { enumerable: true, get: function () { return polygonColors_1.colorMapWarmup; } });
|
|
12
|
+
Object.defineProperty(exports, "colorMapGray", { enumerable: true, get: function () { return polygonColors_1.colorMapGray; } });
|
|
13
|
+
Object.defineProperty(exports, "colorMapBrand", { enumerable: true, get: function () { return polygonColors_1.colorMapBrand; } });
|
|
14
|
+
Object.defineProperty(exports, "colorMapStatus", { enumerable: true, get: function () { return polygonColors_1.colorMapStatus; } });
|
|
15
|
+
Object.defineProperty(exports, "colorMapMarker", { enumerable: true, get: function () { return polygonColors_1.colorMapMarker; } });
|
|
16
|
+
Object.defineProperty(exports, "colorMapRating", { enumerable: true, get: function () { return polygonColors_1.colorMapRating; } });
|
|
17
|
+
Object.defineProperty(exports, "colorMapHighlight", { enumerable: true, get: function () { return polygonColors_1.colorMapHighlight; } });
|
|
8
18
|
const createGeometry = (points) => {
|
|
9
19
|
const lineString = new H.geo.LineString();
|
|
10
20
|
points.forEach(p => {
|
|
@@ -2,11 +2,13 @@
|
|
|
2
2
|
import { type EventListenerMap } from '../../../utils/eventHandling';
|
|
3
3
|
export declare const MISSING_GEOMETRY_PROPS_EXCEPTION_MSG = "Error in Polyline: Polyline without geometry makes no sense";
|
|
4
4
|
export declare const WRONG_GEOMETRY_PROPS_EXCEPTION_MSG = "Error in Polyline: property geometry must be of type H.geo.LineString";
|
|
5
|
+
export type ArrowStyle = H.map.Polyline.Options;
|
|
5
6
|
export type PolylineProps = {
|
|
6
7
|
hasArrows?: boolean;
|
|
7
|
-
arrowStyle?:
|
|
8
|
+
arrowStyle?: ArrowStyle;
|
|
8
9
|
geometry: H.geo.LineString;
|
|
9
10
|
style?: H.map.SpatialStyle;
|
|
11
|
+
customData?: object;
|
|
10
12
|
eventListenerMap?: EventListenerMap;
|
|
11
13
|
};
|
|
12
14
|
declare const Polyline: (props: PolylineProps) => null;
|
|
@@ -11,7 +11,7 @@ const rendering_1 = require("../../../utils/rendering");
|
|
|
11
11
|
exports.MISSING_GEOMETRY_PROPS_EXCEPTION_MSG = 'Error in Polyline: Polyline without geometry makes no sense';
|
|
12
12
|
exports.WRONG_GEOMETRY_PROPS_EXCEPTION_MSG = 'Error in Polyline: property geometry must be of type H.geo.LineString';
|
|
13
13
|
const Polyline = (props) => {
|
|
14
|
-
const { geometry, hasArrows, arrowStyle, style = H.map.SpatialStyle.DEFAULT_STYLE, eventListenerMap } = props;
|
|
14
|
+
const { geometry, hasArrows, arrowStyle, style = H.map.SpatialStyle.DEFAULT_STYLE, customData, eventListenerMap, } = props;
|
|
15
15
|
const { api, enableWebGL, baseLayer } = (0, MapContext_1.useMapContext)();
|
|
16
16
|
const [polyline, setPolyline] = (0, react_1.useState)();
|
|
17
17
|
if (!geometry) {
|
|
@@ -22,32 +22,21 @@ const Polyline = (props) => {
|
|
|
22
22
|
}
|
|
23
23
|
(0, react_1.useEffect)(() => {
|
|
24
24
|
var _a;
|
|
25
|
-
const lineGroup = new H.map.Group();
|
|
25
|
+
const lineGroup = new H.map.Group({ data: customData });
|
|
26
26
|
const line = new H.map.Polyline(geometry, { style });
|
|
27
27
|
if (hasArrows) {
|
|
28
28
|
let routeArrows;
|
|
29
29
|
if ((0, rendering_1.isVectorBased)(enableWebGL, baseLayer)) {
|
|
30
30
|
// WebGL way - Create a patterned polyline
|
|
31
31
|
routeArrows = new H.map.Polyline(geometry, {
|
|
32
|
-
style: {
|
|
33
|
-
strokeColor: 'rgba(42, 55, 64, 1)',
|
|
34
|
-
lineWidth: 5,
|
|
35
|
-
lineDash: [1.8, 4],
|
|
32
|
+
style: Object.assign({ strokeColor: 'rgba(42, 55, 64, 1)', lineWidth: 5, lineDash: [1.8, 4],
|
|
36
33
|
// @ts-ignore-next-line - the types are outdated here
|
|
37
|
-
lineDashImage: H.map.SpatialStyle.DashImage.ARROW,
|
|
38
|
-
},
|
|
34
|
+
lineDashImage: H.map.SpatialStyle.DashImage.ARROW }, arrowStyle),
|
|
39
35
|
});
|
|
40
36
|
}
|
|
41
37
|
else {
|
|
42
38
|
// Pixel map way - Create a patterned polyline
|
|
43
|
-
const defaultArrowStyle = {
|
|
44
|
-
lineWidth: 2,
|
|
45
|
-
fillColor: 'rgba(42, 55, 64, 1)',
|
|
46
|
-
strokeColor: 'rgba(0, 0, 0, 0.8)',
|
|
47
|
-
lineDash: [0, 4],
|
|
48
|
-
lineTailCap: 'arrow-tail',
|
|
49
|
-
lineHeadCap: 'arrow-head',
|
|
50
|
-
};
|
|
39
|
+
const defaultArrowStyle = Object.assign({ lineWidth: 2, fillColor: 'rgba(42, 55, 64, 1)', strokeColor: 'rgba(0, 0, 0, 0.8)', lineDash: [0, 4], lineTailCap: 'arrow-tail', lineHeadCap: 'arrow-head' }, arrowStyle);
|
|
51
40
|
const arrowLineStyle = new H.map.SpatialStyle({
|
|
52
41
|
lineWidth: 10,
|
|
53
42
|
strokeColor: 'rgba(255, 255, 255, 0)',
|
|
@@ -0,0 +1,252 @@
|
|
|
1
|
+
export declare const colorMapColdplay: {
|
|
2
|
+
'color-coldplay-wine': {
|
|
3
|
+
stroke: string;
|
|
4
|
+
fill: string;
|
|
5
|
+
};
|
|
6
|
+
'color-coldplay-aubergine': {
|
|
7
|
+
stroke: string;
|
|
8
|
+
fill: string;
|
|
9
|
+
};
|
|
10
|
+
'color-coldplay-kashmir': {
|
|
11
|
+
stroke: string;
|
|
12
|
+
fill: string;
|
|
13
|
+
};
|
|
14
|
+
'color-coldplay-fountain': {
|
|
15
|
+
stroke: string;
|
|
16
|
+
fill: string;
|
|
17
|
+
};
|
|
18
|
+
'color-coldplay-turquoise': {
|
|
19
|
+
stroke: string;
|
|
20
|
+
fill: string;
|
|
21
|
+
};
|
|
22
|
+
'color-coldplay-bermuda': {
|
|
23
|
+
stroke: string;
|
|
24
|
+
fill: string;
|
|
25
|
+
};
|
|
26
|
+
'color-coldplay-moos': {
|
|
27
|
+
stroke: string;
|
|
28
|
+
fill: string;
|
|
29
|
+
};
|
|
30
|
+
'color-coldplay-primrose': {
|
|
31
|
+
stroke: string;
|
|
32
|
+
fill: string;
|
|
33
|
+
};
|
|
34
|
+
'color-coldplay-khaki': {
|
|
35
|
+
stroke: string;
|
|
36
|
+
fill: string;
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
export declare const colorMapWarmup: {
|
|
40
|
+
'color-warmup-crimson': {
|
|
41
|
+
stroke: string;
|
|
42
|
+
fill: string;
|
|
43
|
+
};
|
|
44
|
+
'color-warmup-victoria': {
|
|
45
|
+
stroke: string;
|
|
46
|
+
fill: string;
|
|
47
|
+
};
|
|
48
|
+
'color-warmup-cadillac': {
|
|
49
|
+
stroke: string;
|
|
50
|
+
fill: string;
|
|
51
|
+
};
|
|
52
|
+
'color-warmup-raspberry': {
|
|
53
|
+
stroke: string;
|
|
54
|
+
fill: string;
|
|
55
|
+
};
|
|
56
|
+
'color-warmup-cerise': {
|
|
57
|
+
stroke: string;
|
|
58
|
+
fill: string;
|
|
59
|
+
};
|
|
60
|
+
'color-warmup-charm': {
|
|
61
|
+
stroke: string;
|
|
62
|
+
fill: string;
|
|
63
|
+
};
|
|
64
|
+
'color-warmup-salmon': {
|
|
65
|
+
stroke: string;
|
|
66
|
+
fill: string;
|
|
67
|
+
};
|
|
68
|
+
'color-warmup-cherokee': {
|
|
69
|
+
stroke: string;
|
|
70
|
+
fill: string;
|
|
71
|
+
};
|
|
72
|
+
'color-warmup-corn': {
|
|
73
|
+
stroke: string;
|
|
74
|
+
fill: string;
|
|
75
|
+
};
|
|
76
|
+
};
|
|
77
|
+
export declare const colorMapGray: {
|
|
78
|
+
'gray-darkest': {
|
|
79
|
+
stroke: string;
|
|
80
|
+
fill: string;
|
|
81
|
+
};
|
|
82
|
+
'gray-darker': {
|
|
83
|
+
stroke: string;
|
|
84
|
+
fill: string;
|
|
85
|
+
};
|
|
86
|
+
'gray-dark': {
|
|
87
|
+
stroke: string;
|
|
88
|
+
fill: string;
|
|
89
|
+
};
|
|
90
|
+
gray: {
|
|
91
|
+
stroke: string;
|
|
92
|
+
fill: string;
|
|
93
|
+
};
|
|
94
|
+
'gray-light': {
|
|
95
|
+
stroke: string;
|
|
96
|
+
fill: string;
|
|
97
|
+
};
|
|
98
|
+
'gray-lighter': {
|
|
99
|
+
stroke: string;
|
|
100
|
+
fill: string;
|
|
101
|
+
};
|
|
102
|
+
'gray-lightest': {
|
|
103
|
+
stroke: string;
|
|
104
|
+
fill: string;
|
|
105
|
+
};
|
|
106
|
+
'gray-decent': {
|
|
107
|
+
stroke: string;
|
|
108
|
+
fill: string;
|
|
109
|
+
};
|
|
110
|
+
};
|
|
111
|
+
export declare const colorMapBrand: {
|
|
112
|
+
'brand-primary': {
|
|
113
|
+
stroke: string;
|
|
114
|
+
fill: string;
|
|
115
|
+
};
|
|
116
|
+
'brand-secondary': {
|
|
117
|
+
stroke: string;
|
|
118
|
+
fill: string;
|
|
119
|
+
};
|
|
120
|
+
'brand-info': {
|
|
121
|
+
stroke: string;
|
|
122
|
+
fill: string;
|
|
123
|
+
};
|
|
124
|
+
'brand-success': {
|
|
125
|
+
stroke: string;
|
|
126
|
+
fill: string;
|
|
127
|
+
};
|
|
128
|
+
'brand-warning': {
|
|
129
|
+
stroke: string;
|
|
130
|
+
fill: string;
|
|
131
|
+
};
|
|
132
|
+
'brand-danger': {
|
|
133
|
+
stroke: string;
|
|
134
|
+
fill: string;
|
|
135
|
+
};
|
|
136
|
+
};
|
|
137
|
+
export declare const colorMapStatus: {
|
|
138
|
+
'color-status-available': {
|
|
139
|
+
stroke: string;
|
|
140
|
+
fill: string;
|
|
141
|
+
};
|
|
142
|
+
'color-status-driving': {
|
|
143
|
+
stroke: string;
|
|
144
|
+
fill: string;
|
|
145
|
+
};
|
|
146
|
+
'color-status-resting': {
|
|
147
|
+
stroke: string;
|
|
148
|
+
fill: string;
|
|
149
|
+
};
|
|
150
|
+
'color-status-working': {
|
|
151
|
+
stroke: string;
|
|
152
|
+
fill: string;
|
|
153
|
+
};
|
|
154
|
+
};
|
|
155
|
+
export declare const colorMapMarker: {
|
|
156
|
+
'color-map-marker-text': {
|
|
157
|
+
stroke: string;
|
|
158
|
+
fill: string;
|
|
159
|
+
};
|
|
160
|
+
'color-map-marker-active': {
|
|
161
|
+
stroke: string;
|
|
162
|
+
fill: string;
|
|
163
|
+
};
|
|
164
|
+
'color-map-marker-asset': {
|
|
165
|
+
stroke: string;
|
|
166
|
+
fill: string;
|
|
167
|
+
};
|
|
168
|
+
'color-map-marker-poi': {
|
|
169
|
+
stroke: string;
|
|
170
|
+
fill: string;
|
|
171
|
+
};
|
|
172
|
+
'color-map-marker-geofence': {
|
|
173
|
+
stroke: string;
|
|
174
|
+
fill: string;
|
|
175
|
+
};
|
|
176
|
+
'color-map-marker-route': {
|
|
177
|
+
stroke: string;
|
|
178
|
+
fill: string;
|
|
179
|
+
};
|
|
180
|
+
'color-map-marker-info': {
|
|
181
|
+
stroke: string;
|
|
182
|
+
fill: string;
|
|
183
|
+
};
|
|
184
|
+
'color-map-marker-success': {
|
|
185
|
+
stroke: string;
|
|
186
|
+
fill: string;
|
|
187
|
+
};
|
|
188
|
+
'color-map-marker-warning': {
|
|
189
|
+
stroke: string;
|
|
190
|
+
fill: string;
|
|
191
|
+
};
|
|
192
|
+
'color-map-marker-danger': {
|
|
193
|
+
stroke: string;
|
|
194
|
+
fill: string;
|
|
195
|
+
};
|
|
196
|
+
};
|
|
197
|
+
export declare const colorMapRating: {
|
|
198
|
+
'color-rating-1': {
|
|
199
|
+
stroke: string;
|
|
200
|
+
fill: string;
|
|
201
|
+
};
|
|
202
|
+
'color-rating-2': {
|
|
203
|
+
stroke: string;
|
|
204
|
+
fill: string;
|
|
205
|
+
};
|
|
206
|
+
'color-rating-3': {
|
|
207
|
+
stroke: string;
|
|
208
|
+
fill: string;
|
|
209
|
+
};
|
|
210
|
+
'color-rating-4': {
|
|
211
|
+
stroke: string;
|
|
212
|
+
fill: string;
|
|
213
|
+
};
|
|
214
|
+
'color-rating-5': {
|
|
215
|
+
stroke: string;
|
|
216
|
+
fill: string;
|
|
217
|
+
};
|
|
218
|
+
};
|
|
219
|
+
export declare const colorMapHighlight: {
|
|
220
|
+
'color-highlight-darkest': {
|
|
221
|
+
stroke: string;
|
|
222
|
+
fill: string;
|
|
223
|
+
};
|
|
224
|
+
'color-highlight-darker': {
|
|
225
|
+
stroke: string;
|
|
226
|
+
fill: string;
|
|
227
|
+
};
|
|
228
|
+
'color-highlight-dark': {
|
|
229
|
+
stroke: string;
|
|
230
|
+
fill: string;
|
|
231
|
+
};
|
|
232
|
+
'color-highlight': {
|
|
233
|
+
stroke: string;
|
|
234
|
+
fill: string;
|
|
235
|
+
};
|
|
236
|
+
'color-highlight-light': {
|
|
237
|
+
stroke: string;
|
|
238
|
+
fill: string;
|
|
239
|
+
};
|
|
240
|
+
'color-highlight-lighter': {
|
|
241
|
+
stroke: string;
|
|
242
|
+
fill: string;
|
|
243
|
+
};
|
|
244
|
+
'color-highlight-lightest': {
|
|
245
|
+
stroke: string;
|
|
246
|
+
fill: string;
|
|
247
|
+
};
|
|
248
|
+
'color-highlight-decent': {
|
|
249
|
+
stroke: string;
|
|
250
|
+
fill: string;
|
|
251
|
+
};
|
|
252
|
+
};
|