@rio-cloud/rio-uikit 1.4.0 → 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.
Files changed (174) hide show
  1. package/.DS_Store +0 -0
  2. package/FadeExpander.d.ts +2 -0
  3. package/FadeExpander.js +2 -0
  4. package/FadeUp.d.ts +2 -0
  5. package/FadeUp.js +2 -0
  6. package/XAxis.d.ts +2 -0
  7. package/XAxis.js +2 -0
  8. package/YAxis.d.ts +2 -0
  9. package/YAxis.js +2 -0
  10. package/components/applicationLayout/ApplicationLayoutBody.d.ts +5 -0
  11. package/components/applicationLayout/ApplicationLayoutBody.js +10 -1
  12. package/components/charts/Area.d.ts +11 -3
  13. package/components/charts/Area.js +9 -1
  14. package/components/charts/AreaChart.d.ts +4 -3
  15. package/components/charts/AreaChart.js +9 -8
  16. package/components/charts/Bar.d.ts +6 -2
  17. package/components/charts/Bar.js +3 -4
  18. package/components/charts/BarChart.d.ts +2 -1
  19. package/components/charts/BarChart.js +8 -4
  20. package/components/charts/ComposedChart.d.ts +6 -5
  21. package/components/charts/ComposedChart.js +16 -11
  22. package/components/charts/Legend.js +1 -1
  23. package/components/charts/Line.d.ts +11 -3
  24. package/components/charts/Line.js +9 -1
  25. package/components/charts/LineChart.d.ts +6 -4
  26. package/components/charts/LineChart.js +10 -9
  27. package/components/charts/ReferenceLine.d.ts +8 -4
  28. package/components/charts/ReferenceLine.js +18 -2
  29. package/components/charts/XAxis.d.ts +7 -0
  30. package/components/charts/XAxis.js +18 -0
  31. package/components/charts/YAxis.d.ts +5 -0
  32. package/components/charts/YAxis.js +2 -0
  33. package/components/collapse/Collapse.js +3 -2
  34. package/components/dropdown/ButtonDropdown.d.ts +3 -1
  35. package/components/dropdown/ButtonDropdown.js +6 -5
  36. package/components/dropdown/DropdownToggleButton.d.ts +1 -0
  37. package/components/dropdown/DropdownToggleButton.js +4 -2
  38. package/components/fade/FadeExpander.d.ts +27 -0
  39. package/components/fade/FadeExpander.js +41 -0
  40. package/components/fade/FadeUp.d.ts +27 -0
  41. package/components/fade/FadeUp.js +28 -0
  42. package/components/listMenu/ListMenu.d.ts +7 -0
  43. package/components/listMenu/ListMenu.js +6 -3
  44. package/components/map/components/features/Route.d.ts +13 -2
  45. package/components/map/components/features/Route.js +19 -11
  46. package/components/map/components/features/basics/Polygon.d.ts +1 -0
  47. package/components/map/components/features/basics/Polygon.js +1 -0
  48. package/components/map/components/features/basics/Polyline.d.ts +3 -1
  49. package/components/map/components/features/basics/Polyline.js +5 -16
  50. package/components/map/components/features/basics/polygonColors.d.ts +252 -0
  51. package/components/map/components/features/basics/polygonColors.js +252 -0
  52. package/components/map/utils/mapTypes.d.ts +1 -1
  53. package/components/map/utils/mapTypes.js +2 -0
  54. package/components/mapMarker/SingleMapMarker.d.ts +3 -2
  55. package/components/mapMarker/SingleMapMarker.js +3 -3
  56. package/components/selects/BaseSelectDropdown.d.ts +0 -1
  57. package/components/selects/BaseSelectDropdown.js +7 -1
  58. package/components/selects/Multiselect.js +1 -4
  59. package/components/selects/Select.d.ts +1 -1
  60. package/components/selects/Select.js +1 -4
  61. package/components/smoothScrollbars/SmoothScrollbars.js +28 -3
  62. package/components/switch/Switch.d.ts +6 -5
  63. package/components/switch/Switch.js +5 -5
  64. package/components/tag/Tag.d.ts +2 -2
  65. package/components/tag/Tag.js +5 -6
  66. package/hooks/useDOMNodeCount.d.ts +2 -0
  67. package/hooks/useDOMNodeCount.js +29 -0
  68. package/hooks/useEventListenerCount.d.ts +5 -0
  69. package/hooks/useEventListenerCount.js +42 -0
  70. package/hooks/useSorting.d.ts +29 -0
  71. package/hooks/useSorting.js +41 -0
  72. package/lib/es/FadeExpander.d.ts +2 -0
  73. package/lib/es/FadeExpander.js +7 -0
  74. package/lib/es/FadeUp.d.ts +2 -0
  75. package/lib/es/FadeUp.js +7 -0
  76. package/lib/es/XAxis.d.ts +2 -0
  77. package/lib/es/XAxis.js +7 -0
  78. package/lib/es/YAxis.d.ts +2 -0
  79. package/lib/es/YAxis.js +7 -0
  80. package/lib/es/components/applicationLayout/ApplicationLayoutBody.d.ts +5 -0
  81. package/lib/es/components/applicationLayout/ApplicationLayoutBody.js +10 -1
  82. package/lib/es/components/charts/Area.d.ts +11 -3
  83. package/lib/es/components/charts/Area.js +11 -1
  84. package/lib/es/components/charts/AreaChart.d.ts +4 -3
  85. package/lib/es/components/charts/AreaChart.js +8 -7
  86. package/lib/es/components/charts/Bar.d.ts +6 -2
  87. package/lib/es/components/charts/Bar.js +5 -4
  88. package/lib/es/components/charts/BarChart.d.ts +2 -1
  89. package/lib/es/components/charts/BarChart.js +7 -3
  90. package/lib/es/components/charts/ComposedChart.d.ts +6 -5
  91. package/lib/es/components/charts/ComposedChart.js +15 -10
  92. package/lib/es/components/charts/Legend.js +1 -1
  93. package/lib/es/components/charts/Line.d.ts +11 -3
  94. package/lib/es/components/charts/Line.js +11 -1
  95. package/lib/es/components/charts/LineChart.d.ts +6 -4
  96. package/lib/es/components/charts/LineChart.js +9 -8
  97. package/lib/es/components/charts/ReferenceLine.d.ts +8 -4
  98. package/lib/es/components/charts/ReferenceLine.js +21 -2
  99. package/lib/es/components/charts/XAxis.d.ts +7 -0
  100. package/lib/es/components/charts/XAxis.js +23 -0
  101. package/lib/es/components/charts/YAxis.d.ts +5 -0
  102. package/lib/es/components/charts/YAxis.js +4 -0
  103. package/lib/es/components/collapse/Collapse.js +3 -2
  104. package/lib/es/components/dropdown/ButtonDropdown.d.ts +3 -1
  105. package/lib/es/components/dropdown/ButtonDropdown.js +5 -4
  106. package/lib/es/components/dropdown/DropdownToggleButton.d.ts +1 -0
  107. package/lib/es/components/dropdown/DropdownToggleButton.js +4 -2
  108. package/lib/es/components/fade/FadeExpander.d.ts +27 -0
  109. package/lib/es/components/fade/FadeExpander.js +43 -0
  110. package/lib/es/components/fade/FadeUp.d.ts +27 -0
  111. package/lib/es/components/fade/FadeUp.js +30 -0
  112. package/lib/es/components/listMenu/ListMenu.d.ts +7 -0
  113. package/lib/es/components/listMenu/ListMenu.js +6 -3
  114. package/lib/es/components/map/components/features/Route.d.ts +13 -2
  115. package/lib/es/components/map/components/features/Route.js +20 -12
  116. package/lib/es/components/map/components/features/basics/Polygon.d.ts +1 -0
  117. package/lib/es/components/map/components/features/basics/Polygon.js +10 -0
  118. package/lib/es/components/map/components/features/basics/Polyline.d.ts +3 -1
  119. package/lib/es/components/map/components/features/basics/Polyline.js +5 -16
  120. package/lib/es/components/map/components/features/basics/polygonColors.d.ts +252 -0
  121. package/lib/es/components/map/components/features/basics/polygonColors.js +255 -0
  122. package/lib/es/components/map/utils/mapTypes.d.ts +1 -1
  123. package/lib/es/components/map/utils/mapTypes.js +2 -0
  124. package/lib/es/components/mapMarker/SingleMapMarker.d.ts +3 -2
  125. package/lib/es/components/mapMarker/SingleMapMarker.js +3 -3
  126. package/lib/es/components/selects/BaseSelectDropdown.d.ts +0 -1
  127. package/lib/es/components/selects/BaseSelectDropdown.js +6 -0
  128. package/lib/es/components/selects/Multiselect.js +1 -4
  129. package/lib/es/components/selects/Select.d.ts +1 -1
  130. package/lib/es/components/selects/Select.js +1 -4
  131. package/lib/es/components/smoothScrollbars/SmoothScrollbars.js +27 -2
  132. package/lib/es/components/switch/Switch.d.ts +6 -5
  133. package/lib/es/components/switch/Switch.js +5 -5
  134. package/lib/es/components/tag/Tag.d.ts +2 -2
  135. package/lib/es/components/tag/Tag.js +5 -6
  136. package/lib/es/hooks/useDOMNodeCount.d.ts +2 -0
  137. package/lib/es/hooks/useDOMNodeCount.js +31 -0
  138. package/lib/es/hooks/useEventListenerCount.d.ts +5 -0
  139. package/lib/es/hooks/useEventListenerCount.js +45 -0
  140. package/lib/es/hooks/useSorting.d.ts +29 -0
  141. package/lib/es/hooks/useSorting.js +43 -0
  142. package/lib/es/storageUtils.d.ts +1 -0
  143. package/lib/es/storageUtils.js +4 -0
  144. package/lib/es/styles/variables/colors/colors.json +4 -3
  145. package/lib/es/urlFeatureToggles.d.ts +1 -0
  146. package/lib/es/urlFeatureToggles.js +4 -0
  147. package/lib/es/useDOMNodeCount.d.ts +2 -0
  148. package/lib/es/useDOMNodeCount.js +7 -0
  149. package/lib/es/useEventListenerCount.d.ts +2 -0
  150. package/lib/es/useEventListenerCount.js +7 -0
  151. package/lib/es/useSorting.d.ts +2 -0
  152. package/lib/es/useSorting.js +7 -0
  153. package/lib/es/utils/storageUtils.d.ts +5 -0
  154. package/lib/es/utils/storageUtils.js +32 -0
  155. package/lib/es/utils/urlFeatureToggles.d.ts +10 -0
  156. package/lib/es/utils/urlFeatureToggles.js +41 -0
  157. package/lib/es/version.json +1 -1
  158. package/package.json +4 -1
  159. package/storageUtils.d.ts +1 -0
  160. package/storageUtils.js +1 -0
  161. package/styles/variables/colors/colors.json +4 -3
  162. package/urlFeatureToggles.d.ts +1 -0
  163. package/urlFeatureToggles.js +1 -0
  164. package/useDOMNodeCount.d.ts +2 -0
  165. package/useDOMNodeCount.js +2 -0
  166. package/useEventListenerCount.d.ts +2 -0
  167. package/useEventListenerCount.js +2 -0
  168. package/useSorting.d.ts +2 -0
  169. package/useSorting.js +2 -0
  170. package/utils/storageUtils.d.ts +5 -0
  171. package/utils/storageUtils.js +29 -0
  172. package/utils/urlFeatureToggles.d.ts +10 -0
  173. package/utils/urlFeatureToggles.js +32 -0
  174. package/version.json +1 -1
@@ -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
- const LINE_STROKE_COLOR = 'rgba(48, 194, 255, 1)';
15
- const LINE_STROKE_COLOR_REDUCED = 'rgba(48, 194, 255, 0.5)';
16
- const BORDER_STROKE_COLOR_REDUCED = 'rgba(255, 255, 255, 0)';
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: LINE_STROKE_COLOR,
29
+ color: exports.DEFAULT_LINE_STROKE_COLOR,
22
30
  borderWidth: DEFAULT_BORDER_WIDTH,
23
- borderColor: 'rgba(54, 144, 174, 1)',
31
+ borderColor: exports.DEFAULT_BORDER_STROKE_COLOR,
24
32
  isBorderIncludedInWidth: false,
25
33
  };
26
- const alternativeRouteStyle = Object.assign(Object.assign({}, defaultStyle), { color: 'rgb(218,253,255)' });
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 ? LINE_STROKE_COLOR_REDUCED : color, lineWidth: isReducedStyle ? mergedBorderWidth + width : width, lineCap: 'round', lineJoin: 'bevel' }, (lineDash && lineDash))));
64
- setBorderStyle(new H.map.SpatialStyle(Object.assign({ strokeColor: isReduced ? BORDER_STROKE_COLOR_REDUCED : borderColor, lineWidth: mergedBorderWidth + width, lineCap: 'round', lineJoin: 'bevel' }, (lineDash && lineDash))));
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?: object;
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
+ };
@@ -0,0 +1,255 @@
1
+ "use strict";
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;
4
+ exports.colorMapColdplay = {
5
+ 'color-coldplay-wine': {
6
+ stroke: 'rgba(82, 13, 78, 0.65)',
7
+ fill: 'rgba(82, 13, 78, 0.25)',
8
+ },
9
+ 'color-coldplay-aubergine': {
10
+ stroke: 'rgba(90, 72, 118, 0.65)',
11
+ fill: 'rgba(90, 72, 118, 0.25)',
12
+ },
13
+ 'color-coldplay-kashmir': {
14
+ stroke: 'rgba(83, 110, 139, 0.65)',
15
+ fill: 'rgba(83, 110, 139, 0.25)',
16
+ },
17
+ 'color-coldplay-fountain': {
18
+ stroke: 'rgba(103, 171, 197, 0.65)',
19
+ fill: 'rgba(103, 171, 197, 0.25)',
20
+ },
21
+ 'color-coldplay-turquoise': {
22
+ stroke: 'rgba(78, 204, 193, 0.65)',
23
+ fill: 'rgba(78, 204, 193, 0.25)',
24
+ },
25
+ 'color-coldplay-bermuda': {
26
+ stroke: 'rgba(121, 212, 179, 0.65)',
27
+ fill: 'rgba(121, 212, 179, 0.25)',
28
+ },
29
+ 'color-coldplay-moos': {
30
+ stroke: 'rgba(161, 218, 163, 0.65)',
31
+ fill: 'rgba(161, 218, 163, 0.25)',
32
+ },
33
+ 'color-coldplay-primrose': {
34
+ stroke: 'rgba(199, 226, 145, 0.65)',
35
+ fill: 'rgba(199, 226, 145, 0.25)',
36
+ },
37
+ 'color-coldplay-khaki': {
38
+ stroke: 'rgba(240, 235, 131, 0.65)',
39
+ fill: 'rgba(240, 235, 131, 0.25)',
40
+ },
41
+ };
42
+ exports.colorMapWarmup = {
43
+ 'color-warmup-crimson': {
44
+ stroke: 'rgba(49, 20, 79, 0.65)',
45
+ fill: 'rgba(49, 20, 79, 0.25)',
46
+ },
47
+ 'color-warmup-victoria': {
48
+ stroke: 'rgba(73, 61, 109, 0.65)',
49
+ fill: 'rgba(73, 61, 109, 0.25)',
50
+ },
51
+ 'color-warmup-cadillac': {
52
+ stroke: 'rgba(126, 62, 114, 0.65)',
53
+ fill: 'rgba(126, 62, 114, 0.25)',
54
+ },
55
+ 'color-warmup-raspberry': {
56
+ stroke: 'rgba(178, 54, 114, 0.65)',
57
+ fill: 'rgba(178, 54, 114, 0.25)',
58
+ },
59
+ 'color-warmup-cerise': {
60
+ stroke: 'rgba(231, 36, 114, 0.65)',
61
+ fill: 'rgba(231, 36, 114, 0.25)',
62
+ },
63
+ 'color-warmup-charm': {
64
+ stroke: 'rgba(201, 119, 141, 0.65)',
65
+ fill: 'rgba(201, 119, 141, 0.25)',
66
+ },
67
+ 'color-warmup-salmon': {
68
+ stroke: 'rgba(241, 149, 136, 0.65)',
69
+ fill: 'rgba(241, 149, 136, 0.25)',
70
+ },
71
+ 'color-warmup-cherokee': {
72
+ stroke: 'rgba(245, 187, 137, 0.65)',
73
+ fill: 'rgba(245, 187, 137, 0.25)',
74
+ },
75
+ 'color-warmup-corn': {
76
+ stroke: 'rgba(253, 224, 130, 0.65)',
77
+ fill: 'rgba(253, 224, 130, 0.25)',
78
+ },
79
+ };
80
+ exports.colorMapGray = {
81
+ 'gray-darkest': {
82
+ stroke: 'rgba(42, 55, 64, 0.65)',
83
+ fill: 'rgba(42, 55, 64, 0.25)',
84
+ },
85
+ 'gray-darker': {
86
+ stroke: 'rgba(76, 86, 103, 0.65)',
87
+ fill: 'rgba(76, 86, 103, 0.25)',
88
+ },
89
+ 'gray-dark': {
90
+ stroke: 'rgba(105, 122, 139, 0.65)',
91
+ fill: 'rgba(105, 122, 139, 0.25)',
92
+ },
93
+ gray: {
94
+ stroke: 'rgba(167, 175, 187, 0.65)',
95
+ fill: 'rgba(167, 175, 187, 0.25)',
96
+ },
97
+ 'gray-light': {
98
+ stroke: 'rgba(208, 216, 222, 0.65)',
99
+ fill: 'rgba(208, 216, 222, 0.25)',
100
+ },
101
+ 'gray-lighter': {
102
+ stroke: 'rgba(229, 235, 240, 0.65)',
103
+ fill: 'rgba(229, 235, 240, 0.25)',
104
+ },
105
+ 'gray-lightest': {
106
+ stroke: 'rgba(246, 248, 249, 0.65)',
107
+ fill: 'rgba(246, 248, 249, 0.25)',
108
+ },
109
+ 'gray-decent': {
110
+ stroke: 'rgba(253, 253, 253, 0.65)',
111
+ fill: 'rgba(253, 253, 253, 0.25)',
112
+ },
113
+ };
114
+ exports.colorMapBrand = {
115
+ 'brand-primary': {
116
+ stroke: 'rgba(48, 180, 192, 0.65)',
117
+ fill: 'rgba(48, 180, 192, 0.25)',
118
+ },
119
+ 'brand-secondary': {
120
+ stroke: 'rgba(178, 54, 114, 0.65)',
121
+ fill: 'rgba(178, 54, 114, 0.25)',
122
+ },
123
+ 'brand-info': {
124
+ stroke: 'rgba(75, 128, 166, 0.65)',
125
+ fill: 'rgba(75, 128, 166, 0.25)',
126
+ },
127
+ 'brand-success': {
128
+ stroke: 'rgba(92, 184, 92, 0.65)',
129
+ fill: 'rgba(92, 184, 92, 0.25)',
130
+ },
131
+ 'brand-warning': {
132
+ stroke: 'rgba(255, 142, 60, 0.65)',
133
+ fill: 'rgba(255, 142, 60, 0.25)',
134
+ },
135
+ 'brand-danger': {
136
+ stroke: 'rgba(226, 40, 55, 0.65)',
137
+ fill: 'rgba(226, 40, 55, 0.25)',
138
+ },
139
+ };
140
+ exports.colorMapStatus = {
141
+ 'color-status-available': {
142
+ stroke: 'rgba(35, 155, 125, 0.65)',
143
+ fill: 'rgba(35, 155, 125, 0.25)',
144
+ },
145
+ 'color-status-driving': {
146
+ stroke: 'rgba(54, 144, 174, 0.65)',
147
+ fill: 'rgba(54, 144, 174, 0.25)',
148
+ },
149
+ 'color-status-resting': {
150
+ stroke: 'rgba(98, 107, 114, 0.65)',
151
+ fill: 'rgba(98, 107, 114, 0.25)',
152
+ },
153
+ 'color-status-working': {
154
+ stroke: 'rgba(148, 72, 139, 0.65)',
155
+ fill: 'rgba(148, 72, 139, 0.25)',
156
+ },
157
+ };
158
+ exports.colorMapMarker = {
159
+ 'color-map-marker-text': {
160
+ stroke: 'rgba(255, 255, 255, 0.65)',
161
+ fill: 'rgba(255, 255, 255, 0.25)',
162
+ },
163
+ 'color-map-marker-active': {
164
+ stroke: 'rgba(255, 255, 255, 0.65)',
165
+ fill: 'rgba(255, 255, 255, 0.25)',
166
+ },
167
+ 'color-map-marker-asset': {
168
+ stroke: 'rgba(42, 55, 64, 0.65)',
169
+ fill: 'rgba(42, 55, 64, 0.25)',
170
+ },
171
+ 'color-map-marker-poi': {
172
+ stroke: 'rgba(203, 57, 149, 0.65)',
173
+ fill: 'rgba(203, 57, 149, 0.25)',
174
+ },
175
+ 'color-map-marker-geofence': {
176
+ stroke: 'rgba(242, 84, 95, 0.65)',
177
+ fill: 'rgba(242, 84, 95, 0.25)',
178
+ },
179
+ 'color-map-marker-route': {
180
+ stroke: 'rgba(54, 175, 215, 0.65)',
181
+ fill: 'rgba(54, 175, 215, 0.25)',
182
+ },
183
+ 'color-map-marker-info': {
184
+ stroke: 'rgba(63, 117, 155, 0.65)',
185
+ fill: 'rgba(63, 117, 155, 0.25)',
186
+ },
187
+ 'color-map-marker-success': {
188
+ stroke: 'rgba(92, 184, 92, 0.65)',
189
+ fill: 'rgba(92, 184, 92, 0.25)',
190
+ },
191
+ 'color-map-marker-warning': {
192
+ stroke: 'rgba(255, 142, 60, 0.65)',
193
+ fill: 'rgba(255, 142, 60, 0.25)',
194
+ },
195
+ 'color-map-marker-danger': {
196
+ stroke: 'rgba(226, 40, 55, 0.65)',
197
+ fill: 'rgba(226, 40, 55, 0.25)',
198
+ },
199
+ };
200
+ exports.colorMapRating = {
201
+ 'color-rating-1': {
202
+ stroke: 'rgba(226, 40, 55, 0.65)',
203
+ fill: 'rgba(226, 40, 55, 0.25)',
204
+ },
205
+ 'color-rating-2': {
206
+ stroke: 'rgba(255, 142, 60, 0.65)',
207
+ fill: 'rgba(255, 142, 60, 0.25)',
208
+ },
209
+ 'color-rating-3': {
210
+ stroke: 'rgba(248, 197, 117, 0.65)',
211
+ fill: 'rgba(248, 197, 117, 0.25)',
212
+ },
213
+ 'color-rating-4': {
214
+ stroke: 'rgba(92, 184, 92, 0.65)',
215
+ fill: 'rgba(92, 184, 92, 0.25)',
216
+ },
217
+ 'color-rating-5': {
218
+ stroke: 'rgba(75, 146, 76, 0.65)',
219
+ fill: 'rgba(75, 146, 76, 0.25)',
220
+ },
221
+ };
222
+ exports.colorMapHighlight = {
223
+ 'color-highlight-darkest': {
224
+ stroke: 'rgba(21, 75, 86, 0.65)',
225
+ fill: 'rgba(21, 75, 86, 0.25)',
226
+ },
227
+ 'color-highlight-darker': {
228
+ stroke: 'rgba(32, 110, 126, 0.65)',
229
+ fill: 'rgba(32, 110, 126, 0.25)',
230
+ },
231
+ 'color-highlight-dark': {
232
+ stroke: 'rgba(38, 136, 151, 0.65)',
233
+ fill: 'rgba(38, 136, 151, 0.25)',
234
+ },
235
+ 'color-highlight': {
236
+ stroke: 'rgba(48, 180, 192, 0.65)',
237
+ fill: 'rgba(48, 180, 192, 0.25)',
238
+ },
239
+ 'color-highlight-light': {
240
+ stroke: 'rgba(141, 219, 227, 0.65)',
241
+ fill: 'rgba(141, 219, 227, 0.25)',
242
+ },
243
+ 'color-highlight-lighter': {
244
+ stroke: 'rgba(206, 240, 243, 0.65)',
245
+ fill: 'rgba(206, 240, 243, 0.25)',
246
+ },
247
+ 'color-highlight-lightest': {
248
+ stroke: 'rgba(235, 249, 250, 0.65)',
249
+ fill: 'rgba(235, 249, 250, 0.25)',
250
+ },
251
+ 'color-highlight-decent': {
252
+ stroke: 'rgba(243, 251, 252, 0.65)',
253
+ fill: 'rgba(243, 251, 252, 0.25)',
254
+ },
255
+ };
@@ -161,6 +161,6 @@ export type IncidentDataPoint = {
161
161
  roadClosed: boolean;
162
162
  position: Position;
163
163
  };
164
- export declare const markerColorOptions: readonly ["bg-map-marker-asset", "bg-map-marker-poi", "bg-map-marker-geofence", "bg-map-marker-route", "bg-map-marker-info", "bg-map-marker-success", "bg-map-marker-warning", "bg-map-marker-danger"];
164
+ export declare const markerColorOptions: readonly ["bg-map-marker-asset", "bg-map-marker-poi", "bg-map-marker-geofence", "bg-map-marker-route", "bg-map-marker-info", "bg-map-marker-success", "bg-map-marker-warning", "bg-map-marker-danger", "bg-map-marker-restrictions"];
165
165
  export type MarkerColor = (typeof markerColorOptions)[number];
166
166
  export declare const markerColorMapping: Record<MarkerColor, string>;