react-spatial 1.12.0 → 1.12.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/BaseLayerSwitcher/BaseLayerSwitcher.js +51 -51
- package/components/BaseLayerSwitcher/BaseLayerSwitcher.js.map +2 -2
- package/components/BasicMap/BasicMap.js +80 -80
- package/components/BasicMap/BasicMap.js.map +2 -2
- package/components/CanvasSaveButton/CanvasSaveButton.js +68 -68
- package/components/CanvasSaveButton/CanvasSaveButton.js.map +2 -2
- package/components/Copyright/Copyright.js +12 -12
- package/components/Copyright/Copyright.js.map +2 -2
- package/components/FeatureExportButton/FeatureExportButton.js +5 -5
- package/components/FeatureExportButton/FeatureExportButton.js.map +2 -2
- package/components/FitExtent/FitExtent.js +15 -15
- package/components/FitExtent/FitExtent.js.map +2 -2
- package/components/Geolocation/Geolocation.js +96 -96
- package/components/Geolocation/Geolocation.js.map +2 -2
- package/components/LayerTree/LayerTree.js +172 -172
- package/components/LayerTree/LayerTree.js.map +2 -2
- package/components/MousePosition/MousePosition.js +27 -27
- package/components/MousePosition/MousePosition.js.map +2 -2
- package/components/NorthArrow/NorthArrow.js +13 -13
- package/components/NorthArrow/NorthArrow.js.map +2 -2
- package/components/Overlay/Overlay.js +49 -49
- package/components/Overlay/Overlay.js.map +2 -2
- package/components/Permalink/Permalink.js +70 -70
- package/components/Permalink/Permalink.js.map +2 -2
- package/components/Popup/Popup.js +73 -73
- package/components/Popup/Popup.js.map +2 -2
- package/components/ResizeHandler/ResizeHandler.js +51 -49
- package/components/ResizeHandler/ResizeHandler.js.map +2 -2
- package/components/RouteSchedule/RouteSchedule.js +86 -74
- package/components/RouteSchedule/RouteSchedule.js.map +2 -2
- package/components/RouteSchedule/RouteSchedule.scss +0 -20
- package/components/ScaleLine/ScaleLine.js +2 -2
- package/components/ScaleLine/ScaleLine.js.map +2 -2
- package/components/StopsFinder/StopsFinder.js +21 -21
- package/components/StopsFinder/StopsFinder.js.map +2 -2
- package/components/StopsFinder/StopsFinderOption.js +3 -3
- package/components/StopsFinder/StopsFinderOption.js.map +2 -2
- package/components/Zoom/Zoom.js +35 -35
- package/components/Zoom/Zoom.js.map +2 -2
- package/package.json +33 -29
- package/propTypes.js +10 -10
- package/propTypes.js.map +2 -2
- package/utils/GlobalsForOle.js +57 -57
- package/utils/GlobalsForOle.js.map +2 -2
- package/utils/KML.js +32 -32
- package/utils/KML.js.map +2 -2
- package/utils/Styles.js +7 -7
- package/utils/Styles.js.map +2 -2
- package/utils/timeUtils.js +6 -6
- package/utils/timeUtils.js.map +2 -2
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/ScaleLine/ScaleLine.js"],
|
|
4
|
-
"sourcesContent": ["import
|
|
5
|
-
"mappings": "AAAA,OAAO,
|
|
4
|
+
"sourcesContent": ["import OLScaleLine from \"ol/control/ScaleLine\";\nimport OLMap from \"ol/Map\";\nimport PropTypes from \"prop-types\";\nimport React, { useEffect, useRef } from \"react\";\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 = defaultProps.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;\n\nexport default React.memo(ScaleLine);\n"],
|
|
5
|
+
"mappings": "AAAA,OAAO,iBAAiB;AACxB,OAAO,WAAW;AAClB,OAAO,eAAe;AACtB,OAAO,SAAS,WAAW,cAAc;AAEzC,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,UAAU,aAAa,SAAS,GAAG,MAAM,GAAG;AACpE,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;AAEtB,eAAe,MAAM,KAAK,SAAS;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import React, { useMemo, useState, useEffect } from "react";
|
|
2
|
-
import PropTypes from "prop-types";
|
|
3
1
|
import { Autocomplete, autocompleteClasses, styled } from "@mui/material";
|
|
4
|
-
import { FaSearch } from "react-icons/fa";
|
|
5
|
-
import TextField from "@mui/material/TextField";
|
|
6
2
|
import CircularProgress from "@mui/material/CircularProgress";
|
|
3
|
+
import TextField from "@mui/material/TextField";
|
|
7
4
|
import { StopFinderControl } from "mobility-toolbox-js/ol";
|
|
8
5
|
import { Map } from "ol";
|
|
6
|
+
import PropTypes from "prop-types";
|
|
7
|
+
import React, { useEffect, useMemo, useState } from "react";
|
|
8
|
+
import { FaSearch } from "react-icons/fa";
|
|
9
9
|
import StopsFinderOption from "./StopsFinderOption";
|
|
10
10
|
const StyledAutocomplete = styled(Autocomplete)(() => ({
|
|
11
11
|
[`& .${autocompleteClasses.popupIndicatorOpen}`]: {
|
|
@@ -27,8 +27,8 @@ function StopsFinder({
|
|
|
27
27
|
radius,
|
|
28
28
|
refLocation,
|
|
29
29
|
renderAutocomplete,
|
|
30
|
-
url,
|
|
31
30
|
textFieldProps = defaultProps.textFieldProps,
|
|
31
|
+
url,
|
|
32
32
|
...props
|
|
33
33
|
}) {
|
|
34
34
|
const [inputValue, setInputValue] = useState("");
|
|
@@ -37,14 +37,14 @@ function StopsFinder({
|
|
|
37
37
|
const [isOpen, setOpen] = useState(false);
|
|
38
38
|
const control = useMemo(() => {
|
|
39
39
|
return new StopFinderControl({
|
|
40
|
-
url,
|
|
41
40
|
apiKey,
|
|
42
|
-
target: document.createElement("div"),
|
|
43
41
|
element: document.createElement("div"),
|
|
44
42
|
render(newSuggestions = { features: [] }) {
|
|
45
43
|
setSuggestions(newSuggestions.features);
|
|
46
44
|
setLoading(false);
|
|
47
|
-
}
|
|
45
|
+
},
|
|
46
|
+
target: document.createElement("div"),
|
|
47
|
+
url
|
|
48
48
|
});
|
|
49
49
|
}, [apiKey, url]);
|
|
50
50
|
useEffect(() => {
|
|
@@ -57,11 +57,11 @@ function StopsFinder({
|
|
|
57
57
|
const abortController = new AbortController();
|
|
58
58
|
setLoading(true);
|
|
59
59
|
control.apiParams = {
|
|
60
|
-
prefAgencies: agencies && agencies.toString(),
|
|
61
60
|
bbox: bbox && bbox.toString(),
|
|
62
61
|
field: field && field.toString(),
|
|
63
62
|
limit,
|
|
64
63
|
mots: mots && mots.toString(),
|
|
64
|
+
prefAgencies: agencies && agencies.toString(),
|
|
65
65
|
radius,
|
|
66
66
|
ref_location: refLocation && refLocation.toString()
|
|
67
67
|
};
|
|
@@ -107,10 +107,9 @@ function StopsFinder({
|
|
|
107
107
|
return /* @__PURE__ */ React.createElement(
|
|
108
108
|
StyledAutocomplete,
|
|
109
109
|
{
|
|
110
|
-
fullWidth: true,
|
|
111
110
|
autoComplete: true,
|
|
112
111
|
autoHighlight: true,
|
|
113
|
-
|
|
112
|
+
fullWidth: true,
|
|
114
113
|
getOptionLabel: (option) => {
|
|
115
114
|
return option.properties.name;
|
|
116
115
|
},
|
|
@@ -144,20 +143,21 @@ function StopsFinder({
|
|
|
144
143
|
}
|
|
145
144
|
);
|
|
146
145
|
},
|
|
146
|
+
selectOnFocus: true,
|
|
147
147
|
...props,
|
|
148
148
|
inputValue,
|
|
149
|
-
open: isOpen,
|
|
150
|
-
options: suggestions,
|
|
151
149
|
loading: isLoading,
|
|
152
|
-
onOpen: () => {
|
|
153
|
-
setOpen(true);
|
|
154
|
-
},
|
|
155
150
|
onClose: () => {
|
|
156
151
|
setOpen(false);
|
|
157
152
|
},
|
|
158
153
|
onInputChange: (evt, val) => {
|
|
159
154
|
setInputValue(val);
|
|
160
|
-
}
|
|
155
|
+
},
|
|
156
|
+
onOpen: () => {
|
|
157
|
+
setOpen(true);
|
|
158
|
+
},
|
|
159
|
+
open: isOpen,
|
|
160
|
+
options: suggestions
|
|
161
161
|
}
|
|
162
162
|
);
|
|
163
163
|
}
|
|
@@ -175,10 +175,6 @@ StopsFinder.propTypes = {
|
|
|
175
175
|
* geOps api key to access the StopsFinder service.
|
|
176
176
|
*/
|
|
177
177
|
apiKey: PropTypes.string,
|
|
178
|
-
/**
|
|
179
|
-
* Properties apply to the default [MUI TextField component](https://material-ui.com/api/text-field/) used by the Autocomplete.
|
|
180
|
-
*/
|
|
181
|
-
textFieldProps: PropTypes.object,
|
|
182
178
|
/**
|
|
183
179
|
* minX,minY,maxX,maxY coordinates in WGS84 wherein the station should lie.
|
|
184
180
|
*/
|
|
@@ -231,6 +227,10 @@ StopsFinder.propTypes = {
|
|
|
231
227
|
* Function to render a different autocomplete input than the default one.
|
|
232
228
|
*/
|
|
233
229
|
renderAutocomplete: PropTypes.func,
|
|
230
|
+
/**
|
|
231
|
+
* Properties apply to the default [MUI TextField component](https://material-ui.com/api/text-field/) used by the Autocomplete.
|
|
232
|
+
*/
|
|
233
|
+
textFieldProps: PropTypes.object,
|
|
234
234
|
/**
|
|
235
235
|
* Url of the geOps StopsFinder service.
|
|
236
236
|
*/
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/StopsFinder/StopsFinder.js"],
|
|
4
|
-
"sourcesContent": ["/* eslint-disable react/jsx-props-no-spreading */\nimport
|
|
5
|
-
"mappings": "AACA,
|
|
4
|
+
"sourcesContent": ["/* eslint-disable react/jsx-props-no-spreading */\nimport { Autocomplete, autocompleteClasses, styled } from \"@mui/material\";\nimport CircularProgress from \"@mui/material/CircularProgress\";\nimport TextField from \"@mui/material/TextField\";\nimport { StopFinderControl } from \"mobility-toolbox-js/ol\";\nimport { Map } from \"ol\";\nimport PropTypes from \"prop-types\";\nimport React, { useEffect, useMemo, useState } from \"react\";\nimport { FaSearch } from \"react-icons/fa\";\n\nimport StopsFinderOption from \"./StopsFinderOption\";\n\nconst StyledAutocomplete = styled(Autocomplete)(() => ({\n [`& .${autocompleteClasses.popupIndicatorOpen}`]: {\n transform: \"rotate(0)\",\n },\n}));\n\nconst defaultProps = {\n textFieldProps: {},\n};\n\nfunction StopsFinder({\n agencies,\n apiKey,\n bbox,\n field,\n limit,\n map,\n mots,\n onSelect,\n radius,\n refLocation,\n renderAutocomplete,\n textFieldProps = defaultProps.textFieldProps,\n url,\n ...props\n}) {\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 apiKey,\n element: document.createElement(\"div\"),\n render(newSuggestions = { features: [] }) {\n setSuggestions(newSuggestions.features);\n setLoading(false);\n },\n target: document.createElement(\"div\"),\n url,\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 bbox: bbox && bbox.toString(),\n field: field && field.toString(),\n limit,\n mots: mots && mots.toString(),\n prefAgencies: agencies && agencies.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 return (\n <StyledAutocomplete\n autoComplete\n autoHighlight\n fullWidth\n getOptionLabel={(option) => {\n return option.properties.name;\n }}\n onChange={(evt, value, reason) => {\n if (onSelect && reason === \"selectOption\") {\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 {...params}\n {...textFieldProps}\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={(liProps, option) => {\n return (\n <StopsFinderOption\n key={option.properties?.name}\n option={option}\n {...liProps}\n />\n );\n }}\n selectOnFocus\n {...props}\n inputValue={inputValue}\n loading={isLoading}\n onClose={() => {\n setOpen(false);\n }}\n onInputChange={(evt, val) => {\n setInputValue(val);\n }}\n onOpen={() => {\n setOpen(true);\n }}\n open={isOpen}\n options={suggestions}\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 * 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 * Properties apply to the default [MUI TextField component](https://material-ui.com/api/text-field/) used by the Autocomplete.\n */\n textFieldProps: PropTypes.object,\n\n /**\n * Url of the geOps StopsFinder service.\n */\n url: PropTypes.string,\n};\n\nexport default StopsFinder;\n"],
|
|
5
|
+
"mappings": "AACA,SAAS,cAAc,qBAAqB,cAAc;AAC1D,OAAO,sBAAsB;AAC7B,OAAO,eAAe;AACt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UAAU,UAAU;AAAA,IACxB,UAAU;AAAA,IACV,UAAU,QAAQ,UAAU,MAAM;AAAA,EACpC,CAAC;AAAA;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,gBAAgB,UAAU;AAAA;AAAA;AAAA;AAAA,EAK1B,KAAK,UAAU;AACjB;AAEA,eAAe;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import React, { Suspense, lazy } from "react";
|
|
2
|
-
import PropTypes from "prop-types";
|
|
3
1
|
import { CircularProgress, styled } from "@mui/material";
|
|
2
|
+
import PropTypes from "prop-types";
|
|
3
|
+
import React, { lazy, Suspense } from "react";
|
|
4
4
|
const ext = "_round-blue-01.svg";
|
|
5
5
|
const iconForMot = {};
|
|
6
6
|
[
|
|
@@ -18,8 +18,8 @@ const iconForMot = {};
|
|
|
18
18
|
});
|
|
19
19
|
});
|
|
20
20
|
const StyledFlex = styled("div")(() => ({
|
|
21
|
-
display: "flex",
|
|
22
21
|
alignItems: "center",
|
|
22
|
+
display: "flex",
|
|
23
23
|
gap: 5
|
|
24
24
|
}));
|
|
25
25
|
function StopsFinderOption({ option, ...props }) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/StopsFinder/StopsFinderOption.js"],
|
|
4
|
-
"sourcesContent": ["/* eslint-disable react/jsx-props-no-spreading */\nimport
|
|
5
|
-
"mappings": "AACA,
|
|
4
|
+
"sourcesContent": ["/* eslint-disable react/jsx-props-no-spreading */\nimport { CircularProgress, styled } from \"@mui/material\";\nimport PropTypes from \"prop-types\";\nimport React, { lazy, Suspense } from \"react\";\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 StyledFlex = styled(\"div\")(() => ({\n alignItems: \"center\",\n display: \"flex\",\n gap: 5,\n}));\n\nfunction StopsFinderOption({ option, ...props }) {\n return (\n <Suspense fallback={<CircularProgress size={20} />}>\n <StyledFlex {...props}>\n {Object.entries(option.properties?.mot).map(([key, value]) => {\n if (value) {\n const MotIcon = iconForMot[key];\n return (\n <StyledFlex key={key}>\n <MotIcon />\n </StyledFlex>\n );\n }\n return null;\n })}\n <span>{option.properties.name}</span>\n </StyledFlex>\n </Suspense>\n );\n}\n\nStopsFinderOption.propTypes = {\n option: PropTypes.object.isRequired,\n};\n\nexport default React.memo(StopsFinderOption);\n"],
|
|
5
|
+
"mappings": "AACA,SAAS,kBAAkB,cAAc;AACzC,OAAO,eAAe;AACtB,OAAO,SAAS,MAAM,gBAAgB;AAEtC,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,aAAa,OAAO,KAAK,EAAE,OAAO;AAAA,EACtC,YAAY;AAAA,EACZ,SAAS;AAAA,EACT,KAAK;AACP,EAAE;AAEF,SAAS,kBAAkB,EAAE,QAAQ,GAAG,MAAM,GAAG;AAC/C,SACE,oCAAC,YAAS,UAAU,oCAAC,oBAAiB,MAAM,IAAI,KAC9C,oCAAC,cAAY,GAAG,SACb,OAAO,QAAQ,OAAO,YAAY,GAAG,EAAE,IAAI,CAAC,CAAC,KAAK,KAAK,MAAM;AAC5D,QAAI,OAAO;AACT,YAAM,UAAU,WAAW,GAAG;AAC9B,aACE,oCAAC,cAAW,OACV,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
|
}
|
package/components/Zoom/Zoom.js
CHANGED
|
@@ -1,25 +1,35 @@
|
|
|
1
|
+
import { ZoomSlider } from "ol/control";
|
|
2
|
+
import { easeOut } from "ol/easing";
|
|
3
|
+
import OLMap from "ol/Map";
|
|
4
|
+
import { unByKey } from "ol/Observable";
|
|
5
|
+
import PropTypes from "prop-types";
|
|
1
6
|
import React, {
|
|
7
|
+
useCallback,
|
|
2
8
|
useEffect,
|
|
9
|
+
useMemo,
|
|
3
10
|
useRef,
|
|
4
|
-
|
|
5
|
-
useState,
|
|
6
|
-
useMemo
|
|
11
|
+
useState
|
|
7
12
|
} from "react";
|
|
8
|
-
import
|
|
9
|
-
import { FaPlus, FaMinus } from "react-icons/fa";
|
|
10
|
-
import { ZoomSlider } from "ol/control";
|
|
11
|
-
import OLMap from "ol/Map";
|
|
12
|
-
import { easeOut } from "ol/easing";
|
|
13
|
-
import { unByKey } from "ol/Observable";
|
|
13
|
+
import { FaMinus, FaPlus } from "react-icons/fa";
|
|
14
14
|
const propTypes = {
|
|
15
|
+
/**
|
|
16
|
+
* The zoom delta applied on each click.
|
|
17
|
+
*/
|
|
18
|
+
delta: PropTypes.number,
|
|
15
19
|
/**
|
|
16
20
|
* An [ol/map](https://openlayers.org/en/latest/apidoc/module-ol_Map-Map.html).
|
|
17
21
|
*/
|
|
18
22
|
map: PropTypes.instanceOf(OLMap).isRequired,
|
|
19
23
|
/**
|
|
20
|
-
*
|
|
24
|
+
* Callback function on zoom-in button click.
|
|
25
|
+
* @param {function} Callback function triggered when zoom-in button is clicked. Takes the event as argument.
|
|
21
26
|
*/
|
|
22
|
-
|
|
27
|
+
onZoomInButtonClick: PropTypes.func,
|
|
28
|
+
/**
|
|
29
|
+
* Callback function on zoom-out button click.
|
|
30
|
+
* @param {function} Callback function triggered when the zoom-out button is clicked. Takes the event as argument.
|
|
31
|
+
*/
|
|
32
|
+
onZoomOutButtonClick: PropTypes.func,
|
|
23
33
|
/**
|
|
24
34
|
* Titles HTML attribtues for button.
|
|
25
35
|
*/
|
|
@@ -38,17 +48,7 @@ const propTypes = {
|
|
|
38
48
|
/**
|
|
39
49
|
* Display a slider to zoom.
|
|
40
50
|
*/
|
|
41
|
-
zoomSlider: PropTypes.bool
|
|
42
|
-
/**
|
|
43
|
-
* Callback function on zoom-in button click.
|
|
44
|
-
* @param {function} Callback function triggered when zoom-in button is clicked. Takes the event as argument.
|
|
45
|
-
*/
|
|
46
|
-
onZoomInButtonClick: PropTypes.func,
|
|
47
|
-
/**
|
|
48
|
-
* Callback function on zoom-out button click.
|
|
49
|
-
* @param {function} Callback function triggered when the zoom-out button is clicked. Takes the event as argument.
|
|
50
|
-
*/
|
|
51
|
-
onZoomOutButtonClick: PropTypes.func
|
|
51
|
+
zoomSlider: PropTypes.bool
|
|
52
52
|
};
|
|
53
53
|
const updateZoom = (map, delta) => {
|
|
54
54
|
const view = map.getView();
|
|
@@ -59,13 +59,16 @@ const updateZoom = (map, delta) => {
|
|
|
59
59
|
view.cancelAnimations();
|
|
60
60
|
}
|
|
61
61
|
view.animate({
|
|
62
|
-
zoom: constrainedZoom,
|
|
63
62
|
duration: 250,
|
|
64
|
-
easing: easeOut
|
|
63
|
+
easing: easeOut,
|
|
64
|
+
zoom: constrainedZoom
|
|
65
65
|
});
|
|
66
66
|
};
|
|
67
67
|
function Zoom({
|
|
68
|
+
delta = 1,
|
|
68
69
|
map,
|
|
70
|
+
onZoomInButtonClick = null,
|
|
71
|
+
onZoomOutButtonClick = null,
|
|
69
72
|
titles = {
|
|
70
73
|
zoomIn: "Zoom in",
|
|
71
74
|
zoomOut: "Zoom out"
|
|
@@ -73,9 +76,6 @@ function Zoom({
|
|
|
73
76
|
zoomInChildren = /* @__PURE__ */ React.createElement(FaPlus, { focusable: false }),
|
|
74
77
|
zoomOutChildren = /* @__PURE__ */ React.createElement(FaMinus, { focusable: false }),
|
|
75
78
|
zoomSlider = false,
|
|
76
|
-
onZoomInButtonClick = null,
|
|
77
|
-
onZoomOutButtonClick = null,
|
|
78
|
-
delta = 1,
|
|
79
79
|
...other
|
|
80
80
|
}) {
|
|
81
81
|
const ref = useRef();
|
|
@@ -131,25 +131,25 @@ function Zoom({
|
|
|
131
131
|
/* @__PURE__ */ React.createElement("div", { className: "rs-zooms-bar", ...other }, /* @__PURE__ */ React.createElement(
|
|
132
132
|
"button",
|
|
133
133
|
{
|
|
134
|
-
type: "button",
|
|
135
|
-
tabIndex: 0,
|
|
136
134
|
className: "rs-zoom-in",
|
|
137
|
-
|
|
135
|
+
disabled: zoomInDisabled,
|
|
138
136
|
onClick: zoomIn,
|
|
139
137
|
onKeyPress: zoomIn,
|
|
140
|
-
|
|
138
|
+
tabIndex: 0,
|
|
139
|
+
title: titles.zoomIn,
|
|
140
|
+
type: "button"
|
|
141
141
|
},
|
|
142
142
|
zoomInChildren
|
|
143
143
|
), zoomSlider ? /* @__PURE__ */ React.createElement("div", { className: "rs-zoomslider-wrapper", ref }) : null, /* @__PURE__ */ React.createElement(
|
|
144
144
|
"button",
|
|
145
145
|
{
|
|
146
|
-
type: "button",
|
|
147
|
-
tabIndex: 0,
|
|
148
146
|
className: "rs-zoom-out",
|
|
149
|
-
|
|
147
|
+
disabled: zoomOutDisabled,
|
|
150
148
|
onClick: zoomOut,
|
|
151
149
|
onKeyPress: zoomOut,
|
|
152
|
-
|
|
150
|
+
tabIndex: 0,
|
|
151
|
+
title: titles.zoomOut,
|
|
152
|
+
type: "button"
|
|
153
153
|
},
|
|
154
154
|
zoomOutChildren
|
|
155
155
|
))
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/Zoom/Zoom.js"],
|
|
4
|
-
"sourcesContent": ["import
|
|
5
|
-
"mappings": "AAAA,OAAO;AAAA,EACL;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,
|
|
4
|
+
"sourcesContent": ["import { ZoomSlider } from \"ol/control\";\nimport { easeOut } from \"ol/easing\";\nimport OLMap from \"ol/Map\";\nimport { unByKey } from \"ol/Observable\";\nimport PropTypes from \"prop-types\";\nimport React, {\n useCallback,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from \"react\";\nimport { FaMinus, FaPlus } from \"react-icons/fa\";\n\nconst propTypes = {\n /**\n * The zoom delta applied on each click.\n */\n delta: PropTypes.number,\n\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 * Callback function on zoom-in button click.\n * @param {function} Callback function triggered when zoom-in button is clicked. Takes the event as argument.\n */\n onZoomInButtonClick: PropTypes.func,\n\n /**\n * Callback function on zoom-out button click.\n * @param {function} Callback function triggered when the zoom-out button is clicked. Takes the event as argument.\n */\n onZoomOutButtonClick: PropTypes.func,\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 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 duration: 250,\n easing: easeOut,\n zoom: constrainedZoom,\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 delta = 1,\n map,\n onZoomInButtonClick = null,\n onZoomOutButtonClick = null,\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 ...other\n}) {\n const ref = useRef();\n const [currentZoom, setZoom] = useState();\n\n const zoomIn = useCallback(\n (evt) => {\n if (onZoomInButtonClick) {\n onZoomInButtonClick(evt);\n }\n if (!evt.which || evt.which === 13) {\n updateZoom(map, delta);\n }\n },\n [delta, map, onZoomInButtonClick],\n );\n\n const zoomOut = useCallback(\n (evt) => {\n if (onZoomOutButtonClick) {\n onZoomOutButtonClick(evt);\n }\n if (!evt.which || evt.which === 13) {\n updateZoom(map, -delta);\n }\n },\n [delta, map, onZoomOutButtonClick],\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 className=\"rs-zoom-in\"\n disabled={zoomInDisabled}\n onClick={zoomIn}\n onKeyPress={zoomIn}\n tabIndex={0}\n title={titles.zoomIn}\n type=\"button\"\n >\n {zoomInChildren}\n </button>\n {zoomSlider ? <div className=\"rs-zoomslider-wrapper\" ref={ref} /> : null}\n <button\n className=\"rs-zoom-out\"\n disabled={zoomOutDisabled}\n onClick={zoomOut}\n onKeyPress={zoomOut}\n tabIndex={0}\n title={titles.zoomOut}\n type=\"button\"\n >\n {zoomOutChildren}\n </button>\n </div>\n );\n}\n\nZoom.propTypes = propTypes;\n\nexport default React.memo(Zoom);\n"],
|
|
5
|
+
"mappings": "AAAA,SAAS,kBAAkB;AAC3B,SAAS,eAAe;AACxB,OAAO,WAAW;AAClB,SAAS,eAAe;AACxB,OAAO,eAAe;AACtB,OAAO;AAAA,EACL;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,SAAS,cAAc;AAEhC,MAAM,YAAY;AAAA;AAAA;AAAA;AAAA,EAIhB,OAAO,UAAU;AAAA;AAAA;AAAA;AAAA,EAKjB,KAAK,UAAU,WAAW,KAAK,EAAE;AAAA;AAAA;AAAA;AAAA;AAAA,EAMjC,qBAAqB,UAAU;AAAA;AAAA;AAAA;AAAA;AAAA,EAM/B,sBAAsB,UAAU;AAAA;AAAA;AAAA;AAAA,EAKhC,QAAQ,UAAU,MAAM;AAAA,IACtB,QAAQ,UAAU;AAAA,IAClB,SAAS,UAAU;AAAA,EACrB,CAAC;AAAA;AAAA;AAAA;AAAA,EAKD,gBAAgB,UAAU;AAAA;AAAA;AAAA;AAAA,EAK1B,iBAAiB,UAA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eAAe,MAAM,KAAK,IAAI;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/package.json
CHANGED
|
@@ -2,15 +2,15 @@
|
|
|
2
2
|
"name": "react-spatial",
|
|
3
3
|
"license": "MIT",
|
|
4
4
|
"description": "Components to build React map apps.",
|
|
5
|
-
"version": "1.12.
|
|
5
|
+
"version": "1.12.1",
|
|
6
6
|
"dependencies": {
|
|
7
|
-
"@emotion/react": "^11.
|
|
8
|
-
"@emotion/styled": "^11.
|
|
7
|
+
"@emotion/react": "^11.13.3",
|
|
8
|
+
"@emotion/styled": "^11.13.0",
|
|
9
9
|
"@geops/geops-ui": "0.3.3",
|
|
10
|
-
"@mui/icons-material": "^
|
|
11
|
-
"@mui/material": "^
|
|
10
|
+
"@mui/icons-material": "^6.0.0",
|
|
11
|
+
"@mui/material": "^6.0.0",
|
|
12
12
|
"re-resizable": "6.9.17",
|
|
13
|
-
"react-icons": "5.
|
|
13
|
+
"react-icons": "5.3.0",
|
|
14
14
|
"resize-observer-polyfill": "1.5.1"
|
|
15
15
|
},
|
|
16
16
|
"peerDependencies": {
|
|
@@ -22,36 +22,37 @@
|
|
|
22
22
|
"react-dom": "^18"
|
|
23
23
|
},
|
|
24
24
|
"devDependencies": {
|
|
25
|
-
"@babel/preset-env": "7.
|
|
25
|
+
"@babel/preset-env": "7.25.4",
|
|
26
26
|
"@babel/preset-react": "7.24.7",
|
|
27
27
|
"@cfaester/enzyme-adapter-react-18": "0.8.0",
|
|
28
|
-
"@commitlint/cli": "19.
|
|
29
|
-
"@commitlint/config-conventional": "19.
|
|
28
|
+
"@commitlint/cli": "19.4.1",
|
|
29
|
+
"@commitlint/config-conventional": "19.4.1",
|
|
30
30
|
"@svgr/plugin-jsx": "^8.1.0",
|
|
31
31
|
"@svgr/webpack": "8.1.0",
|
|
32
|
-
"@testing-library/dom": "^10.
|
|
33
|
-
"@testing-library/jest-dom": "6.
|
|
34
|
-
"@testing-library/react": "16.0.
|
|
32
|
+
"@testing-library/dom": "^10.4.0",
|
|
33
|
+
"@testing-library/jest-dom": "6.5.0",
|
|
34
|
+
"@testing-library/react": "16.0.1",
|
|
35
35
|
"@testing-library/user-event": "14.5.2",
|
|
36
36
|
"babel-jest": "29.7.0",
|
|
37
37
|
"babel-loader": "9.1.3",
|
|
38
38
|
"canvas": "2.11.2",
|
|
39
39
|
"css-loader": "7.1.2",
|
|
40
40
|
"enzyme": "3.11.0",
|
|
41
|
-
"esbuild": "^0.23.
|
|
42
|
-
"esbuild-loader": "^4.2.
|
|
41
|
+
"esbuild": "^0.23.1",
|
|
42
|
+
"esbuild-loader": "^4.2.2",
|
|
43
43
|
"eslint": "8",
|
|
44
44
|
"eslint-config-airbnb": "19.0.4",
|
|
45
45
|
"eslint-config-prettier": "9.1.0",
|
|
46
46
|
"eslint-plugin-import": "2.29.1",
|
|
47
47
|
"eslint-plugin-jsx-a11y": "^6.9.0",
|
|
48
|
-
"eslint-plugin-
|
|
49
|
-
"eslint-plugin-
|
|
48
|
+
"eslint-plugin-perfectionist": "^3.3.0",
|
|
49
|
+
"eslint-plugin-prettier": "5.2.1",
|
|
50
|
+
"eslint-plugin-react": "7.35.0",
|
|
50
51
|
"eslint-plugin-react-hooks": "4.6.2",
|
|
51
52
|
"file-loader": "6.2.0",
|
|
52
53
|
"fixpack": "4.0.0",
|
|
53
54
|
"generact": "0.4.0",
|
|
54
|
-
"husky": "9.
|
|
55
|
+
"husky": "9.1.5",
|
|
55
56
|
"identity-obj-proxy": "^3.0.0",
|
|
56
57
|
"is-ci": "3.0.1",
|
|
57
58
|
"jest": "29.7.0",
|
|
@@ -63,33 +64,33 @@
|
|
|
63
64
|
"jest-transform-file": "1.1.1",
|
|
64
65
|
"jest-transformer-svg": "^2.0.2",
|
|
65
66
|
"jsts": "2.11.3",
|
|
66
|
-
"lint-staged": "15.2.
|
|
67
|
+
"lint-staged": "15.2.9",
|
|
67
68
|
"mapbox-gl": "1.13.1",
|
|
68
|
-
"maplibre-gl": "4.
|
|
69
|
+
"maplibre-gl": "4.6.0",
|
|
69
70
|
"mobility-toolbox-js": "2.4.2",
|
|
70
|
-
"ol": "
|
|
71
|
-
"postcss": "^8.4.
|
|
72
|
-
"prettier": "3.3.
|
|
73
|
-
"proj4": "2.
|
|
71
|
+
"ol": "10.1.0",
|
|
72
|
+
"postcss": "^8.4.41",
|
|
73
|
+
"prettier": "3.3.3",
|
|
74
|
+
"proj4": "2.12.0",
|
|
74
75
|
"prop-types": "15.8.1",
|
|
75
76
|
"react": "18.3.1",
|
|
76
77
|
"react-dom": "18.3.1",
|
|
77
78
|
"react-styleguidist": "13.1.3",
|
|
78
79
|
"react-svg-loader": "3.0.3",
|
|
79
80
|
"react-test-renderer": "18.3.1",
|
|
80
|
-
"sass": "1.77.
|
|
81
|
-
"sass-loader": "
|
|
81
|
+
"sass": "1.77.8",
|
|
82
|
+
"sass-loader": "16.0.1",
|
|
82
83
|
"standard-version": "9.5.0",
|
|
83
84
|
"stream-array": "1.1.2",
|
|
84
85
|
"style-loader": "4.0.0",
|
|
85
|
-
"stylelint": "16.
|
|
86
|
+
"stylelint": "16.9.0",
|
|
86
87
|
"stylelint-config-recommended-scss": "14.1.0",
|
|
87
88
|
"stylelint-config-standard": "36.0.1",
|
|
88
|
-
"stylelint-scss": "6.
|
|
89
|
+
"stylelint-scss": "6.5.1",
|
|
89
90
|
"terser-webpack-plugin": "^5.3.10",
|
|
90
91
|
"url-loader": "4.1.1",
|
|
91
92
|
"vinyl-fs": "4.0.0",
|
|
92
|
-
"webpack": "^5.
|
|
93
|
+
"webpack": "^5.94.0",
|
|
93
94
|
"xml-beautifier": "0.5.0"
|
|
94
95
|
},
|
|
95
96
|
"scripts": {
|
|
@@ -130,12 +131,14 @@
|
|
|
130
131
|
"extends": [
|
|
131
132
|
"airbnb",
|
|
132
133
|
"airbnb/hooks",
|
|
134
|
+
"plugin:perfectionist/recommended-alphabetical-legacy",
|
|
133
135
|
"prettier"
|
|
134
136
|
],
|
|
135
137
|
"parserOptions": {
|
|
136
138
|
"ecmaVersion": "latest"
|
|
137
139
|
},
|
|
138
140
|
"plugins": [
|
|
141
|
+
"perfectionist",
|
|
139
142
|
"prettier"
|
|
140
143
|
],
|
|
141
144
|
"rules": {
|
|
@@ -146,6 +149,7 @@
|
|
|
146
149
|
"devDependencies": true
|
|
147
150
|
}
|
|
148
151
|
],
|
|
152
|
+
"react/sort-comp": "off",
|
|
149
153
|
"react/jsx-filename-extension": [
|
|
150
154
|
1,
|
|
151
155
|
{
|
|
@@ -169,7 +173,7 @@
|
|
|
169
173
|
".+\\.svg$": "jest-transformer-svg"
|
|
170
174
|
},
|
|
171
175
|
"transformIgnorePatterns": [
|
|
172
|
-
"node_modules/(?!(color-*|jsts|ol|mobility-toolbox-js
|
|
176
|
+
"node_modules/(?!(color-*|jsts|ol|mobility-toolbox-js|@geops|geotiff|quick-lru|quickselect|rbush|pbf|earcut))"
|
|
173
177
|
],
|
|
174
178
|
"testMatch": [
|
|
175
179
|
"<rootDir>/src/**/?(*.)+(spec|test).[jt]s?(x)"
|
package/propTypes.js
CHANGED
|
@@ -6,25 +6,22 @@ const STATE_TIME_BASED = "TIME_BASED";
|
|
|
6
6
|
const STATE_STOP_CANCELLED = "STOP_CANCELLED";
|
|
7
7
|
const STATE_JOURNEY_CANCELLED = "JOURNEY_CANCELLED";
|
|
8
8
|
const station = PropTypes.shape({
|
|
9
|
-
arrivalDelay: PropTypes.number,
|
|
10
|
-
// time in milliseconds.
|
|
11
9
|
aimedArrivalTime: PropTypes.number,
|
|
12
10
|
// time in milliseconds.
|
|
11
|
+
aimedDepartureTime: PropTypes.number,
|
|
12
|
+
// time in milliseconds.
|
|
13
|
+
arrivalDelay: PropTypes.number,
|
|
14
|
+
// time in milliseconds.
|
|
13
15
|
arrivalTime: PropTypes.number,
|
|
14
16
|
// time in milliseconds with the delay included.
|
|
15
17
|
cancelled: PropTypes.bool,
|
|
16
18
|
coordinates: PropTypes.arrayOf(PropTypes.number),
|
|
17
|
-
aimedDepartureTime: PropTypes.number,
|
|
18
|
-
// time in milliseconds.
|
|
19
19
|
departureDelay: PropTypes.number,
|
|
20
20
|
// time in milliseconds.
|
|
21
21
|
departureTime: PropTypes.number,
|
|
22
22
|
// time in milliseconds with the delay included
|
|
23
23
|
noDropOff: PropTypes.bool,
|
|
24
24
|
noPickUp: PropTypes.bool,
|
|
25
|
-
stationId: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
26
|
-
stationName: PropTypes.string,
|
|
27
|
-
wheelchairAccessible: PropTypes.bool,
|
|
28
25
|
state: PropTypes.oneOf([
|
|
29
26
|
null,
|
|
30
27
|
STATE_BOARDING,
|
|
@@ -33,7 +30,10 @@ const station = PropTypes.shape({
|
|
|
33
30
|
STATE_TIME_BASED,
|
|
34
31
|
STATE_STOP_CANCELLED,
|
|
35
32
|
STATE_JOURNEY_CANCELLED
|
|
36
|
-
])
|
|
33
|
+
]),
|
|
34
|
+
stationId: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
35
|
+
stationName: PropTypes.string,
|
|
36
|
+
wheelchairAccessible: PropTypes.bool
|
|
37
37
|
});
|
|
38
38
|
const lineInfos = PropTypes.shape({
|
|
39
39
|
backgroundColor: PropTypes.string,
|
|
@@ -61,7 +61,7 @@ const lineInfos = PropTypes.shape({
|
|
|
61
61
|
});
|
|
62
62
|
export default {
|
|
63
63
|
lineInfos,
|
|
64
|
-
station,
|
|
65
64
|
STATE_BOARDING,
|
|
66
|
-
STATE_LEAVING
|
|
65
|
+
STATE_LEAVING,
|
|
66
|
+
station
|
|
67
67
|
};
|
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
|
|
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,
|
|
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 aimedArrivalTime: PropTypes.number, // time in milliseconds.\n aimedDepartureTime: PropTypes.number, // time in milliseconds.\n arrivalDelay: 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 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 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 stationId: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),\n stationName: PropTypes.string,\n wheelchairAccessible: PropTypes.bool,\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 STATE_BOARDING,\n STATE_LEAVING,\n station,\n};\n"],
|
|
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,kBAAkB,UAAU;AAAA;AAAA,EAC5B,oBAAoB,UAAU;AAAA;AAAA,EAC9B,cAAc,UAAU;AAAA;AAAA,EACxB,aAAa,UAAU;AAAA;AAAA,EACvB,WAAW,UAAU;AAAA,EACrB,aAAa,UAAU,QAAQ,UAAU,MAAM;AAAA,EAC/C,gBAAgB,UAAU;AAAA;AAAA,EAC1B,eAAe,UAAU;AAAA;AAAA,EACzB,WAAW,UAAU;AAAA,EACrB,UAAU,UAAU;AAAA,EACpB,OAAO,UAAU,MAAM;AAAA,IACrB;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,CAAC;AAAA,EACD,WAAW,UAAU,UAAU,CAAC,UAAU,QAAQ,UAAU,MAAM,CAAC;AAAA,EACnE,aAAa,UAAU;AAAA,EACvB,sBAAsB,UAAU;AAClC,CAAC;AAED,MAAM,YAAY,UAAU,MAAM;AAAA,EAChC,iBAAiB,UAAU;A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