react-spatial 1.5.7 → 1.7.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 (65) hide show
  1. package/README.md +1 -5
  2. package/components/BaseLayerSwitcher/BaseLayerSwitcher.js.map +1 -1
  3. package/components/BaseLayerSwitcher/BaseLayerSwitcher.scss +3 -3
  4. package/components/BaseLayerSwitcher/index.js.map +1 -1
  5. package/components/BasicMap/BasicMap.js +1 -16
  6. package/components/BasicMap/BasicMap.js.map +2 -2
  7. package/components/BasicMap/index.js.map +1 -1
  8. package/components/CanvasSaveButton/CanvasSaveButton.js.map +1 -1
  9. package/components/CanvasSaveButton/index.js.map +1 -1
  10. package/components/Copyright/Copyright.js.map +1 -1
  11. package/components/Copyright/index.js.map +1 -1
  12. package/components/FeatureExportButton/FeatureExportButton.js.map +1 -1
  13. package/components/FeatureExportButton/index.js.map +1 -1
  14. package/components/FitExtent/FitExtent.js.map +1 -1
  15. package/components/FitExtent/index.js.map +1 -1
  16. package/components/Geolocation/Geolocation.js.map +1 -1
  17. package/components/Geolocation/index.js.map +1 -1
  18. package/components/LayerTree/LayerTree.js.map +1 -1
  19. package/components/LayerTree/LayerTree.scss +0 -4
  20. package/components/LayerTree/index.js.map +1 -1
  21. package/components/MousePosition/MousePosition.js.map +1 -1
  22. package/components/MousePosition/index.js.map +1 -1
  23. package/components/NorthArrow/NorthArrow.js.map +1 -1
  24. package/components/NorthArrow/index.js.map +1 -1
  25. package/components/Overlay/Overlay.js +3 -3
  26. package/components/Overlay/Overlay.js.map +2 -2
  27. package/components/Overlay/index.js.map +1 -1
  28. package/components/Permalink/Permalink.js +13 -9
  29. package/components/Permalink/Permalink.js.map +2 -2
  30. package/components/Permalink/index.js.map +1 -1
  31. package/components/Popup/Popup.js.map +1 -1
  32. package/components/Popup/Popup.md.scss +1 -0
  33. package/components/Popup/index.js.map +1 -1
  34. package/components/ResizeHandler/ResizeHandler.js.map +1 -1
  35. package/components/ResizeHandler/index.js.map +1 -1
  36. package/components/RouteSchedule/RouteSchedule.js +16 -7
  37. package/components/RouteSchedule/RouteSchedule.js.map +2 -2
  38. package/components/RouteSchedule/RouteSchedule.scss +8 -8
  39. package/components/RouteSchedule/index.js.map +1 -1
  40. package/components/ScaleLine/ScaleLine.js.map +1 -1
  41. package/components/ScaleLine/ScaleLine.scss +1 -1
  42. package/components/ScaleLine/index.js.map +1 -1
  43. package/components/StopsFinder/StopsFinder.js.map +1 -1
  44. package/components/StopsFinder/StopsFinderOption.js +1 -1
  45. package/components/StopsFinder/StopsFinderOption.js.map +2 -2
  46. package/components/StopsFinder/index.js.map +1 -1
  47. package/components/Zoom/Zoom.js.map +1 -1
  48. package/components/Zoom/Zoom.scss +1 -1
  49. package/components/Zoom/index.js.map +1 -1
  50. package/package.json +34 -44
  51. package/propTypes.js.map +1 -1
  52. package/setupTests.js +2 -0
  53. package/setupTests.js.map +2 -2
  54. package/themes/default/components.scss +9 -9
  55. package/themes/default/examples.scss +15 -15
  56. package/themes/default/index.scss +3 -3
  57. package/themes/default/variables.scss +18 -16
  58. package/utils/GlobalsForOle.js.map +1 -1
  59. package/utils/KML.js +1 -1
  60. package/utils/KML.js.map +2 -2
  61. package/utils/Styles.js.map +1 -1
  62. package/utils/getPolygonPattern.js.map +1 -1
  63. package/utils/timeUtils.js.map +1 -1
  64. package/utils/KMLFormat.js +0 -97
  65. package/utils/KMLFormat.js.map +0 -7
@@ -56,14 +56,14 @@ const defaultRenderStationImg = (stations, index, isStationPassed, isNotStation)
56
56
  }
57
57
  return /* @__PURE__ */ React.createElement("img", { src, alt: "routeScheduleLine", className: "rt-route-icon" });
58
58
  };
59
- const RouteStop = ({
59
+ function RouteStop({
60
60
  lineInfos,
61
61
  onStationClick,
62
62
  trackerLayer,
63
63
  renderStationImg,
64
64
  stop,
65
65
  idx
66
- }) => {
66
+ }) {
67
67
  const {
68
68
  arrivalDelay,
69
69
  departureDelay,
@@ -141,7 +141,7 @@ const RouteStop = ({
141
141
  renderStationImg(stations, idx, isStationPassed, isNotStation),
142
142
  /* @__PURE__ */ React.createElement("div", { className: cancelled ? "rt-route-cancelled" : "" }, stationName)
143
143
  );
144
- };
144
+ }
145
145
  const defaultRenderStation = (props) => {
146
146
  const { stationId, arrivalTime, departureTime, stationName } = props.stop;
147
147
  return /* @__PURE__ */ React.createElement(
@@ -152,16 +152,20 @@ const defaultRenderStation = (props) => {
152
152
  }
153
153
  );
154
154
  };
155
- const renderRouteIdentifier = ({ routeIdentifier, longName }) => {
155
+ const defaultRenderRouteIdentifier = ({ routeIdentifier, longName }) => {
156
156
  if (routeIdentifier) {
157
157
  const id = parseInt(routeIdentifier.split(".")[0], 10);
158
- if (!longName.includes(id)) {
158
+ if (!longName.includes(id) && !Number.isNaN(id)) {
159
159
  return ` (${id})`;
160
160
  }
161
161
  }
162
162
  return null;
163
163
  };
164
- const defaultRenderHeader = ({ lineInfos, renderHeaderButtons }) => {
164
+ const defaultRenderHeader = ({
165
+ lineInfos,
166
+ renderHeaderButtons,
167
+ renderRouteIdentifier
168
+ }) => {
165
169
  const {
166
170
  type,
167
171
  vehicleType,
@@ -193,7 +197,7 @@ const defaultRenderFooter = (props) => {
193
197
  return /* @__PURE__ */ React.createElement("div", { className: "rt-route-footer" }, renderCopyright({ ...props }));
194
198
  };
195
199
  const defaultRenderLink = (text, url) => {
196
- return /* @__PURE__ */ React.createElement("div", { className: "rt-route-copyright-link" }, url ? /* @__PURE__ */ React.createElement("a", { href: url, target: "_blank", rel: "noreferrer" }, text) : /* @__PURE__ */ React.createElement(React.Fragment, null, text));
200
+ return /* @__PURE__ */ React.createElement("div", { className: "rt-route-copyright-link" }, url ? /* @__PURE__ */ React.createElement("a", { href: url, target: "_blank", rel: "noreferrer" }, text) : text);
197
201
  };
198
202
  const defaultRenderCopyright = ({ lineInfos }) => {
199
203
  return /* @__PURE__ */ React.createElement("span", { className: "rt-route-copyright" }, lineInfos.operator && defaultRenderLink(lineInfos.operator, lineInfos.operatorUrl), lineInfos.operator && lineInfos.publisher && /* @__PURE__ */ React.createElement("span", null, "\xA0-\xA0"), lineInfos.publisher && defaultRenderLink(lineInfos.publisher, lineInfos.publisherUrl), lineInfos.license && /* @__PURE__ */ React.createElement("span", null, "\xA0("), lineInfos.license && defaultRenderLink(lineInfos.license, lineInfos.licenseUrl), lineInfos.license && ")");
@@ -223,6 +227,10 @@ const propTypes = {
223
227
  * Render Copyright of the route scheduler.
224
228
  */
225
229
  renderCopyright: PropTypes.func,
230
+ /**
231
+ * Render the route identifier in the header
232
+ */
233
+ renderRouteIdentifier: PropTypes.func,
226
234
  /**
227
235
  * Render the status of the station image.
228
236
  */
@@ -248,6 +256,7 @@ const defaultProps = {
248
256
  renderStationImg: defaultRenderStationImg,
249
257
  renderCopyright: defaultRenderCopyright,
250
258
  renderFooter: defaultRenderFooter,
259
+ renderRouteIdentifier: defaultRenderRouteIdentifier,
251
260
  renderHeaderButtons: () => {
252
261
  return null;
253
262
  },
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/components/RouteSchedule/RouteSchedule.js"],
4
- "sourcesContent": ["/* eslint-disable react/no-unused-prop-types */\n/* eslint-disable react/prop-types */\nimport React, { useEffect, useState } from 'react';\nimport PropTypes from 'prop-types';\nimport {\n RealtimeLayer as TrackerLayer,\n realtimeConfig,\n} from 'mobility-toolbox-js/ol';\nimport { getHoursAndMinutes, getDelayString } from '../../utils/timeUtils';\nimport ReactTransitPropTypes from '../../propTypes';\nimport firstStation from '../../images/RouteSchedule/firstStation.png';\nimport station from '../../images/RouteSchedule/station.png';\nimport lastStation from '../../images/RouteSchedule/lastStation.png';\nimport line from '../../images/RouteSchedule/line.png';\n\nconst { getBgColor } = realtimeConfig;\n\n/**\n * Returns a color class to display the delay.\n * @param {Number} time Delay time in milliseconds.\n */\nconst getDelayColor = (time) => {\n const secs = Math.round(((time / 1800 / 2) * 3600) / 1000);\n if (secs >= 3600) {\n return 'dark-red';\n }\n if (secs >= 500) {\n return 'middle-red';\n }\n if (secs >= 300) {\n return 'light-red';\n }\n if (secs >= 180) {\n return 'orange';\n }\n return 'green';\n};\n\n/**\n * Returns true if the train doesn't stop to the station.\n * @param {Object} stop Station information.\n */\nconst isNotStop = (stop) => {\n return !stop.arrivalTime && !stop.departureTime;\n};\n\n/**\n * Returns if the station has already been passed by the vehicule.\n * @param {Object} stop Station information.\n * @param {number} time The current time to test in ms.\n * @param {Array<Object>} stops the list of all stops of the train.\n * @param {idx} idx The index of the stop object in the stops array.\n */\nconst isPassed = (stop, time, stops, idx) => {\n // If the train doesn't stop to the stop object, we test if the stop just before has been passed or not.\n // if yes the current stop is considered as passed.\n if (isNotStop(stop)) {\n if (stops[idx - 1] && idx > 0) {\n return isPassed(stops[idx - 1], time, stops, idx);\n }\n return true;\n }\n\n // Sometimes stop.departureDelay is undefined.\n const timeToCompare = stop.aimedDepartureTime || stop.aimedArrivalTime || 0;\n let delayToCompare = stop.departureDelay || stop.arrivalDelay || 0;\n\n // It could happens that the delay is negative we simply ignores it.\n if (delayToCompare < 0) {\n delayToCompare = 0;\n }\n\n return timeToCompare + delayToCompare <= time;\n};\n\n/**\n * Returns an image for first, middle or last stations.\n * @param {Number} stations The stations list.\n * @param {Number} index Index of the station in the list.\n * @param {Boolean} isStationPassed If the train is already passed at this station.\n * @param {Boolean} isNotStation If the train doesn't stop to this station.\n */\nconst defaultRenderStationImg = (\n stations,\n index,\n isStationPassed,\n isNotStation,\n) => {\n const { length } = stations;\n let src = station.src || station;\n if (index === 0) {\n src = firstStation.src || firstStation;\n } else if (index === length - 1) {\n src = lastStation.src || lastStation;\n } else if (isNotStation) {\n src = line.src || line;\n }\n return <img src={src} alt=\"routeScheduleLine\" className=\"rt-route-icon\" />;\n};\n\nconst RouteStop = ({\n lineInfos,\n onStationClick,\n trackerLayer,\n renderStationImg,\n stop,\n idx,\n}) => {\n const {\n arrivalDelay,\n departureDelay,\n state,\n stationName,\n aimedArrivalTime,\n aimedDepartureTime,\n } = stop;\n const cancelled = state === 'JOURNEY_CANCELLED' || state === 'STOP_CANCELLED';\n const { stations } = lineInfos;\n const isFirstStation = idx === 0;\n const isLastStation = idx === stations.length - 1;\n const isNotStation = isNotStop(stop);\n const [isStationPassed, setIsStationPassed] = useState(false);\n\n useEffect(() => {\n let timeout = null;\n\n const isStopPassed = isPassed(stop, trackerLayer.time, stations, idx);\n setIsStationPassed(isStopPassed);\n\n // We have to refresh the stop when the state it's time_based\n if (stop.state === 'TIME_BASED' && !isStopPassed) {\n timeout = setInterval(() => {\n setIsStationPassed(isPassed(stop, trackerLayer.time, stations, idx));\n }, 20000);\n }\n return () => {\n clearInterval(timeout);\n };\n }, [stop, trackerLayer, stations, idx]);\n\n return (\n <div\n role=\"button\"\n className={[\n 'rt-route-station',\n isStationPassed ? ' rt-passed' : '',\n isNotStation ? ' rt-no-stop' : '',\n ].join('')}\n onClick={(e) => {\n return onStationClick(stop, e);\n }}\n tabIndex={0}\n onKeyPress={(e) => {\n return e.which === 13 && onStationClick(stop, e);\n }}\n >\n <div className=\"rt-route-delay\">\n {typeof arrivalDelay === 'undefined' || isFirstStation || cancelled ? (\n ''\n ) : (\n <span\n className={`rt-route-delay-arrival${` ${getDelayColor(\n arrivalDelay,\n )}`}`}\n >\n {`+${getDelayString(arrivalDelay)}`}\n </span>\n )}\n {typeof departureDelay === 'undefined' || isLastStation || cancelled ? (\n ''\n ) : (\n <span\n className={`rt-route-delay-departure${` ${getDelayColor(\n departureDelay,\n )}`}`}\n >\n {`+${getDelayString(departureDelay)}`}\n </span>\n )}\n </div>\n <div className=\"rt-route-times\">\n <span\n className={`rt-route-time-arrival ${\n cancelled ? 'rt-route-cancelled' : ''\n }`}\n >\n {getHoursAndMinutes(aimedArrivalTime)}\n </span>\n <span\n className={`rt-route-time-departure ${\n cancelled ? 'rt-route-cancelled' : ''\n }`}\n >\n {getHoursAndMinutes(aimedDepartureTime)}\n </span>\n </div>\n {renderStationImg(stations, idx, isStationPassed, isNotStation)}\n <div className={cancelled ? 'rt-route-cancelled' : ''}>{stationName}</div>\n </div>\n );\n};\n\nconst defaultRenderStation = (props) => {\n const { stationId, arrivalTime, departureTime, stationName } = props.stop;\n // eslint-disable-next-line react/jsx-props-no-spreading\n return (\n <RouteStop\n // Train line can go in circle so begin and end have the same id,\n // using the time in the key should fix the issue.\n key={(stationId || stationName) + arrivalTime + departureTime}\n // eslint-disable-next-line react/jsx-props-no-spreading\n {...props}\n />\n );\n};\n\nconst renderRouteIdentifier = ({ routeIdentifier, longName }) => {\n if (routeIdentifier) {\n // first part of the id, without leading zeros.\n const id = parseInt(routeIdentifier.split('.')[0], 10);\n if (!longName.includes(id)) {\n return ` (${id})`;\n }\n }\n return null;\n};\n\nconst defaultRenderHeader = ({ lineInfos, renderHeaderButtons }) => {\n const {\n type,\n vehicleType,\n shortName,\n longName,\n stroke,\n destination,\n routeIdentifier,\n text_color: textColor,\n } = lineInfos;\n return (\n <div className=\"rt-route-header\">\n <span\n className=\"rt-route-icon\"\n style={{\n /* stylelint-disable-next-line value-keyword-case */\n backgroundColor: stroke || getBgColor(type || vehicleType),\n color: textColor || 'black',\n }}\n >\n {shortName}\n </span>\n <div className=\"rt-route-title\">\n <span className=\"rt-route-name\">{destination}</span>\n <span>\n {longName}\n {renderRouteIdentifier(lineInfos)}\n </span>\n </div>\n <div className=\"rt-route-buttons\">\n {renderHeaderButtons(routeIdentifier)}\n </div>\n </div>\n );\n};\n\nconst defaultRenderFooter = (props) => {\n const { lineInfos, renderCopyright } = props;\n if (!lineInfos.operator && !lineInfos.publisher) {\n return null;\n }\n return <div className=\"rt-route-footer\">{renderCopyright({ ...props })}</div>;\n};\n\nconst defaultRenderLink = (text, url) => {\n return (\n <div className=\"rt-route-copyright-link\">\n {url ? (\n <a href={url} target=\"_blank\" rel=\"noreferrer\">\n {text}\n </a>\n ) : (\n <>{text}</>\n )}\n </div>\n );\n};\n\nconst defaultRenderCopyright = ({ lineInfos }) => {\n return (\n <span className=\"rt-route-copyright\">\n {lineInfos.operator &&\n defaultRenderLink(lineInfos.operator, lineInfos.operatorUrl)}\n {lineInfos.operator && lineInfos.publisher && <span>&nbsp;-&nbsp;</span>}\n {lineInfos.publisher &&\n defaultRenderLink(lineInfos.publisher, lineInfos.publisherUrl)}\n {lineInfos.license && <span>&nbsp;(</span>}\n {lineInfos.license &&\n defaultRenderLink(lineInfos.license, lineInfos.licenseUrl)}\n {lineInfos.license && ')'}\n </span>\n );\n};\n\nconst propTypes = {\n /**\n * CSS class of the route schedule wrapper.\n */\n className: PropTypes.string,\n\n /**\n * Trajectory stations informations.\n */\n lineInfos: ReactTransitPropTypes.lineInfos,\n\n /**\n * Trackerlayer.\n */\n trackerLayer: PropTypes.instanceOf(TrackerLayer).isRequired,\n\n /**\n * Render Header of the route scheduler.\n */\n renderHeader: PropTypes.func,\n\n /**\n * Render Footer of the route scheduler.\n */\n renderFooter: PropTypes.func,\n\n /**\n * Render Copyright of the route scheduler.\n */\n renderCopyright: PropTypes.func,\n\n /**\n * Render the status of the station image.\n */\n renderStationImg: PropTypes.func,\n\n /**\n * Render a station.\n */\n renderStation: PropTypes.func,\n\n /**\n * Function triggered on station's click event.\n */\n onStationClick: PropTypes.func,\n\n /**\n * Function to render header buttons.\n */\n renderHeaderButtons: PropTypes.func,\n};\n\nconst defaultProps = {\n className: 'rt-route-schedule',\n lineInfos: null,\n renderHeader: defaultRenderHeader,\n renderStation: defaultRenderStation,\n renderStationImg: defaultRenderStationImg,\n renderCopyright: defaultRenderCopyright,\n renderFooter: defaultRenderFooter,\n renderHeaderButtons: () => {\n return null;\n },\n onStationClick: () => {},\n};\n\n/**\n * RouteSchedule displays information, stops and punctuality about the clicked route.\n */\nfunction RouteSchedule(props) {\n const { lineInfos, className, renderStation, renderHeader, renderFooter } =\n props;\n\n if (!lineInfos) {\n return null;\n }\n\n return (\n <div className={className}>\n {renderHeader({ ...props })}\n <div className=\"rt-route-body\">\n {lineInfos.stations.map((stop, idx) => {\n return renderStation({ ...props, stop, idx });\n })}\n </div>\n {renderFooter({ ...props })}\n </div>\n );\n}\n\nRouteSchedule.propTypes = propTypes;\nRouteSchedule.defaultProps = defaultProps;\n\nexport default React.memo(RouteSchedule);\n"],
5
- "mappings": "AAEA,OAAO,SAAS,WAAW,gBAAgB;AAC3C,OAAO,eAAe;AACtB;AAAA,EACE,iBAAiB;AAAA,EACjB;AAAA,OACK;AACP,SAAS,oBAAoB,sBAAsB;AACnD,OAAO,2BAA2B;AAClC,OAAO,kBAAkB;AACzB,OAAO,aAAa;AACpB,OAAO,iBAAiB;AACxB,OAAO,UAAU;AAEjB,MAAM,EAAE,WAAW,IAAI;AAMvB,MAAM,gBAAgB,CAAC,SAAS;AAC9B,QAAM,OAAO,KAAK,MAAQ,OAAO,OAAO,IAAK,OAAQ,GAAI;AACzD,MAAI,QAAQ,MAAM;AAChB,WAAO;AAAA,EACT;AACA,MAAI,QAAQ,KAAK;AACf,WAAO;AAAA,EACT;AACA,MAAI,QAAQ,KAAK;AACf,WAAO;AAAA,EACT;AACA,MAAI,QAAQ,KAAK;AACf,WAAO;AAAA,EACT;AACA,SAAO;AACT;AAMA,MAAM,YAAY,CAAC,SAAS;AAC1B,SAAO,CAAC,KAAK,eAAe,CAAC,KAAK;AACpC;AASA,MAAM,WAAW,CAAC,MAAM,MAAM,OAAO,QAAQ;AAG3C,MAAI,UAAU,IAAI,GAAG;AACnB,QAAI,MAAM,MAAM,CAAC,KAAK,MAAM,GAAG;AAC7B,aAAO,SAAS,MAAM,MAAM,CAAC,GAAG,MAAM,OAAO,GAAG;AAAA,IAClD;AACA,WAAO;AAAA,EACT;AAGA,QAAM,gBAAgB,KAAK,sBAAsB,KAAK,oBAAoB;AAC1E,MAAI,iBAAiB,KAAK,kBAAkB,KAAK,gBAAgB;AAGjE,MAAI,iBAAiB,GAAG;AACtB,qBAAiB;AAAA,EACnB;AAEA,SAAO,gBAAgB,kBAAkB;AAC3C;AASA,MAAM,0BAA0B,CAC9B,UACA,OACA,iBACA,iB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I,CAAC,MAAM,QAAQ;AACrC,WAAO,cAAc,EAAE,GAAG,OAAO,MAAM,IAAI,CAAC;AAAA,EAC9C,CAAC,CACH,GACC,aAAa,EAAE,GAAG,MAAM,CAAC,CAC5B;AAEJ;AAEA,cAAc,YAAY;AAC1B,cAAc,eAAe;AAE7B,eAAe,MAAM,KAAK,aAAa;",
4
+ "sourcesContent": ["/* eslint-disable react/no-unused-prop-types */\n/* eslint-disable react/prop-types */\nimport React, { useEffect, useState } from \"react\";\nimport PropTypes from \"prop-types\";\nimport {\n RealtimeLayer as TrackerLayer,\n realtimeConfig,\n} from \"mobility-toolbox-js/ol\";\nimport { getHoursAndMinutes, getDelayString } from \"../../utils/timeUtils\";\nimport ReactTransitPropTypes from \"../../propTypes\";\nimport firstStation from \"../../images/RouteSchedule/firstStation.png\";\nimport station from \"../../images/RouteSchedule/station.png\";\nimport lastStation from \"../../images/RouteSchedule/lastStation.png\";\nimport line from \"../../images/RouteSchedule/line.png\";\n\nconst { getBgColor } = realtimeConfig;\n\n/**\n * Returns a color class to display the delay.\n * @param {Number} time Delay time in milliseconds.\n */\nconst getDelayColor = (time) => {\n const secs = Math.round(((time / 1800 / 2) * 3600) / 1000);\n if (secs >= 3600) {\n return \"dark-red\";\n }\n if (secs >= 500) {\n return \"middle-red\";\n }\n if (secs >= 300) {\n return \"light-red\";\n }\n if (secs >= 180) {\n return \"orange\";\n }\n return \"green\";\n};\n\n/**\n * Returns true if the train doesn't stop to the station.\n * @param {Object} stop Station information.\n */\nconst isNotStop = (stop) => {\n return !stop.arrivalTime && !stop.departureTime;\n};\n\n/**\n * Returns if the station has already been passed by the vehicule.\n * @param {Object} stop Station information.\n * @param {number} time The current time to test in ms.\n * @param {Array<Object>} stops the list of all stops of the train.\n * @param {idx} idx The index of the stop object in the stops array.\n */\nconst isPassed = (stop, time, stops, idx) => {\n // If the train doesn't stop to the stop object, we test if the stop just before has been passed or not.\n // if yes the current stop is considered as passed.\n if (isNotStop(stop)) {\n if (stops[idx - 1] && idx > 0) {\n return isPassed(stops[idx - 1], time, stops, idx);\n }\n return true;\n }\n\n // Sometimes stop.departureDelay is undefined.\n const timeToCompare = stop.aimedDepartureTime || stop.aimedArrivalTime || 0;\n let delayToCompare = stop.departureDelay || stop.arrivalDelay || 0;\n\n // It could happens that the delay is negative we simply ignores it.\n if (delayToCompare < 0) {\n delayToCompare = 0;\n }\n\n return timeToCompare + delayToCompare <= time;\n};\n\n/**\n * Returns an image for first, middle or last stations.\n * @param {Number} stations The stations list.\n * @param {Number} index Index of the station in the list.\n * @param {Boolean} isStationPassed If the train is already passed at this station.\n * @param {Boolean} isNotStation If the train doesn't stop to this station.\n */\nconst defaultRenderStationImg = (\n stations,\n index,\n isStationPassed,\n isNotStation,\n) => {\n const { length } = stations;\n let src = station.src || station;\n if (index === 0) {\n src = firstStation.src || firstStation;\n } else if (index === length - 1) {\n src = lastStation.src || lastStation;\n } else if (isNotStation) {\n src = line.src || line;\n }\n return <img src={src} alt=\"routeScheduleLine\" className=\"rt-route-icon\" />;\n};\n\nfunction RouteStop({\n lineInfos,\n onStationClick,\n trackerLayer,\n renderStationImg,\n stop,\n idx,\n}) {\n const {\n arrivalDelay,\n departureDelay,\n state,\n stationName,\n aimedArrivalTime,\n aimedDepartureTime,\n } = stop;\n const cancelled = state === \"JOURNEY_CANCELLED\" || state === \"STOP_CANCELLED\";\n const { stations } = lineInfos;\n const isFirstStation = idx === 0;\n const isLastStation = idx === stations.length - 1;\n const isNotStation = isNotStop(stop);\n const [isStationPassed, setIsStationPassed] = useState(false);\n\n useEffect(() => {\n let timeout = null;\n\n const isStopPassed = isPassed(stop, trackerLayer.time, stations, idx);\n setIsStationPassed(isStopPassed);\n\n // We have to refresh the stop when the state it's time_based\n if (stop.state === \"TIME_BASED\" && !isStopPassed) {\n timeout = setInterval(() => {\n setIsStationPassed(isPassed(stop, trackerLayer.time, stations, idx));\n }, 20000);\n }\n return () => {\n clearInterval(timeout);\n };\n }, [stop, trackerLayer, stations, idx]);\n\n return (\n <div\n role=\"button\"\n className={[\n \"rt-route-station\",\n isStationPassed ? \" rt-passed\" : \"\",\n isNotStation ? \" rt-no-stop\" : \"\",\n ].join(\"\")}\n onClick={(e) => {\n return onStationClick(stop, e);\n }}\n tabIndex={0}\n onKeyPress={(e) => {\n return e.which === 13 && onStationClick(stop, e);\n }}\n >\n <div className=\"rt-route-delay\">\n {typeof arrivalDelay === \"undefined\" || isFirstStation || cancelled ? (\n \"\"\n ) : (\n <span\n className={`rt-route-delay-arrival${` ${getDelayColor(\n arrivalDelay,\n )}`}`}\n >\n {`+${getDelayString(arrivalDelay)}`}\n </span>\n )}\n {typeof departureDelay === \"undefined\" || isLastStation || cancelled ? (\n \"\"\n ) : (\n <span\n className={`rt-route-delay-departure${` ${getDelayColor(\n departureDelay,\n )}`}`}\n >\n {`+${getDelayString(departureDelay)}`}\n </span>\n )}\n </div>\n <div className=\"rt-route-times\">\n <span\n className={`rt-route-time-arrival ${\n cancelled ? \"rt-route-cancelled\" : \"\"\n }`}\n >\n {getHoursAndMinutes(aimedArrivalTime)}\n </span>\n <span\n className={`rt-route-time-departure ${\n cancelled ? \"rt-route-cancelled\" : \"\"\n }`}\n >\n {getHoursAndMinutes(aimedDepartureTime)}\n </span>\n </div>\n {renderStationImg(stations, idx, isStationPassed, isNotStation)}\n <div className={cancelled ? \"rt-route-cancelled\" : \"\"}>{stationName}</div>\n </div>\n );\n}\n\nconst defaultRenderStation = (props) => {\n const { stationId, arrivalTime, departureTime, stationName } = props.stop;\n // eslint-disable-next-line react/jsx-props-no-spreading\n return (\n <RouteStop\n // Train line can go in circle so begin and end have the same id,\n // using the time in the key should fix the issue.\n key={(stationId || stationName) + arrivalTime + departureTime}\n // eslint-disable-next-line react/jsx-props-no-spreading\n {...props}\n />\n );\n};\n\nconst defaultRenderRouteIdentifier = ({ routeIdentifier, longName }) => {\n if (routeIdentifier) {\n // first part of the id, without leading zeros.\n const id = parseInt(routeIdentifier.split(\".\")[0], 10);\n if (!longName.includes(id) && !Number.isNaN(id)) {\n return ` (${id})`;\n }\n }\n return null;\n};\n\nconst defaultRenderHeader = ({\n lineInfos,\n renderHeaderButtons,\n renderRouteIdentifier,\n}) => {\n const {\n type,\n vehicleType,\n shortName,\n longName,\n stroke,\n destination,\n routeIdentifier,\n text_color: textColor,\n } = lineInfos;\n return (\n <div className=\"rt-route-header\">\n <span\n className=\"rt-route-icon\"\n style={{\n /* stylelint-disable-next-line value-keyword-case */\n backgroundColor: stroke || getBgColor(type || vehicleType),\n color: textColor || \"black\",\n }}\n >\n {shortName}\n </span>\n <div className=\"rt-route-title\">\n <span className=\"rt-route-name\">{destination}</span>\n <span>\n {longName}\n {renderRouteIdentifier(lineInfos)}\n </span>\n </div>\n <div className=\"rt-route-buttons\">\n {renderHeaderButtons(routeIdentifier)}\n </div>\n </div>\n );\n};\n\nconst defaultRenderFooter = (props) => {\n const { lineInfos, renderCopyright } = props;\n if (!lineInfos.operator && !lineInfos.publisher) {\n return null;\n }\n return <div className=\"rt-route-footer\">{renderCopyright({ ...props })}</div>;\n};\n\nconst defaultRenderLink = (text, url) => {\n return (\n <div className=\"rt-route-copyright-link\">\n {url ? (\n <a href={url} target=\"_blank\" rel=\"noreferrer\">\n {text}\n </a>\n ) : (\n text\n )}\n </div>\n );\n};\n\nconst defaultRenderCopyright = ({ lineInfos }) => {\n return (\n <span className=\"rt-route-copyright\">\n {lineInfos.operator &&\n defaultRenderLink(lineInfos.operator, lineInfos.operatorUrl)}\n {lineInfos.operator && lineInfos.publisher && <span>&nbsp;-&nbsp;</span>}\n {lineInfos.publisher &&\n defaultRenderLink(lineInfos.publisher, lineInfos.publisherUrl)}\n {lineInfos.license && <span>&nbsp;(</span>}\n {lineInfos.license &&\n defaultRenderLink(lineInfos.license, lineInfos.licenseUrl)}\n {lineInfos.license && \")\"}\n </span>\n );\n};\n\nconst propTypes = {\n /**\n * CSS class of the route schedule wrapper.\n */\n className: PropTypes.string,\n\n /**\n * Trajectory stations informations.\n */\n lineInfos: ReactTransitPropTypes.lineInfos,\n\n /**\n * Trackerlayer.\n */\n trackerLayer: PropTypes.instanceOf(TrackerLayer).isRequired,\n\n /**\n * Render Header of the route scheduler.\n */\n renderHeader: PropTypes.func,\n\n /**\n * Render Footer of the route scheduler.\n */\n renderFooter: PropTypes.func,\n\n /**\n * Render Copyright of the route scheduler.\n */\n renderCopyright: PropTypes.func,\n\n /**\n * Render the route identifier in the header\n */\n renderRouteIdentifier: PropTypes.func,\n\n /**\n * Render the status of the station image.\n */\n renderStationImg: PropTypes.func,\n\n /**\n * Render a station.\n */\n renderStation: PropTypes.func,\n\n /**\n * Function triggered on station's click event.\n */\n onStationClick: PropTypes.func,\n\n /**\n * Function to render header buttons.\n */\n renderHeaderButtons: PropTypes.func,\n};\n\nconst defaultProps = {\n className: \"rt-route-schedule\",\n lineInfos: null,\n renderHeader: defaultRenderHeader,\n renderStation: defaultRenderStation,\n renderStationImg: defaultRenderStationImg,\n renderCopyright: defaultRenderCopyright,\n renderFooter: defaultRenderFooter,\n renderRouteIdentifier: defaultRenderRouteIdentifier,\n renderHeaderButtons: () => {\n return null;\n },\n onStationClick: () => {},\n};\n\n/**\n * RouteSchedule displays information, stops and punctuality about the clicked route.\n */\nfunction RouteSchedule(props) {\n const { lineInfos, className, renderStation, renderHeader, renderFooter } =\n props;\n\n if (!lineInfos) {\n return null;\n }\n\n return (\n <div className={className}>\n {renderHeader({ ...props })}\n <div className=\"rt-route-body\">\n {lineInfos.stations.map((stop, idx) => {\n return renderStation({ ...props, stop, idx });\n })}\n </div>\n {renderFooter({ ...props })}\n </div>\n );\n}\n\nRouteSchedule.propTypes = propTypes;\nRouteSchedule.defaultProps = defaultProps;\n\nexport default React.memo(RouteSchedule);\n"],
5
+ "mappings": "AAEA,OAAO,SAAS,WAAW,gBAAgB;AAC3C,OAAO,eAAe;AACtB;AAAA,EACE,iBAAiB;AAAA,EACjB;AAAA,OACK;AACP,SAAS,oBAAoB,sBAAsB;AACnD,OAAO,2BAA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B,eAAe,MAAM,KAAK,aAAa;",
6
6
  "names": []
7
7
  }
@@ -6,7 +6,7 @@
6
6
  .rt-route-header {
7
7
  display: flex;
8
8
  align-items: center;
9
- padding: 15px 10px 0 10px;
9
+ padding: 15px 10px 0;
10
10
 
11
11
  .rt-route-title {
12
12
  display: flex;
@@ -25,7 +25,7 @@
25
25
  button {
26
26
  width: 35px;
27
27
  height: 35px;
28
- margin: 10px 5px 15px 5px;
28
+ margin: 10px 5px 15px;
29
29
  color: black;
30
30
  }
31
31
  }
@@ -87,23 +87,23 @@
87
87
  padding: 0 3px;
88
88
 
89
89
  .green {
90
- color: rgb(0, 160, 12);
90
+ color: rgb(0 160 12);
91
91
  }
92
92
 
93
93
  .orange {
94
- color: rgb(247, 191, 0);
94
+ color: rgb(247 191 0);
95
95
  }
96
96
 
97
97
  .light-red {
98
- color: rgb(255, 74, 0);
98
+ color: rgb(255 74 0);
99
99
  }
100
100
 
101
101
  .middle-red {
102
- color: rgb(232, 0, 0);
102
+ color: rgb(232 0 0);
103
103
  }
104
104
 
105
105
  .dark-red {
106
- color: rgb(237, 0, 76);
106
+ color: rgb(237 0 76);
107
107
  }
108
108
  }
109
109
  }
@@ -140,6 +140,6 @@
140
140
 
141
141
  .rt-route-cancelled {
142
142
  text-decoration: line-through;
143
- color: rgb(236, 43, 43);
143
+ color: rgb(236 43 43);
144
144
  }
145
145
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/components/RouteSchedule/index.js"],
4
- "sourcesContent": ["export { default } from './RouteSchedule';\n"],
4
+ "sourcesContent": ["export { default } from \"./RouteSchedule\";\n"],
5
5
  "mappings": "AAAA,SAAS,eAAe;",
6
6
  "names": []
7
7
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/components/ScaleLine/ScaleLine.js"],
4
- "sourcesContent": ["import React, { useRef, useEffect } from 'react';\nimport PropTypes from 'prop-types';\nimport OLScaleLine from 'ol/control/ScaleLine';\nimport OLMap from 'ol/Map';\n\nconst propTypes = {\n /**\n * ol/map.\n */\n map: PropTypes.instanceOf(OLMap).isRequired,\n\n /**\n * Options for ol/control/ScaleLine.\n * See https://openlayers.org/en/latest/apidoc/module-ol_control_ScaleLine-ScaleLine.html\n */\n options: PropTypes.object,\n};\n\nconst defaultProps = {\n options: {},\n};\n\n/**\n * The ScaleLine component creates an\n * [ol/control/ScaleLine](https://openlayers.org/en/latest/apidoc/module-ol_control_ScaleLine-ScaleLine.html)\n * for an [ol/map](https://openlayers.org/en/latest/apidoc/module-ol_Map-Map.html).\n */\nfunction ScaleLine({ map, options, ...other }) {\n const ref = useRef();\n\n useEffect(() => {\n const control = new OLScaleLine({\n ...options,\n ...{ target: ref.current },\n });\n\n map.addControl(control);\n return () => {\n map.removeControl(control);\n };\n }, [map, options]);\n\n // eslint-disable-next-line react/jsx-props-no-spreading\n return <div className=\"rs-scale-line\" ref={ref} {...other} />;\n}\n\nScaleLine.propTypes = propTypes;\nScaleLine.defaultProps = defaultProps;\n\nexport default React.memo(ScaleLine);\n"],
4
+ "sourcesContent": ["import React, { useRef, useEffect } from \"react\";\nimport PropTypes from \"prop-types\";\nimport OLScaleLine from \"ol/control/ScaleLine\";\nimport OLMap from \"ol/Map\";\n\nconst propTypes = {\n /**\n * ol/map.\n */\n map: PropTypes.instanceOf(OLMap).isRequired,\n\n /**\n * Options for ol/control/ScaleLine.\n * See https://openlayers.org/en/latest/apidoc/module-ol_control_ScaleLine-ScaleLine.html\n */\n options: PropTypes.object,\n};\n\nconst defaultProps = {\n options: {},\n};\n\n/**\n * The ScaleLine component creates an\n * [ol/control/ScaleLine](https://openlayers.org/en/latest/apidoc/module-ol_control_ScaleLine-ScaleLine.html)\n * for an [ol/map](https://openlayers.org/en/latest/apidoc/module-ol_Map-Map.html).\n */\nfunction ScaleLine({ map, options, ...other }) {\n const ref = useRef();\n\n useEffect(() => {\n const control = new OLScaleLine({\n ...options,\n ...{ target: ref.current },\n });\n\n map.addControl(control);\n return () => {\n map.removeControl(control);\n };\n }, [map, options]);\n\n // eslint-disable-next-line react/jsx-props-no-spreading\n return <div className=\"rs-scale-line\" ref={ref} {...other} />;\n}\n\nScaleLine.propTypes = propTypes;\nScaleLine.defaultProps = defaultProps;\n\nexport default React.memo(ScaleLine);\n"],
5
5
  "mappings": "AAAA,OAAO,SAAS,QAAQ,iBAAiB;AACzC,OAAO,eAAe;AACtB,OAAO,iBAAiB;AACxB,OAAO,WAAW;AAElB,MAAM,YAAY;AAAA;AAAA;AAAA;AAAA,EAIhB,KAAK,UAAU,WAAW,KAAK,EAAE;AAAA;AAAA;AAAA;AAAA;AAAA,EAMjC,SAAS,UAAU;AACrB;AAEA,MAAM,eAAe;AAAA,EACnB,SAAS,CAAC;AACZ;AAOA,SAAS,UAAU,EAAE,KAAK,SAAS,GAAG,MAAM,GAAG;AAC7C,QAAM,MAAM,OAAO;AAEnB,YAAU,MAAM;AACd,UAAM,UAAU,IAAI,YAAY;AAAA,MAC9B,GAAG;AAAA,MACH,GAAG,EAAE,QAAQ,IAAI,QAAQ;AAAA,IAC3B,CAAC;AAED,QAAI,WAAW,OAAO;AACtB,WAAO,MAAM;AACX,UAAI,cAAc,OAAO;AAAA,IAC3B;AAAA,EACF,GAAG,CAAC,KAAK,OAAO,CAAC;AAGjB,SAAO,oCAAC,SAAI,WAAU,iBAAgB,KAAW,GAAG,OAAO;AAC7D;AAEA,UAAU,YAAY;AACtB,UAAU,eAAe;AAEzB,eAAe,MAAM,KAAK,SAAS;",
6
6
  "names": []
7
7
  }
@@ -1,5 +1,5 @@
1
1
  .rs-scale-line .ol-scale-line-inner {
2
- border-width: 0 1px 1px 1px;
2
+ border-width: 0 1px 1px;
3
3
  border-color: 1px solid $gray;
4
4
  border-style: solid;
5
5
  padding: $padding-base;
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/components/ScaleLine/index.js"],
4
- "sourcesContent": ["export { default } from './ScaleLine';\n"],
4
+ "sourcesContent": ["export { default } from \"./ScaleLine\";\n"],
5
5
  "mappings": "AAAA,SAAS,eAAe;",
6
6
  "names": []
7
7
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/components/StopsFinder/StopsFinder.js"],
4
- "sourcesContent": ["import React, { useMemo, useState, useEffect } from 'react';\nimport PropTypes from 'prop-types';\nimport { Autocomplete } from '@material-ui/lab';\nimport { FaSearch } from 'react-icons/fa';\nimport TextField from '@material-ui/core/TextField';\nimport CircularProgress from '@material-ui/core/CircularProgress';\nimport { StopFinderControl } from 'mobility-toolbox-js/ol';\nimport { Map } from 'ol';\nimport { makeStyles } from '@material-ui/core';\nimport StopsFinderOptions from './StopsFinderOption';\n\nconst useStyles = makeStyles(() => {\n return {\n popupIndicatorOpen: {\n transform: 'rotate(0)',\n },\n };\n});\n\nfunction StopsFinder({\n agencies,\n apiKey,\n autocompleteProps,\n bbox,\n field,\n limit,\n map,\n mots,\n onSelect,\n radius,\n refLocation,\n renderAutocomplete,\n url,\n}) {\n const classes = useStyles();\n const [inputValue, setInputValue] = useState('');\n const [suggestions, setSuggestions] = useState([]);\n const [isLoading, setLoading] = useState(false);\n const [isOpen, setOpen] = useState(false);\n\n const control = useMemo(() => {\n return new StopFinderControl({\n url,\n apiKey,\n target: document.createElement('div'),\n element: document.createElement('div'),\n render(newSuggestions = { features: [] }) {\n setSuggestions(newSuggestions.features);\n setLoading(false);\n },\n });\n }, [apiKey, url]);\n\n useEffect(() => {\n if (!inputValue) {\n setSuggestions([]);\n setLoading(false);\n return () => {};\n }\n const abortController = new AbortController();\n setLoading(true);\n control.apiParams = {\n prefAgencies: agencies && agencies.toString(),\n bbox: bbox && bbox.toString(),\n field: field && field.toString(),\n limit,\n mots: mots && mots.toString(),\n radius,\n ref_location: refLocation && refLocation.toString(),\n };\n control.search(inputValue, abortController);\n return () => {\n abortController.abort();\n };\n }, [\n agencies,\n bbox,\n control,\n field,\n inputValue,\n limit,\n mots,\n radius,\n refLocation,\n ]);\n\n // Ensure the control is not associated to the wrong map\n useEffect(() => {\n if (!control) {\n return () => {};\n }\n\n control.map = map;\n\n return () => {\n control.map = null;\n };\n }, [map, control]);\n\n if (!control) {\n return null;\n }\n\n if (renderAutocomplete) {\n return renderAutocomplete(\n suggestions,\n inputValue,\n setInputValue,\n isOpen,\n setOpen,\n isLoading,\n setLoading,\n );\n }\n const textFieldProps = {\n ...((autocompleteProps || {}).textFieldProps || {}),\n };\n const autocProps = { ...autocompleteProps };\n delete autocProps.textFieldProps;\n\n return (\n <Autocomplete\n fullWidth\n autoComplete\n autoHighlight\n selectOnFocus\n getOptionLabel={(option) => {\n return option.properties.name;\n }}\n onChange={(evt, value, reason) => {\n if (onSelect && reason === 'select-option') {\n onSelect(value, evt);\n }\n }}\n popupIcon={<FaSearch focusable={false} size={15} />}\n renderInput={(params) => {\n return (\n <TextField\n label=\"Search stops\"\n // eslint-disable-next-line react/jsx-props-no-spreading\n {...{\n ...params,\n ...textFieldProps,\n }}\n InputProps={{\n ...params.InputProps,\n endAdornment: (\n <>\n {isLoading && <CircularProgress size={20} />}\n {params.InputProps.endAdornment}\n </>\n ),\n }}\n />\n );\n }}\n renderOption={(option) => {\n return <StopsFinderOptions option={option} />;\n }}\n // eslint-disable-next-line react/jsx-props-no-spreading\n {...autocProps}\n classes={{ ...classes, ...autocompleteProps.classes }}\n inputValue={inputValue}\n open={isOpen}\n options={suggestions}\n loading={isLoading}\n onOpen={() => {\n setOpen(true);\n }}\n onClose={() => {\n setOpen(false);\n }}\n onInputChange={(evt, val) => {\n setInputValue(val);\n }}\n />\n );\n}\n\nStopsFinder.propTypes = {\n /**\n * Array or a comma separated list of agencies which should be available.\n * Order of these agencies chooses which agency will be preferred.\n * Available values : sbb, db\n */\n agencies: PropTypes.oneOfType([\n PropTypes.string,\n PropTypes.arrayOf(PropTypes.string),\n ]),\n\n /**\n * geOps api key to access the StopsFinder service.\n */\n apiKey: PropTypes.string,\n\n /**\n * Properties apply to the default [MUI Autocomplete component](https://material-ui.com/api/autocomplete/).\n * We add a custom properties textFieldProps for the default [MUI TextField component](https://material-ui.com/api/text-field/) used by the Autocomplete.\n */\n autocompleteProps: PropTypes.object,\n\n /**\n * minX,minY,maxX,maxY coordinates in WGS84 wherein the station should lie.\n */\n bbox: PropTypes.oneOfType([\n PropTypes.string,\n PropTypes.arrayOf(PropTypes.number),\n ]),\n\n /**\n * Array or a comma separated list of fields which should be used for look up.\n * Available values : id, name, coords\n */\n field: PropTypes.oneOfType([\n PropTypes.string,\n PropTypes.arrayOf(PropTypes.string),\n ]),\n\n /**\n * Control how many matches will be returned.\n */\n limit: PropTypes.number,\n\n /**\n * A map.\n */\n map: PropTypes.instanceOf(Map).isRequired,\n\n /**\n * Array or a comma separated list of mode of transpaorts which should be available.\n * Available values : bus, ferry, gondola, tram, rail, funicular, cable_car, subway\n */\n mots: PropTypes.oneOfType([\n PropTypes.string,\n PropTypes.arrayOf(PropTypes.string),\n ]),\n\n /**\n * Function called when a suggestion is selected.\n */\n onSelect: PropTypes.func,\n\n /**\n * Radius around refLocation in meters that is most relevant.\n * Used as granularity for location rank.\n */\n radius: PropTypes.number,\n\n /**\n * Coordinates in WGS84 (in lat,lon order) used to rank stops close to this position higher.\n * Available values : id, name, coords\n */\n refLocation: PropTypes.oneOfType([\n PropTypes.string,\n PropTypes.arrayOf(PropTypes.number),\n ]),\n\n /**\n * Function to render a different autocomplete input than the default one.\n */\n renderAutocomplete: PropTypes.func,\n\n /**\n * Url of the geOps StopsFinder service.\n */\n url: PropTypes.string,\n};\n\nStopsFinder.defaultProps = {\n agencies: null,\n apiKey: null,\n autocompleteProps: {},\n bbox: null,\n field: null,\n limit: null,\n mots: null,\n onSelect: null,\n radius: null,\n refLocation: null,\n url: null,\n renderAutocomplete: null,\n};\n\nexport default StopsFinder;\n"],
4
+ "sourcesContent": ["import React, { useMemo, useState, useEffect } from \"react\";\nimport PropTypes from \"prop-types\";\nimport { Autocomplete } from \"@material-ui/lab\";\nimport { FaSearch } from \"react-icons/fa\";\nimport TextField from \"@material-ui/core/TextField\";\nimport CircularProgress from \"@material-ui/core/CircularProgress\";\nimport { StopFinderControl } from \"mobility-toolbox-js/ol\";\nimport { Map } from \"ol\";\nimport { makeStyles } from \"@material-ui/core\";\nimport StopsFinderOptions from \"./StopsFinderOption\";\n\nconst useStyles = makeStyles(() => {\n return {\n popupIndicatorOpen: {\n transform: \"rotate(0)\",\n },\n };\n});\n\nfunction StopsFinder({\n agencies,\n apiKey,\n autocompleteProps,\n bbox,\n field,\n limit,\n map,\n mots,\n onSelect,\n radius,\n refLocation,\n renderAutocomplete,\n url,\n}) {\n const classes = useStyles();\n const [inputValue, setInputValue] = useState(\"\");\n const [suggestions, setSuggestions] = useState([]);\n const [isLoading, setLoading] = useState(false);\n const [isOpen, setOpen] = useState(false);\n\n const control = useMemo(() => {\n return new StopFinderControl({\n url,\n apiKey,\n target: document.createElement(\"div\"),\n element: document.createElement(\"div\"),\n render(newSuggestions = { features: [] }) {\n setSuggestions(newSuggestions.features);\n setLoading(false);\n },\n });\n }, [apiKey, url]);\n\n useEffect(() => {\n if (!inputValue) {\n setSuggestions([]);\n setLoading(false);\n return () => {};\n }\n const abortController = new AbortController();\n setLoading(true);\n control.apiParams = {\n prefAgencies: agencies && agencies.toString(),\n bbox: bbox && bbox.toString(),\n field: field && field.toString(),\n limit,\n mots: mots && mots.toString(),\n radius,\n ref_location: refLocation && refLocation.toString(),\n };\n control.search(inputValue, abortController);\n return () => {\n abortController.abort();\n };\n }, [\n agencies,\n bbox,\n control,\n field,\n inputValue,\n limit,\n mots,\n radius,\n refLocation,\n ]);\n\n // Ensure the control is not associated to the wrong map\n useEffect(() => {\n if (!control) {\n return () => {};\n }\n\n control.map = map;\n\n return () => {\n control.map = null;\n };\n }, [map, control]);\n\n if (!control) {\n return null;\n }\n\n if (renderAutocomplete) {\n return renderAutocomplete(\n suggestions,\n inputValue,\n setInputValue,\n isOpen,\n setOpen,\n isLoading,\n setLoading,\n );\n }\n const textFieldProps = {\n ...((autocompleteProps || {}).textFieldProps || {}),\n };\n const autocProps = { ...autocompleteProps };\n delete autocProps.textFieldProps;\n\n return (\n <Autocomplete\n fullWidth\n autoComplete\n autoHighlight\n selectOnFocus\n getOptionLabel={(option) => {\n return option.properties.name;\n }}\n onChange={(evt, value, reason) => {\n if (onSelect && reason === \"select-option\") {\n onSelect(value, evt);\n }\n }}\n popupIcon={<FaSearch focusable={false} size={15} />}\n renderInput={(params) => {\n return (\n <TextField\n label=\"Search stops\"\n // eslint-disable-next-line react/jsx-props-no-spreading\n {...{\n ...params,\n ...textFieldProps,\n }}\n InputProps={{\n ...params.InputProps,\n endAdornment: (\n <>\n {isLoading && <CircularProgress size={20} />}\n {params.InputProps.endAdornment}\n </>\n ),\n }}\n />\n );\n }}\n renderOption={(option) => {\n return <StopsFinderOptions option={option} />;\n }}\n // eslint-disable-next-line react/jsx-props-no-spreading\n {...autocProps}\n classes={{ ...classes, ...autocompleteProps.classes }}\n inputValue={inputValue}\n open={isOpen}\n options={suggestions}\n loading={isLoading}\n onOpen={() => {\n setOpen(true);\n }}\n onClose={() => {\n setOpen(false);\n }}\n onInputChange={(evt, val) => {\n setInputValue(val);\n }}\n />\n );\n}\n\nStopsFinder.propTypes = {\n /**\n * Array or a comma separated list of agencies which should be available.\n * Order of these agencies chooses which agency will be preferred.\n * Available values : sbb, db\n */\n agencies: PropTypes.oneOfType([\n PropTypes.string,\n PropTypes.arrayOf(PropTypes.string),\n ]),\n\n /**\n * geOps api key to access the StopsFinder service.\n */\n apiKey: PropTypes.string,\n\n /**\n * Properties apply to the default [MUI Autocomplete component](https://material-ui.com/api/autocomplete/).\n * We add a custom properties textFieldProps for the default [MUI TextField component](https://material-ui.com/api/text-field/) used by the Autocomplete.\n */\n autocompleteProps: PropTypes.object,\n\n /**\n * minX,minY,maxX,maxY coordinates in WGS84 wherein the station should lie.\n */\n bbox: PropTypes.oneOfType([\n PropTypes.string,\n PropTypes.arrayOf(PropTypes.number),\n ]),\n\n /**\n * Array or a comma separated list of fields which should be used for look up.\n * Available values : id, name, coords\n */\n field: PropTypes.oneOfType([\n PropTypes.string,\n PropTypes.arrayOf(PropTypes.string),\n ]),\n\n /**\n * Control how many matches will be returned.\n */\n limit: PropTypes.number,\n\n /**\n * A map.\n */\n map: PropTypes.instanceOf(Map).isRequired,\n\n /**\n * Array or a comma separated list of mode of transpaorts which should be available.\n * Available values : bus, ferry, gondola, tram, rail, funicular, cable_car, subway\n */\n mots: PropTypes.oneOfType([\n PropTypes.string,\n PropTypes.arrayOf(PropTypes.string),\n ]),\n\n /**\n * Function called when a suggestion is selected.\n */\n onSelect: PropTypes.func,\n\n /**\n * Radius around refLocation in meters that is most relevant.\n * Used as granularity for location rank.\n */\n radius: PropTypes.number,\n\n /**\n * Coordinates in WGS84 (in lat,lon order) used to rank stops close to this position higher.\n * Available values : id, name, coords\n */\n refLocation: PropTypes.oneOfType([\n PropTypes.string,\n PropTypes.arrayOf(PropTypes.number),\n ]),\n\n /**\n * Function to render a different autocomplete input than the default one.\n */\n renderAutocomplete: PropTypes.func,\n\n /**\n * Url of the geOps StopsFinder service.\n */\n url: PropTypes.string,\n};\n\nStopsFinder.defaultProps = {\n agencies: null,\n apiKey: null,\n autocompleteProps: {},\n bbox: null,\n field: null,\n limit: null,\n mots: null,\n onSelect: null,\n radius: null,\n refLocation: null,\n url: null,\n renderAutocomplete: null,\n};\n\nexport default StopsFinder;\n"],
5
5
  "mappings": "AAAA,OAAO,SAAS,SAAS,UAAU,iBAAiB;AACpD,OAAO,eAAe;AACtB,SAAS,oBAAoB;AAC7B,SAAS,gBAAgB;AACzB,OAAO,eAAe;AACtB,OAAO,sBAAsB;AAC7B,SAAS,yBAAyB;AAClC,SAAS,WAAW;AACpB,SAAS,kBAAkB;AAC3B,OAAO,wBAAwB;AAE/B,MAAM,YAAY,WAAW,MAAM;AACjC,SAAO;AAAA,IACL,oBAAoB;AAAA,MAClB,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A;AAAA;AAAA;AAAA,EAKD,UAAU,UAAU;AAAA;AAAA;AAAA;AAAA;AAAA,EAMpB,QAAQ,UAAU;AAAA;AAAA;AAAA;AAAA;AAAA,EAMlB,aAAa,UAAU,UAAU;AAAA,IAC/B,UAAU;AAAA,IACV,UAAU,QAAQ,UAAU,MAAM;AAAA,EACpC,CAAC;AAAA;AAAA;AAAA;AAAA,EAKD,oBAAoB,UAAU;AAAA;AAAA;AAAA;AAAA,EAK9B,KAAK,UAAU;AACjB;AAEA,YAAY,eAAe;AAAA,EACzB,UAAU;AAAA,EACV,QAAQ;AAAA,EACR,mBAAmB,CAAC;AAAA,EACpB,MAAM;AAAA,EACN,OAAO;AAAA,EACP,OAAO;AAAA,EACP,MAAM;AAAA,EACN,UAAU;AAAA,EACV,QAAQ;AAAA,EACR,aAAa;AAAA,EACb,KAAK;AAAA,EACL,oBAAoB;AACtB;AAEA,eAAe;",
6
6
  "names": []
7
7
  }
@@ -35,7 +35,7 @@ function StopsFinderOption({ option }) {
35
35
  const MotIcon = iconForMot[key];
36
36
  return /* @__PURE__ */ React.createElement("span", { className: classes.icon, key }, /* @__PURE__ */ React.createElement(MotIcon, null));
37
37
  }
38
- return /* @__PURE__ */ React.createElement(React.Fragment, null);
38
+ return null;
39
39
  }), /* @__PURE__ */ React.createElement("span", null, option.properties.name)));
40
40
  }
41
41
  StopsFinderOption.propTypes = {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/components/StopsFinder/StopsFinderOption.js"],
4
- "sourcesContent": ["import React, { lazy, Suspense } from 'react';\nimport PropTypes from 'prop-types';\nimport { makeStyles } from '@material-ui/core';\n\nconst ext = '_round-blue-01.svg';\nconst iconForMot = {};\n[\n 'bus',\n 'ferry',\n 'gondola',\n 'tram',\n 'rail',\n 'funicular',\n 'cable_car',\n 'subway',\n].forEach((mot) => {\n iconForMot[mot] = lazy(() => {\n return import(`../../images/mots/${mot}${ext}`);\n });\n});\n\nconst useStyles = makeStyles((theme) => {\n return {\n flex: {\n display: 'flex',\n alignItems: 'center',\n },\n icon: {\n marginRight: theme.spacing(2),\n },\n };\n});\n\nfunction StopsFinderOption({ option }) {\n const classes = useStyles();\n\n return (\n <Suspense fallback={<div />}>\n <div className={classes.flex}>\n {Object.entries(option.properties.mot).map(([key, value]) => {\n if (value) {\n const MotIcon = iconForMot[key];\n return (\n <span className={classes.icon} key={key}>\n <MotIcon />\n </span>\n );\n }\n return <></>;\n })}\n <span>{option.properties.name}</span>\n </div>\n </Suspense>\n );\n}\n\nStopsFinderOption.propTypes = {\n option: PropTypes.object.isRequired,\n};\n\nexport default React.memo(StopsFinderOption);\n"],
5
- "mappings": "AAAA,OAAO,SAAS,MAAM,gBAAgB;AACtC,OAAO,eAAe;AACtB,SAAS,kBAAkB;AAE3B,MAAM,MAAM;AACZ,MAAM,aAAa,CAAC;AACpB;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,EAAE,QAAQ,CAAC,QAAQ;AACjB,aAAW,GAAG,IAAI,KAAK,MAAM;AAC3B,WAAO,OAAO,qBAAqB,GAAG,GAAG,GAAG;AAAA,EAC9C,CAAC;AACH,CAAC;AAED,MAAM,YAAY,WAAW,CAAC,UAAU;AACtC,SAAO;AAAA,IACL,MAAM;AAAA,MACJ,SAAS;AAAA,MACT,YAAY;AAAA,IACd;AAAA,IACA,MAAM;AAAA,MACJ,aAAa,MAAM,QAAQ,CAAC;AAAA,IAC9B;AAAA,EACF;AACF,CAAC;AAED,SAAS,kBAAkB,EAAE,OAAO,GAAG;AACrC,QAAM,UAAU,UAAU;AAE1B,SACE,oCAAC,YAAS,UAAU,oCAAC,WAAI,KACvB,oCAAC,SAAI,WAAW,QAAQ,QACrB,OAAO,QAAQ,OAAO,WAAW,GAAG,EAAE,IAAI,CAAC,CAAC,KAAK,KAAK,MAAM;AAC3D,QAAI,OAAO;AACT,YAAM,UAAU,WAAW,GAAG;AAC9B,aACE,oCAAC,UAAK,WAAW,QAAQ,MAAM,OAC7B,oCAAC,aAAQ,CACX;AAAA,IAEJ;AACA,WAAO,wDAAE;AAAA,EACX,CAAC,GACD,oCAAC,cAAM,OAAO,WAAW,IAAK,CAChC,CACF;AAEJ;AAEA,kBAAkB,YAAY;AAAA,EAC5B,QAAQ,UAAU,OAAO;AAC3B;AAEA,eAAe,MAAM,KAAK,iBAAiB;",
4
+ "sourcesContent": ["import React, { lazy, Suspense } from \"react\";\nimport PropTypes from \"prop-types\";\nimport { makeStyles } from \"@material-ui/core\";\n\nconst ext = \"_round-blue-01.svg\";\nconst iconForMot = {};\n[\n \"bus\",\n \"ferry\",\n \"gondola\",\n \"tram\",\n \"rail\",\n \"funicular\",\n \"cable_car\",\n \"subway\",\n].forEach((mot) => {\n iconForMot[mot] = lazy(() => {\n return import(`../../images/mots/${mot}${ext}`);\n });\n});\n\nconst useStyles = makeStyles((theme) => {\n return {\n flex: {\n display: \"flex\",\n alignItems: \"center\",\n },\n icon: {\n marginRight: theme.spacing(2),\n },\n };\n});\n\nfunction StopsFinderOption({ option }) {\n const classes = useStyles();\n\n return (\n <Suspense fallback={<div />}>\n <div className={classes.flex}>\n {Object.entries(option.properties.mot).map(([key, value]) => {\n if (value) {\n const MotIcon = iconForMot[key];\n return (\n <span className={classes.icon} key={key}>\n <MotIcon />\n </span>\n );\n }\n return null;\n })}\n <span>{option.properties.name}</span>\n </div>\n </Suspense>\n );\n}\n\nStopsFinderOption.propTypes = {\n option: PropTypes.object.isRequired,\n};\n\nexport default React.memo(StopsFinderOption);\n"],
5
+ "mappings": "AAAA,OAAO,SAAS,MAAM,gBAAgB;AACtC,OAAO,eAAe;AACtB,SAAS,kBAAkB;AAE3B,MAAM,MAAM;AACZ,MAAM,aAAa,CAAC;AACpB;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,EAAE,QAAQ,CAAC,QAAQ;AACjB,aAAW,GAAG,IAAI,KAAK,MAAM;AAC3B,WAAO,OAAO,qBAAqB,GAAG,GAAG,GAAG;AAAA,EAC9C,CAAC;AACH,CAAC;AAED,MAAM,YAAY,WAAW,CAAC,UAAU;AACtC,SAAO;AAAA,IACL,MAAM;AAAA,MACJ,SAAS;AAAA,MACT,YAAY;AAAA,IACd;AAAA,IACA,MAAM;AAAA,MACJ,aAAa,MAAM,QAAQ,CAAC;AAAA,IAC9B;AAAA,EACF;AACF,CAAC;AAED,SAAS,kBAAkB,EAAE,OAAO,GAAG;AACrC,QAAM,UAAU,UAAU;AAE1B,SACE,oCAAC,YAAS,UAAU,oCAAC,WAAI,KACvB,oCAAC,SAAI,WAAW,QAAQ,QACrB,OAAO,QAAQ,OAAO,WAAW,GAAG,EAAE,IAAI,CAAC,CAAC,KAAK,KAAK,MAAM;AAC3D,QAAI,OAAO;AACT,YAAM,UAAU,WAAW,GAAG;AAC9B,aACE,oCAAC,UAAK,WAAW,QAAQ,MAAM,OAC7B,oCAAC,aAAQ,CACX;AAAA,IAEJ;AACA,WAAO;AAAA,EACT,CAAC,GACD,oCAAC,cAAM,OAAO,WAAW,IAAK,CAChC,CACF;AAEJ;AAEA,kBAAkB,YAAY;AAAA,EAC5B,QAAQ,UAAU,OAAO;AAC3B;AAEA,eAAe,MAAM,KAAK,iBAAiB;",
6
6
  "names": []
7
7
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/components/StopsFinder/index.js"],
4
- "sourcesContent": ["export { default } from './StopsFinder';\n"],
4
+ "sourcesContent": ["export { default } from \"./StopsFinder\";\n"],
5
5
  "mappings": "AAAA,SAAS,eAAe;",
6
6
  "names": []
7
7
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/components/Zoom/Zoom.js"],
4
- "sourcesContent": ["import React, {\n useEffect,\n useRef,\n useCallback,\n useState,\n useMemo,\n} from 'react';\nimport PropTypes from 'prop-types';\nimport { FaPlus, FaMinus } from 'react-icons/fa';\nimport { ZoomSlider } from 'ol/control';\nimport OLMap from 'ol/Map';\nimport { easeOut } from 'ol/easing';\nimport { unByKey } from 'ol/Observable';\n\nconst propTypes = {\n /**\n * An [ol/map](https://openlayers.org/en/latest/apidoc/module-ol_Map-Map.html).\n */\n map: PropTypes.instanceOf(OLMap).isRequired,\n\n /**\n * The zoom delta applied on each click.\n */\n delta: PropTypes.number,\n\n /**\n * Titles HTML attribtues for button.\n */\n titles: PropTypes.shape({\n zoomIn: PropTypes.string,\n zoomOut: PropTypes.string,\n }),\n\n /**\n * Children content of the zoom in button.\n */\n zoomInChildren: PropTypes.node,\n\n /**\n * Children content of the zoom out button.\n */\n zoomOutChildren: PropTypes.node,\n\n /**\n * Display a slider to zoom.\n */\n zoomSlider: PropTypes.bool,\n};\n\nconst defaultProps = {\n titles: {\n zoomIn: 'Zoom in',\n zoomOut: 'Zoom out',\n },\n zoomInChildren: <FaPlus focusable={false} />,\n zoomOutChildren: <FaMinus focusable={false} />,\n zoomSlider: false,\n delta: 1,\n};\n\nconst updateZoom = (map, delta) => {\n const view = map.getView();\n const currentZoom = view.getZoom();\n const newZoom = currentZoom + delta;\n const constrainedZoom = view.getConstrainedZoom(newZoom);\n if (view.getAnimating()) {\n view.cancelAnimations();\n }\n view.animate({\n zoom: constrainedZoom,\n duration: 250,\n easing: easeOut,\n });\n};\n\n/**\n * The Zoom component creates a zoom wrapper containing zoom-in and zoom-out buttons\n * and an optional [ol/ZoomSlider](https://openlayers.org/en/latest/apidoc/module-ol_control_ZoomSlider-ZoomSlider.html).\n */\nfunction Zoom({\n map,\n titles,\n zoomInChildren,\n zoomOutChildren,\n zoomSlider,\n delta,\n ...other\n}) {\n const ref = useRef();\n const [currentZoom, setZoom] = useState();\n\n const zoomIn = useCallback(\n (evt) => {\n if (!evt.which || evt.which === 13) {\n updateZoom(map, delta);\n }\n },\n [delta, map],\n );\n\n const zoomOut = useCallback(\n (evt) => {\n if (!evt.which || evt.which === 13) {\n updateZoom(map, -delta);\n }\n },\n [delta, map],\n );\n\n const zoomInDisabled = useMemo(() => {\n return (\n currentZoom >=\n map.getView().getConstrainedZoom(map.getView().getMaxZoom())\n );\n }, [currentZoom, map]);\n\n const zoomOutDisabled = useMemo(() => {\n return (\n currentZoom <=\n map.getView().getConstrainedZoom(map.getView().getMinZoom())\n );\n }, [currentZoom, map]);\n\n useEffect(() => {\n // Trigger zoom update to disable zooms on max and min\n const listenerKey = map.on('moveend', () => {\n setZoom(map.getView().getZoom());\n });\n\n let control;\n if (zoomSlider && ref.current) {\n control = new ZoomSlider();\n // We don't want to navigate to the zoom slider using TAB navigation.\n control.element.firstElementChild.tabIndex = -1;\n // Set the zoom slider in the custom control wrapper.\n control.setTarget(ref.current);\n map.addControl(control);\n }\n return () => {\n unByKey(listenerKey);\n if (control) {\n map.removeControl(control);\n }\n };\n }, [map, zoomSlider]);\n\n return (\n // eslint-disable-next-line react/jsx-props-no-spreading\n <div className=\"rs-zooms-bar\" {...other}>\n <button\n type=\"button\"\n tabIndex={0}\n className=\"rs-zoom-in\"\n title={titles.zoomIn}\n onClick={zoomIn}\n onKeyPress={zoomIn}\n disabled={zoomInDisabled}\n >\n {zoomInChildren}\n </button>\n {zoomSlider ? <div className=\"rs-zoomslider-wrapper\" ref={ref} /> : null}\n <button\n type=\"button\"\n tabIndex={0}\n className=\"rs-zoom-out\"\n title={titles.zoomOut}\n onClick={zoomOut}\n onKeyPress={zoomOut}\n disabled={zoomOutDisabled}\n >\n {zoomOutChildren}\n </button>\n </div>\n );\n}\n\nZoom.propTypes = propTypes;\nZoom.defaultProps = defaultProps;\n\nexport default React.memo(Zoom);\n"],
4
+ "sourcesContent": ["import React, {\n useEffect,\n useRef,\n useCallback,\n useState,\n useMemo,\n} from \"react\";\nimport PropTypes from \"prop-types\";\nimport { FaPlus, FaMinus } from \"react-icons/fa\";\nimport { ZoomSlider } from \"ol/control\";\nimport OLMap from \"ol/Map\";\nimport { easeOut } from \"ol/easing\";\nimport { unByKey } from \"ol/Observable\";\n\nconst propTypes = {\n /**\n * An [ol/map](https://openlayers.org/en/latest/apidoc/module-ol_Map-Map.html).\n */\n map: PropTypes.instanceOf(OLMap).isRequired,\n\n /**\n * The zoom delta applied on each click.\n */\n delta: PropTypes.number,\n\n /**\n * Titles HTML attribtues for button.\n */\n titles: PropTypes.shape({\n zoomIn: PropTypes.string,\n zoomOut: PropTypes.string,\n }),\n\n /**\n * Children content of the zoom in button.\n */\n zoomInChildren: PropTypes.node,\n\n /**\n * Children content of the zoom out button.\n */\n zoomOutChildren: PropTypes.node,\n\n /**\n * Display a slider to zoom.\n */\n zoomSlider: PropTypes.bool,\n};\n\nconst defaultProps = {\n titles: {\n zoomIn: \"Zoom in\",\n zoomOut: \"Zoom out\",\n },\n zoomInChildren: <FaPlus focusable={false} />,\n zoomOutChildren: <FaMinus focusable={false} />,\n zoomSlider: false,\n delta: 1,\n};\n\nconst updateZoom = (map, delta) => {\n const view = map.getView();\n const currentZoom = view.getZoom();\n const newZoom = currentZoom + delta;\n const constrainedZoom = view.getConstrainedZoom(newZoom);\n if (view.getAnimating()) {\n view.cancelAnimations();\n }\n view.animate({\n zoom: constrainedZoom,\n duration: 250,\n easing: easeOut,\n });\n};\n\n/**\n * The Zoom component creates a zoom wrapper containing zoom-in and zoom-out buttons\n * and an optional [ol/ZoomSlider](https://openlayers.org/en/latest/apidoc/module-ol_control_ZoomSlider-ZoomSlider.html).\n */\nfunction Zoom({\n map,\n titles,\n zoomInChildren,\n zoomOutChildren,\n zoomSlider,\n delta,\n ...other\n}) {\n const ref = useRef();\n const [currentZoom, setZoom] = useState();\n\n const zoomIn = useCallback(\n (evt) => {\n if (!evt.which || evt.which === 13) {\n updateZoom(map, delta);\n }\n },\n [delta, map],\n );\n\n const zoomOut = useCallback(\n (evt) => {\n if (!evt.which || evt.which === 13) {\n updateZoom(map, -delta);\n }\n },\n [delta, map],\n );\n\n const zoomInDisabled = useMemo(() => {\n return (\n currentZoom >=\n map.getView().getConstrainedZoom(map.getView().getMaxZoom())\n );\n }, [currentZoom, map]);\n\n const zoomOutDisabled = useMemo(() => {\n return (\n currentZoom <=\n map.getView().getConstrainedZoom(map.getView().getMinZoom())\n );\n }, [currentZoom, map]);\n\n useEffect(() => {\n // Trigger zoom update to disable zooms on max and min\n const listenerKey = map.on(\"moveend\", () => {\n setZoom(map.getView().getZoom());\n });\n\n let control;\n if (zoomSlider && ref.current) {\n control = new ZoomSlider();\n // We don't want to navigate to the zoom slider using TAB navigation.\n control.element.firstElementChild.tabIndex = -1;\n // Set the zoom slider in the custom control wrapper.\n control.setTarget(ref.current);\n map.addControl(control);\n }\n return () => {\n unByKey(listenerKey);\n if (control) {\n map.removeControl(control);\n }\n };\n }, [map, zoomSlider]);\n\n return (\n // eslint-disable-next-line react/jsx-props-no-spreading\n <div className=\"rs-zooms-bar\" {...other}>\n <button\n type=\"button\"\n tabIndex={0}\n className=\"rs-zoom-in\"\n title={titles.zoomIn}\n onClick={zoomIn}\n onKeyPress={zoomIn}\n disabled={zoomInDisabled}\n >\n {zoomInChildren}\n </button>\n {zoomSlider ? <div className=\"rs-zoomslider-wrapper\" ref={ref} /> : null}\n <button\n type=\"button\"\n tabIndex={0}\n className=\"rs-zoom-out\"\n title={titles.zoomOut}\n onClick={zoomOut}\n onKeyPress={zoomOut}\n disabled={zoomOutDisabled}\n >\n {zoomOutChildren}\n </button>\n </div>\n );\n}\n\nZoom.propTypes = propTypes;\nZoom.defaultProps = defaultProps;\n\nexport default React.memo(Zoom);\n"],
5
5
  "mappings": "AAAA,OAAO;AAAA,EACL;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,OAAO,eAAe;AACtB,SAAS,QAAQ,eAAe;AAChC,SAAS,kBAAkB;AAC3B,OAAO,WAAW;AAClB,SAAS,eAAe;AACxB,SAAS,eAAe;AAExB,MAAM,YAAY;AAAA;AAAA;AAAA;AAAA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;AAAA,QACC,MAAK;AAAA,QACL,UAAU;AAAA,QACV,WAAU;AAAA,QACV,OAAO,OAAO;AAAA,QACd,SAAS;AAAA,QACT,YAAY;AAAA,QACZ,UAAU;AAAA;AAAA,MAET;AAAA,IACH,CACF;AAAA;AAEJ;AAEA,KAAK,YAAY;AACjB,KAAK,eAAe;AAEpB,eAAe,MAAM,KAAK,IAAI;",
6
6
  "names": []
7
7
  }
@@ -33,7 +33,7 @@
33
33
  top: 0;
34
34
  left: 0;
35
35
  user-select: none;
36
- background-color: rgba(255, 255, 255, 0.4);
36
+ background-color: rgb(255 255 255 / 40%);
37
37
  border: 1px solid $brand-secondary;
38
38
  border-radius: 3px;
39
39
  outline: none;
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/components/Zoom/index.js"],
4
- "sourcesContent": ["export { default } from './Zoom';\n"],
4
+ "sourcesContent": ["export { default } from \"./Zoom\";\n"],
5
5
  "mappings": "AAAA,SAAS,eAAe;",
6
6
  "names": []
7
7
  }
package/package.json CHANGED
@@ -1,52 +1,53 @@
1
1
  {
2
2
  "name": "react-spatial",
3
- "description": "Components to build React map apps.",
4
- "version": "1.5.7",
5
3
  "license": "MIT",
4
+ "description": "Components to build React map apps.",
5
+ "version": "1.7.0",
6
6
  "dependencies": {
7
- "@geops/geops-ui": "0.1.13",
7
+ "@geops/geops-ui": "0.1.18",
8
8
  "@material-ui/core": "4.12.4",
9
9
  "@material-ui/icons": "4.11.3",
10
- "@material-ui/lab": "4.0.0-alpha.60",
11
- "query-string": "7.0.1",
10
+ "@material-ui/lab": "4.0.0-alpha.61",
12
11
  "re-resizable": "6.9.11",
13
12
  "react-icons": "4.11.0",
14
13
  "resize-observer-polyfill": "1.5.1"
15
14
  },
16
15
  "peerDependencies": {
17
16
  "mapbox-gl": "^1",
18
- "mobility-toolbox-js": "^1",
19
- "ol": "^6",
20
- "react": "^16",
21
- "react-dom": "^16"
17
+ "maplibre-gl": "^2",
18
+ "mobility-toolbox-js": "^2",
19
+ "ol": "^8",
20
+ "react": "^18",
21
+ "react-dom": "^18"
22
22
  },
23
23
  "devDependencies": {
24
24
  "@babel/preset-env": "7.22.20",
25
25
  "@babel/preset-react": "7.22.15",
26
26
  "@cfaester/enzyme-adapter-react-18": "0.7.1",
27
- "@commitlint/cli": "17.7.1",
27
+ "@commitlint/cli": "17.7.2",
28
28
  "@commitlint/config-conventional": "17.7.0",
29
- "@svgr/webpack": "5.5.0",
30
- "@testing-library/jest-dom": "5.16.5",
29
+ "@svgr/plugin-jsx": "^8.1.0",
30
+ "@svgr/webpack": "8.1.0",
31
+ "@testing-library/jest-dom": "6.1.3",
31
32
  "@testing-library/react": "14.0.0",
32
33
  "@testing-library/user-event": "14.5.1",
33
34
  "babel-jest": "29.7.0",
34
35
  "babel-loader": "9.1.3",
35
36
  "canvas": "2.11.2",
36
- "css-loader": "5.2.6",
37
+ "css-loader": "6.8.1",
37
38
  "enzyme": "3.11.0",
38
- "esbuild": "^0.19.3",
39
+ "esbuild": "^0.19.4",
39
40
  "esbuild-loader": "^4.0.2",
40
- "eslint": "7.32.0",
41
- "eslint-config-airbnb": "18.2.1",
42
- "eslint-config-prettier": "8.3.0",
41
+ "eslint": "8.50.0",
42
+ "eslint-config-airbnb": "19.0.4",
43
+ "eslint-config-prettier": "9.0.0",
43
44
  "eslint-plugin-import": "2.28.1",
44
45
  "eslint-plugin-jsx-a11y": "6.7.1",
45
- "eslint-plugin-prettier": "4.0.0",
46
+ "eslint-plugin-prettier": "5.0.0",
46
47
  "eslint-plugin-react": "7.33.2",
47
48
  "eslint-plugin-react-hooks": "4.6.0",
48
49
  "file-loader": "6.2.0",
49
- "fixpack": "3.0.6",
50
+ "fixpack": "4.0.0",
50
51
  "generact": "0.4.0",
51
52
  "husky": "8.0.3",
52
53
  "identity-obj-proxy": "^3.0.0",
@@ -60,12 +61,13 @@
60
61
  "jest-transform-file": "1.1.1",
61
62
  "jest-transformer-svg": "^2.0.1",
62
63
  "jsts": "2.11.0",
63
- "lint-staged": "11.2.0",
64
+ "lint-staged": "14.0.1",
64
65
  "mapbox-gl": "1.13.1",
65
66
  "maplibre-gl": "2.4.0",
66
67
  "mobility-toolbox-js": "2.1.0",
67
- "ol": "6.14.1",
68
- "prettier": "2.4.1",
68
+ "ol": "8.1.0",
69
+ "postcss": "^8.4.31",
70
+ "prettier": "3.0.3",
69
71
  "proj4": "2.9.0",
70
72
  "prop-types": "15.8.1",
71
73
  "react": "18",
@@ -73,18 +75,18 @@
73
75
  "react-styleguidist": "13.1.1",
74
76
  "react-svg-loader": "3.0.3",
75
77
  "react-test-renderer": "18.2.0",
76
- "sass": "1.67.0",
77
- "sass-loader": "10.2.0",
78
+ "sass": "1.69.0",
79
+ "sass-loader": "13.3.2",
78
80
  "standard-version": "9.5.0",
79
81
  "stream-array": "1.1.2",
80
- "style-loader": "2.0.0",
81
- "stylelint": "13.13.1",
82
- "stylelint-config-recommended-scss": "4.3.0",
83
- "stylelint-config-standard": "22.0.0",
84
- "stylelint-scss": "3.21.0",
82
+ "style-loader": "3.3.3",
83
+ "stylelint": "15.10.3",
84
+ "stylelint-config-recommended-scss": "13.0.0",
85
+ "stylelint-config-standard": "34.0.0",
86
+ "stylelint-scss": "5.2.1",
85
87
  "terser-webpack-plugin": "^5.3.9",
86
88
  "url-loader": "4.1.1",
87
- "vinyl-fs": "3.0.3",
89
+ "vinyl-fs": "4.0.0",
88
90
  "webpack": "^5.88.2",
89
91
  "xml-beautifier": "0.5.0"
90
92
  },
@@ -151,6 +153,7 @@
151
153
  ]
152
154
  }
153
155
  ],
156
+ "no-restricted-exports": "Off",
154
157
  "react/forbid-prop-types": "Off",
155
158
  "prettier/prettier": "error",
156
159
  "jsx-a11y/no-access-key": "Off"
@@ -188,23 +191,10 @@
188
191
  "yarn test --bail --findRelatedTests"
189
192
  ],
190
193
  "package.json": [
191
- "fixpack --sortToTop name --sortToTop description --sortToTop version --sortToTop license --sortToTop author --sortToTop main --sortToTop files --sortToTop proxy --sortToTop dependencies --sortToTop peerDependencies --sortToTop devDependencies --sortToTop scripts"
194
+ "fixpack"
192
195
  ],
193
196
  "src/**/*.{css,scss}": [
194
197
  "stylelint --fix"
195
198
  ]
196
- },
197
- "prettier": {
198
- "trailingComma": "all",
199
- "singleQuote": true
200
- },
201
- "stylelint": {
202
- "plugins": [
203
- "stylelint-scss"
204
- ],
205
- "extends": [
206
- "stylelint-config-standard",
207
- "stylelint-config-recommended-scss"
208
- ]
209
199
  }
210
200
  }
package/propTypes.js.map CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../src/propTypes.js"],
4
- "sourcesContent": ["import PropTypes from 'prop-types';\n\nconst STATE_BOARDING = 'BOARDING';\nconst STATE_LEAVING = 'LEAVING';\nconst STATE_PENDING = 'PENDING';\nconst STATE_TIME_BASED = 'TIME_BASED';\nconst STATE_STOP_CANCELLED = 'STOP_CANCELLED';\nconst STATE_JOURNEY_CANCELLED = 'JOURNEY_CANCELLED';\n\nconst station = PropTypes.shape({\n arrivalDelay: PropTypes.number, // time in milliseconds.\n aimedArrivalTime: PropTypes.number, // time in milliseconds.\n arrivalTime: PropTypes.number, // time in milliseconds with the delay included.\n cancelled: PropTypes.bool,\n coordinates: PropTypes.arrayOf(PropTypes.number),\n aimedDepartureTime: PropTypes.number, // time in milliseconds.\n departureDelay: PropTypes.number, // time in milliseconds.\n departureTime: PropTypes.number, // time in milliseconds with the delay included\n noDropOff: PropTypes.bool,\n noPickUp: PropTypes.bool,\n stationId: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),\n stationName: PropTypes.string,\n wheelchairAccessible: PropTypes.bool,\n state: PropTypes.oneOf([\n null,\n STATE_BOARDING,\n STATE_LEAVING,\n STATE_PENDING,\n STATE_TIME_BASED,\n STATE_STOP_CANCELLED,\n STATE_JOURNEY_CANCELLED,\n ]),\n});\n\nconst lineInfos = PropTypes.shape({\n backgroundColor: PropTypes.string,\n bicyclesAllowed: PropTypes.bool,\n color: PropTypes.string,\n destination: PropTypes.string,\n feedsId: PropTypes.number,\n id: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),\n license: PropTypes.string,\n licenseNote: PropTypes.string,\n licenseUrl: PropTypes.string,\n longName: PropTypes.string,\n operatingInformations: PropTypes.object,\n operator: PropTypes.string,\n operatorTimeZone: PropTypes.string,\n operatorUrl: PropTypes.string,\n publisher: PropTypes.string,\n publisherTimeZone: PropTypes.string,\n publisherUrl: PropTypes.string,\n realTime: PropTypes.number,\n shortName: PropTypes.string,\n stations: PropTypes.arrayOf(station),\n vehicleType: PropTypes.number,\n wheelchairAccessible: PropTypes.bool,\n});\n\nexport default {\n lineInfos,\n station,\n STATE_BOARDING,\n STATE_LEAVING,\n};\n"],
4
+ "sourcesContent": ["import PropTypes from \"prop-types\";\n\nconst STATE_BOARDING = \"BOARDING\";\nconst STATE_LEAVING = \"LEAVING\";\nconst STATE_PENDING = \"PENDING\";\nconst STATE_TIME_BASED = \"TIME_BASED\";\nconst STATE_STOP_CANCELLED = \"STOP_CANCELLED\";\nconst STATE_JOURNEY_CANCELLED = \"JOURNEY_CANCELLED\";\n\nconst station = PropTypes.shape({\n arrivalDelay: PropTypes.number, // time in milliseconds.\n aimedArrivalTime: PropTypes.number, // time in milliseconds.\n arrivalTime: PropTypes.number, // time in milliseconds with the delay included.\n cancelled: PropTypes.bool,\n coordinates: PropTypes.arrayOf(PropTypes.number),\n aimedDepartureTime: PropTypes.number, // time in milliseconds.\n departureDelay: PropTypes.number, // time in milliseconds.\n departureTime: PropTypes.number, // time in milliseconds with the delay included\n noDropOff: PropTypes.bool,\n noPickUp: PropTypes.bool,\n stationId: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),\n stationName: PropTypes.string,\n wheelchairAccessible: PropTypes.bool,\n state: PropTypes.oneOf([\n null,\n STATE_BOARDING,\n STATE_LEAVING,\n STATE_PENDING,\n STATE_TIME_BASED,\n STATE_STOP_CANCELLED,\n STATE_JOURNEY_CANCELLED,\n ]),\n});\n\nconst lineInfos = PropTypes.shape({\n backgroundColor: PropTypes.string,\n bicyclesAllowed: PropTypes.bool,\n color: PropTypes.string,\n destination: PropTypes.string,\n feedsId: PropTypes.number,\n id: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),\n license: PropTypes.string,\n licenseNote: PropTypes.string,\n licenseUrl: PropTypes.string,\n longName: PropTypes.string,\n operatingInformations: PropTypes.object,\n operator: PropTypes.string,\n operatorTimeZone: PropTypes.string,\n operatorUrl: PropTypes.string,\n publisher: PropTypes.string,\n publisherTimeZone: PropTypes.string,\n publisherUrl: PropTypes.string,\n realTime: PropTypes.number,\n shortName: PropTypes.string,\n stations: PropTypes.arrayOf(station),\n vehicleType: PropTypes.number,\n wheelchairAccessible: PropTypes.bool,\n});\n\nexport default {\n lineInfos,\n station,\n STATE_BOARDING,\n STATE_LEAVING,\n};\n"],
5
5
  "mappings": "AAAA,OAAO,eAAe;AAEtB,MAAM,iBAAiB;AACvB,MAAM,gBAAgB;AACtB,MAAM,gBAAgB;AACtB,MAAM,mBAAmB;AACzB,MAAM,uBAAuB;AAC7B,MAAM,0BAA0B;AAEhC,MAAM,UAAU,UAAU,MAAM;AAAA,EAC9B,cAAc,UAAU;AAAA;AAAA,EACxB,kBAAkB,UAAU;AAAA;AAAA,EAC5B,aAAa,UAAU;AAAA;AAAA,EACvB,WAAW,UAAU;AAAA,EACrB,aAAa,UAAU,QAAQ,UAAU,MAAM;AAAA,EAC/C,oBAAoB,UAAU;AAAA;AAAA,EAC9B,gBAAgB,UAAU;AAAA;AAAA,EAC1B,eAAe,UAAU;AAAA;AAAA,EACzB,WAAW,UAAU;AAAA,EACrB,UAAU,UAAU;AAAA,EACpB,WAAW,UAAU,UAAU,CAAC,UAAU,QAAQ,UAAU,MAAM,CAAC;AAAA,EACnE,aAAa,UAAU;AAAA,EACvB,sBAAsB,UAAU;AAAA,EAChC,OAAO,UAAU,MAAM;AAAA,IACrB;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,CAAC;AACH,CAAC;AAED,MAAM,YAAY,UAAU,MAAM;AAAA,EAChC,iBAAiB,UAAU;AAAA,EAC3B,iBAAiB,UAAU;AAAA,EAC3B,OAAO,UAAU;AAAA,EACjB,aAAa,UAAU;AAAA,EACvB,SAAS,UAAU;AAAA,EACnB,IAAI,UAAU,UAAU,CAAC,UAAU,QAAQ,UAAU,MAAM,CAAC;AAAA,EAC5D,SAAS,UAAU;AAAA,EACnB,aAAa,UAAU;AAAA,EACvB,YAAY,UAAU;AAAA,EACtB,UAAU,UAAU;AAAA,EACpB,uBAAuB,UAAU;AAAA,EACjC,UAAU,UAAU;AAAA,EACpB,kBAAkB,UAAU;AAAA,EAC5B,aAAa,UAAU;AAAA,EACvB,WAAW,UAAU;AAAA,EACrB,mBAAmB,UAAU;AAAA,EAC7B,cAAc,UAAU;AAAA,EACxB,UAAU,UAAU;AAAA,EACpB,WAAW,UAAU;AAAA,EACrB,UAAU,UAAU,QAAQ,OAAO;AAAA,EACnC,aAAa,UAAU;AAAA,EACvB,sBAAsB,UAAU;AAClC,CAAC;AAED,eAAe;AAAA,EACb;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;",
6
6
  "names": []
7
7
  }
package/setupTests.js CHANGED
@@ -1,3 +1,5 @@
1
+ import ResizeObserver from "resize-observer-polyfill";
1
2
  global.URL.createObjectURL = jest.fn(() => {
2
3
  return "fooblob";
3
4
  });
5
+ global.ResizeObserver = ResizeObserver;
package/setupTests.js.map CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../src/setupTests.js"],
4
- "sourcesContent": ["global.URL.createObjectURL = jest.fn(() => {\n return 'fooblob';\n});\n"],
5
- "mappings": "AAAA,OAAO,IAAI,kBAAkB,KAAK,GAAG,MAAM;AACzC,SAAO;AACT,CAAC;",
4
+ "sourcesContent": ["import ResizeObserver from \"resize-observer-polyfill\";\n\nglobal.URL.createObjectURL = jest.fn(() => {\n return \"fooblob\";\n});\n\nglobal.ResizeObserver = ResizeObserver;\n"],
5
+ "mappings": "AAAA,OAAO,oBAAoB;AAE3B,OAAO,IAAI,kBAAkB,KAAK,GAAG,MAAM;AACzC,SAAO;AACT,CAAC;AAED,OAAO,iBAAiB;",
6
6
  "names": []
7
7
  }