@geops/rvf-mobility-web-component 0.1.45 → 0.1.47-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.prettierrc.js +3 -1
- package/CHANGELOG.md +7 -0
- package/README.md +1 -1
- package/doc/package.json +4 -3
- package/doc/postcss.config.mjs +1 -1
- package/doc/src/app/components/GeopsMobilityDoc.tsx +13 -224
- package/doc/src/app/components/GeopsMobilitySearchDoc.tsx +11 -107
- package/doc/src/app/components/WebComponentDoc.tsx +45 -56
- package/doc/src/app/geops-mobility/page.tsx +7 -2
- package/doc/src/app/geops-mobility-search/page.tsx +6 -2
- package/doc/src/app/globals.css +47 -27
- package/doc/src/app/layout.tsx +4 -2
- package/docutils.js +33 -17
- package/eslint.config.mjs +28 -34
- package/iframe.html +5624 -201
- package/index.html +108 -88
- package/index.js +2229 -1976
- package/input.css +21 -3
- package/package.json +37 -40
- package/scripts/build.mjs +2 -2
- package/scripts/dev.mjs +3 -3
- package/search.html +70 -23
- package/src/BaseLayer/BaseLayer.tsx +2 -1
- package/src/Copyright/Copyright.tsx +4 -2
- package/src/DebugDeparture/DebugDeparture.tsx +16 -12
- package/src/DebugStop/DebugStop.tsx +2 -2
- package/src/Departure/Departure.tsx +2 -3
- package/src/EmbedNavigation/DragPanWarning.ts +125 -0
- package/src/EmbedNavigation/EmbedNavigation.tsx +52 -0
- package/src/EmbedNavigation/index.js +1 -0
- package/src/EmbedNavigation/index.tsx +1 -0
- package/src/GeolocationButton/GeolocationButton.tsx +11 -35
- package/src/GeolocationButton/index.tsx +1 -1
- package/src/Map/Map.tsx +5 -3
- package/src/MapDispatchEvents/MapDispatchEvents.tsx +78 -0
- package/src/MapDispatchEvents/index.tsx +1 -0
- package/src/MobilityMap/MobilityMap.tsx +117 -162
- package/src/MobilityMap/MobilityMapAttributes.test.ts +21 -0
- package/src/MobilityMap/MobilityMapAttributes.ts +243 -0
- package/src/MobilityMap/index.tsx +1 -0
- package/src/MobilitySearch/MobilitySearch.tsx +35 -0
- package/src/MobilitySearch/MobilitySearchAttributes.test.ts +21 -0
- package/src/MobilitySearch/MobilitySearchAttributes.ts +68 -0
- package/src/MobilitySearch/index.ts +2 -0
- package/src/NotificationLayer/NotificationLayer.tsx +27 -4
- package/src/Overlay/Overlay.tsx +24 -11
- package/src/Permalink/Permalink.tsx +77 -0
- package/src/Permalink/index.tsx +1 -0
- package/src/RealtimeLayer/RealtimeLayer.tsx +72 -33
- package/src/RouteDestination/RouteDestination.tsx +3 -3
- package/src/RouteIcon/RouteIcon.tsx +33 -25
- package/src/RouteIcon/index.tsx +1 -1
- package/src/RouteIdentifier/RouteIdentifer.tsx +6 -5
- package/src/RouteInfos/RouteInfos.tsx +7 -3
- package/src/RouteSchedule/RouteSchedule.tsx +3 -3
- package/src/RouteScheduleFooter/RouteScheduleFooter.tsx +1 -1
- package/src/RouteScheduleHeader/RouteScheduleHeader.tsx +7 -29
- package/src/RouteStop/RouteStop.tsx +8 -11
- package/src/RouteStopDelay/RouteStopDelay.tsx +2 -1
- package/src/RouteStopName/RouteStopName.tsx +2 -2
- package/src/RouteStopPlatform/RouteStopPlatform.tsx +2 -2
- package/src/RouteStopProgress/RouteStopProgress.tsx +2 -1
- package/src/RouteStopServices/RouteStopServices.tsx +2 -2
- package/src/RouteStopStation/RouteStopStation.tsx +8 -2
- package/src/RouteStopTime/RouteStopTime.tsx +2 -1
- package/src/RvfButton/RvfButton.tsx +14 -5
- package/src/RvfCheckbox/RvfCheckbox.tsx +8 -8
- package/src/RvfEmbedNavigation/DragPanWarning.ts +5 -5
- package/src/RvfEmbedNavigation/RvfEmbedNavigation.tsx +1 -0
- package/src/RvfExportMenu/RvfExportMenu.tsx +14 -12
- package/src/RvfExportMenuButton/RvfExportMenuButton.tsx +6 -7
- package/src/RvfFeatureDetails/RvfFeatureDetails.tsx +5 -5
- package/src/RvfFeatureDetails/RvfLineNetworkDetails/RvfLineNetworkDetails.tsx +164 -138
- package/src/RvfFeatureDetails/RvfNotificationDetails/RvfNotificationDetails.tsx +151 -109
- package/src/RvfFeatureDetails/RvfSellingPointDetails/RvfSellingPointDetails.tsx +2 -2
- package/src/RvfFeatureDetails/RvfSharedMobilityDetail/FloatingVehiclesDetails/FloatingVehiclesDetails.tsx +3 -3
- package/src/RvfFeatureDetails/RvfSharedMobilityDetail/RvfSharedMobilityDetails.tsx +8 -6
- package/src/RvfFeatureDetails/RvfSharedMobilityDetail/StationDetails/StationDetails.tsx +5 -4
- package/src/RvfFeatureDetailsTitle/RvfFeatureDetailsTitle.tsx +81 -0
- package/src/RvfFeatureDetailsTitle/index.tsx +1 -0
- package/src/RvfFloatingMenu/RvfFloatingMenu.tsx +4 -4
- package/src/RvfGeolocationButton/GeolocationButton.tsx +98 -0
- package/src/RvfGeolocationButton/index.tsx +1 -0
- package/src/RvfIconButton/RvfIconButton.tsx +20 -9
- package/src/RvfInputCopy/RvfInputCopy.tsx +8 -8
- package/src/RvfLayerTree/RvfLayerTree.tsx +5 -2
- package/src/RvfLayerTree/TreeItem/TreeItem.tsx +13 -16
- package/src/RvfLayerTree/layersTreeReducer.ts +23 -18
- package/src/RvfLayerTreeButton/RvfLayerTreeButton.tsx +6 -6
- package/src/RvfLineNetworkPlanLayer/RvfLineNetworkPlanLayer.tsx +2 -1
- package/src/RvfLink/RvfLink.tsx +4 -3
- package/src/RvfMobilityMap/RvfMobilityMap.tsx +314 -322
- package/src/RvfModal/RvfModal.tsx +4 -3
- package/src/RvfOverlayContent/RvfOverlayContent.tsx +126 -0
- package/src/RvfOverlayContent/index.ts +0 -0
- package/src/RvfOverlayHeader/RvfOverlayHeader.tsx +13 -10
- package/src/RvfPermalink/RvfPermalink.tsx +2 -2
- package/src/RvfPoisLayer/RvfPoisLayer.tsx +2 -1
- package/src/RvfRadioButton/RvfRadioButton.tsx +1 -1
- package/src/RvfRouteIcon/RvfRouteIcon.tsx +10 -0
- package/src/RvfRouteIcon/index.tsx +1 -0
- package/src/RvfSearch/RvfSearch.tsx +4 -1
- package/src/RvfSearchButton/RvfSearchButton.tsx +27 -0
- package/src/RvfSearchButton/index.tsx +1 -0
- package/src/RvfSelect/RvfSelect.tsx +7 -5
- package/src/RvfSelectedFeatureHighlightLayer/RvfSelectedFeatureHighlightLayer.tsx +1 -2
- package/src/RvfSellingPointsLayer/RvfSellingPointsLayer.tsx +2 -1
- package/src/RvfShare/RvfPermalinkButton/RvfPermalinkButton.tsx +13 -12
- package/src/RvfShare/RvfShare.tsx +11 -10
- package/src/RvfShareMenuButton/RvfShareMenuButton.tsx +5 -5
- package/src/RvfSharedMobilityLayerGroup/RvfSharedMobilityLayerGroup.tsx +25 -22
- package/src/RvfSingleClickListener/RvfSingleClickListener.tsx +46 -31
- package/src/RvfTarifZonenLayer/RvfTarifZonenLayer.tsx +2 -1
- package/src/RvfTopics/RvfTopics.tsx +6 -5
- package/src/RvfZoomButtons/RvfZoomButtons.tsx +3 -3
- package/src/ScaleLine/ScaleLine.tsx +5 -4
- package/src/ScrollableHandler/ScrollableHandler.tsx +2 -1
- package/src/ScrollableHandler/index.tsx +1 -1
- package/src/SingleClickListener/SingleClickListener.tsx +47 -4
- package/src/Station/Station.tsx +5 -5
- package/src/StationName/StationName.tsx +3 -3
- package/src/StationServices/StationServices.tsx +3 -3
- package/src/StationsLayer/StationsLayer.tsx +5 -4
- package/src/StopsSearch/StopsSearch.tsx +115 -84
- package/src/WindowMessageListener/WindowMessageListener.tsx +67 -0
- package/src/WindowMessageListener/index.tsx +1 -0
- package/src/icons/Airport/Airport.tsx +4 -4
- package/src/icons/ArrowDown/ArrowDown.tsx +1 -1
- package/src/icons/ArrowUp/ArrowUp.tsx +1 -1
- package/src/icons/ArrowUpRight/ArrowUpRight.tsx +1 -1
- package/src/icons/BarAndRestaurants/BarAndRestaurants.tsx +2 -2
- package/src/icons/Bathroom/Bathroom.tsx +1 -1
- package/src/icons/Copy/Copy.tsx +1 -1
- package/src/icons/Doc/Doc.tsx +1 -1
- package/src/icons/Email/Email.tsx +1 -1
- package/src/icons/FilePdf/FilePdf.tsx +1 -1
- package/src/icons/Geolocation/Geolocation.tsx +3 -5
- package/src/icons/Image/Image.tsx +1 -1
- package/src/icons/Menu/Menu.tsx +1 -1
- package/src/icons/Minus/Minus.tsx +1 -1
- package/src/icons/NoRealtime/NoRealtime.tsx +1 -1
- package/src/icons/Plus/Plus.tsx +1 -1
- package/src/icons/Police/Police.tsx +3 -3
- package/src/icons/Share/Share.tsx +1 -1
- package/src/icons/Stack/Stack.tsx +1 -1
- package/src/icons/Tracking/Tracking.tsx +29 -0
- package/src/icons/Tracking/airport-14-svgrepo-com.svg +41 -0
- package/src/icons/Tracking/index.tsx +1 -0
- package/src/icons/WaitingAreas/WaitingAreas.tsx +1 -1
- package/src/icons/WheelChair/WheelChair.tsx +1 -1
- package/src/index.tsx +8 -46
- package/src/indexDoc.ts +13 -0
- package/src/ui/Button/Button.tsx +57 -0
- package/src/ui/Button/index.tsx +1 -0
- package/src/ui/IconButton/IconButton.tsx +44 -0
- package/src/ui/IconButton/index.tsx +1 -0
- package/src/utils/MobilityEvent.ts +4 -3
- package/src/utils/applyInitialLayerVisibility.ts +3 -3
- package/src/utils/centerOnStation.ts +3 -2
- package/src/utils/centerOnVehicle.ts +5 -4
- package/src/utils/constants.ts +17 -3
- package/src/utils/exportPdf.ts +26 -20
- package/src/utils/fullTrajectoryStyle.ts +2 -2
- package/src/utils/getAllLayers.ts +4 -3
- package/src/utils/getDelayColor.test.ts +1 -0
- package/src/utils/getDelayColorForVehicle.test.ts +2 -0
- package/src/utils/getDelayString.test.ts +3 -0
- package/src/utils/getDelayTextForVehicle.test.ts +4 -0
- package/src/utils/getFullTrajectoryAndFit.ts +4 -3
- package/src/utils/getHoursAndMinutes.test.ts +1 -0
- package/src/utils/getLayersAsFlatArray.ts +2 -2
- package/src/utils/getLinkByDevice.ts +1 -1
- package/src/utils/getMainColorForVehicle.ts +3 -3
- package/src/utils/getPermalinkParameters.ts +2 -2
- package/src/utils/getStopStatus.test.ts +2 -1
- package/src/utils/getStopStatus.ts +1 -1
- package/src/utils/getTextForVehicle.ts +1 -1
- package/src/utils/hooks/useDeparture.tsx +6 -5
- package/src/utils/hooks/useI18n.tsx +6 -4
- package/src/utils/hooks/useInitialLayersVisiblity.tsx +2 -1
- package/src/utils/hooks/useLayerConfig.tsx +39 -0
- package/src/utils/hooks/useMapContext.tsx +30 -18
- package/src/utils/hooks/useRouteStop.tsx +3 -2
- package/src/utils/hooks/useRvfContext.tsx +11 -3
- package/src/utils/hooks/useStation.tsx +2 -1
- package/src/utils/hooks/useUpdatePermalink.tsx +25 -24
- package/src/utils/hooks/useZoom.tsx +4 -4
- package/src/utils/realtimeRVFStyle.ts +5 -4
- package/src/utils/sharingGraphqlUtils.ts +3 -2
- package/src/utils/sharingStylesUtils.ts +7 -7
- package/src/utils/sharingWFSUtils.ts +9 -15
- package/tailwind.config.mjs +1 -0
- package/tsconfig.json +1 -1
- package/doc/tailwind.config.ts +0 -20
- package/src/utils/getFeatureInformationTitle.tsx +0 -54
package/.prettierrc.js
CHANGED
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
+
### [0.1.46](https://github.com/geops/rvf-mobility-web-component/compare/v0.1.45...v0.1.46) (2025-08-01)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
* use good style ([f54b312](https://github.com/geops/rvf-mobility-web-component/commit/f54b312c8bbedcbaa686aff08d69959a52d8fc6b))
|
|
11
|
+
|
|
5
12
|
### [0.1.45](https://github.com/geops/rvf-mobility-web-component/compare/v0.1.44...v0.1.45) (2025-07-30)
|
|
6
13
|
|
|
7
14
|
|
package/README.md
CHANGED
|
@@ -71,7 +71,7 @@ Here an exhaustive list of the `<geops-mobility>` web component attributes avail
|
|
|
71
71
|
- [`mots="rail,bus"`](https://mobility-web-component.geops.io/?mots=rail,bus): list of commas separated mots to display on the Realtime layer ( rail, bus, coach, foot, tram, subway, gondola, funicular, ferry, car).
|
|
72
72
|
- [`notification="false"`](https://mobility-web-component.geops.io/?notification=true): display the notification layer or not (true or false). Default to true.
|
|
73
73
|
- [`notificationat="2025-01-01T12:00:00Z"`](https://mobility-web-component.geops.io/?notificationat=2025-01-01T12:00:00Z): a ISO date string used to display active notification at this date in the notification layer.
|
|
74
|
-
- [`
|
|
74
|
+
- [`notificationtenant=`](https://mobility-web-component.geops.io/?notificationtenant=): the MOCO notification tenant to get the notifications from.
|
|
75
75
|
- [`notificationurl=`](https://mobility-web-component.geops.io/?notificationurl=): the MOCO notification url to get the notifications from.
|
|
76
76
|
- [`permalink="true"`](https://mobility-web-component.geops.io/?permalink=true): add automatically an `x`,`y` an `z` URL parameters to the URL to allow to share the current map view. Default to false.
|
|
77
77
|
- [`realtime="false"`](https://mobility-web-component.geops.io/?realtime=false): display the realtime layer or not (true or false). Default to true.
|
package/doc/package.json
CHANGED
|
@@ -19,6 +19,7 @@
|
|
|
19
19
|
"typeface-lato": "^1.1.13"
|
|
20
20
|
},
|
|
21
21
|
"devDependencies": {
|
|
22
|
+
"@tailwindcss/postcss": "^4.1.11",
|
|
22
23
|
"@types/node": "^22.10.1",
|
|
23
24
|
"@types/react": "^18.3.13",
|
|
24
25
|
"@types/react-dom": "^18",
|
|
@@ -27,9 +28,9 @@
|
|
|
27
28
|
"eslint-config-next": "15.0.3",
|
|
28
29
|
"eslint-config-prettier": "^9.1.0",
|
|
29
30
|
"generact": "^0.4.0",
|
|
30
|
-
"postcss": "^8.
|
|
31
|
-
"tailwindcss": "^
|
|
32
|
-
"typescript": "^5.
|
|
31
|
+
"postcss": "^8.5.6",
|
|
32
|
+
"tailwindcss": "^4.1.11",
|
|
33
|
+
"typescript": "^5.8.3"
|
|
33
34
|
},
|
|
34
35
|
"scripts": {
|
|
35
36
|
"build": "next build",
|
package/doc/postcss.config.mjs
CHANGED
|
@@ -1,235 +1,24 @@
|
|
|
1
|
-
|
|
1
|
+
"use client";
|
|
2
2
|
import { Suspense } from "react";
|
|
3
3
|
|
|
4
4
|
import useIsFullScreen from "../hooks/useIsFullScreen";
|
|
5
|
-
import GeopsAPIKeyLink from "./GeopsAPIKeyLink";
|
|
6
|
-
import GeopsMapsAPILink from "./GeopsMapsAPILink";
|
|
7
5
|
import GeopsMobility from "./GeopsMobility";
|
|
8
|
-
import GeopsRealtimeAPILink from "./GeopsRealtimeAPILink";
|
|
9
|
-
import GeopsStopsAPILink from "./GeopsStopsAPILink";
|
|
10
|
-
import Link from "./Link";
|
|
11
6
|
import WebComponentDoc, { AttrConfig } from "./WebComponentDoc";
|
|
12
7
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
description: (
|
|
16
|
-
<Typography>
|
|
17
|
-
Your <GeopsAPIKeyLink />.
|
|
18
|
-
</Typography>
|
|
19
|
-
),
|
|
20
|
-
type: "textfield",
|
|
21
|
-
},
|
|
22
|
-
baselayer: {
|
|
23
|
-
defaultValue: "travic_v2",
|
|
24
|
-
description: (
|
|
25
|
-
<Typography>
|
|
26
|
-
The style's name from the <GeopsMapsAPILink />
|
|
27
|
-
(base_dark_v2, base_bright_v2, ...).
|
|
28
|
-
</Typography>
|
|
29
|
-
),
|
|
30
|
-
type: "select",
|
|
31
|
-
},
|
|
32
|
-
center: {
|
|
33
|
-
defaultValue: "831634,5933959",
|
|
34
|
-
description: (
|
|
35
|
-
<Typography>The center of the map in EPSG:3857 coordinates.</Typography>
|
|
36
|
-
),
|
|
37
|
-
type: "textfield",
|
|
38
|
-
},
|
|
39
|
-
extent: {
|
|
40
|
-
description: (
|
|
41
|
-
<Typography>
|
|
42
|
-
The extent of the map in EPSG:3857 coordinates (ex:
|
|
43
|
-
830634,5923959,831634,5933959). It has the priority over center and zoom
|
|
44
|
-
attributes.
|
|
45
|
-
</Typography>
|
|
46
|
-
),
|
|
47
|
-
type: "textfield",
|
|
48
|
-
},
|
|
49
|
-
geolocation: {
|
|
50
|
-
defaultValue: "true",
|
|
51
|
-
description: (
|
|
52
|
-
<Typography>
|
|
53
|
-
Display the geolocation button or not (true or false).
|
|
54
|
-
</Typography>
|
|
55
|
-
),
|
|
56
|
-
type: "checkbox",
|
|
57
|
-
},
|
|
58
|
-
mapsurl: {
|
|
59
|
-
defaultValue: "https://maps.geops.io",
|
|
60
|
-
description: (
|
|
61
|
-
<Typography>
|
|
62
|
-
The <GeopsMapsAPILink /> url to use.
|
|
63
|
-
</Typography>
|
|
64
|
-
),
|
|
65
|
-
type: "textfield",
|
|
66
|
-
},
|
|
67
|
-
maxextent: {
|
|
68
|
-
description: (
|
|
69
|
-
<Typography>
|
|
70
|
-
Constraint the map in a specific extent in EPSG:3857 coordinates, the
|
|
71
|
-
user can not navigate outside this extent.
|
|
72
|
-
</Typography>
|
|
73
|
-
),
|
|
74
|
-
type: "textfield",
|
|
75
|
-
},
|
|
76
|
-
maxzoom: {
|
|
77
|
-
description: <Typography>Define the max zoom level of the map.</Typography>,
|
|
78
|
-
props: {
|
|
79
|
-
slotProps: {
|
|
80
|
-
input: {
|
|
81
|
-
max: 22,
|
|
82
|
-
min: 0,
|
|
83
|
-
step: 1,
|
|
84
|
-
},
|
|
85
|
-
},
|
|
86
|
-
type: "number",
|
|
87
|
-
},
|
|
88
|
-
type: "textfield",
|
|
89
|
-
},
|
|
90
|
-
minzoom: {
|
|
91
|
-
description: <Typography>Define the min zoom level of the map.</Typography>,
|
|
92
|
-
props: {
|
|
93
|
-
slotProps: {
|
|
94
|
-
input: {
|
|
95
|
-
max: 22,
|
|
96
|
-
min: 0,
|
|
97
|
-
step: 1,
|
|
98
|
-
},
|
|
99
|
-
},
|
|
100
|
-
type: "number",
|
|
101
|
-
},
|
|
102
|
-
type: "textfield",
|
|
103
|
-
},
|
|
104
|
-
mots: {
|
|
105
|
-
description: (
|
|
106
|
-
<Typography>
|
|
107
|
-
Commas separated list of mots to display on the Realtime layer (rail,
|
|
108
|
-
bus, coach, foot, tram, subway, gondola, funicular, ferry, car).
|
|
109
|
-
</Typography>
|
|
110
|
-
),
|
|
111
|
-
type: "textfield",
|
|
112
|
-
},
|
|
113
|
-
notification: {
|
|
114
|
-
defaultValue: "true",
|
|
115
|
-
description: (
|
|
116
|
-
<Typography>
|
|
117
|
-
Display the notification layer or not (true or false). This layer will
|
|
118
|
-
display informations about disruptions on the network. Data comes from
|
|
119
|
-
our{" "}
|
|
120
|
-
<Link href="https://geops.com/en/solution/disruption-information">
|
|
121
|
-
geOps MOCO tool
|
|
122
|
-
</Link>
|
|
123
|
-
. It works it combination with `notificationurl`.
|
|
124
|
-
</Typography>
|
|
125
|
-
),
|
|
126
|
-
type: "checkbox",
|
|
127
|
-
},
|
|
128
|
-
notificationat: {
|
|
129
|
-
description: (
|
|
130
|
-
<Typography>
|
|
131
|
-
An ISO date string used to display active notification at this date in
|
|
132
|
-
the notification layer. If not defined the current date will be used.
|
|
133
|
-
</Typography>
|
|
134
|
-
),
|
|
135
|
-
type: "textfield",
|
|
136
|
-
},
|
|
137
|
-
notificationbeforelayerid: {
|
|
138
|
-
description: (
|
|
139
|
-
<Typography>
|
|
140
|
-
The style layer's id before which the notification layer will be
|
|
141
|
-
added. By default the layer will be added on top.
|
|
142
|
-
</Typography>
|
|
143
|
-
),
|
|
144
|
-
type: "textfield",
|
|
145
|
-
},
|
|
146
|
-
notificationurl: {
|
|
147
|
-
description: (
|
|
148
|
-
<Typography>
|
|
149
|
-
The{" "}
|
|
150
|
-
<Link href="https://geops.com/en/solution/disruption-information">
|
|
151
|
-
geOps MOCO API
|
|
152
|
-
</Link>{" "}
|
|
153
|
-
url to get the notifications from.
|
|
154
|
-
</Typography>
|
|
155
|
-
),
|
|
156
|
-
type: "textfield",
|
|
157
|
-
},
|
|
158
|
-
// x,y,z are not applies on refresh
|
|
159
|
-
// permalink: {
|
|
160
|
-
// defaultValue: "false",
|
|
161
|
-
// description: (
|
|
162
|
-
// <Typography>
|
|
163
|
-
// Add automatically an `x`,`y` an `z` URL parameters to the URL to allow
|
|
164
|
-
// to share the current mapview. Default to false.
|
|
165
|
-
// </Typography>
|
|
166
|
-
// ),
|
|
167
|
-
// type: "checkbox",
|
|
168
|
-
// },
|
|
169
|
-
realtime: {
|
|
170
|
-
defaultValue: "true",
|
|
171
|
-
description: (
|
|
172
|
-
<Typography>
|
|
173
|
-
Display the realtime layer or not (true or false). This layer display
|
|
174
|
-
realtime vehicles on the map using the <GeopsRealtimeAPILink />.
|
|
175
|
-
</Typography>
|
|
176
|
-
),
|
|
177
|
-
type: "checkbox",
|
|
178
|
-
},
|
|
179
|
-
realtimeurl: {
|
|
180
|
-
defaultValue: "wss://api.geops.io/tracker-ws/v1/ws",
|
|
181
|
-
description: (
|
|
182
|
-
<Typography>
|
|
183
|
-
The <GeopsRealtimeAPILink /> url to use.
|
|
184
|
-
</Typography>
|
|
185
|
-
),
|
|
186
|
-
type: "textfield",
|
|
187
|
-
},
|
|
188
|
-
search: {
|
|
189
|
-
defaultValue: "true",
|
|
190
|
-
description: (
|
|
191
|
-
<Typography>
|
|
192
|
-
Display the search stops input or not (true or false).
|
|
193
|
-
</Typography>
|
|
194
|
-
),
|
|
195
|
-
type: "checkbox",
|
|
196
|
-
},
|
|
197
|
-
stopsurl: {
|
|
198
|
-
defaultValue: "https://api.geops.io/stops/v1/",
|
|
199
|
-
description: (
|
|
200
|
-
<Typography>
|
|
201
|
-
The <GeopsStopsAPILink /> url to use.
|
|
202
|
-
</Typography>
|
|
203
|
-
),
|
|
204
|
-
type: "textfield",
|
|
205
|
-
},
|
|
206
|
-
tenant: {
|
|
207
|
-
description: (
|
|
208
|
-
<Typography>
|
|
209
|
-
The tenant name to use to filter the Realtime vehicles available.
|
|
210
|
-
</Typography>
|
|
211
|
-
),
|
|
212
|
-
type: "textfield",
|
|
213
|
-
},
|
|
214
|
-
zoom: {
|
|
215
|
-
defaultValue: "13",
|
|
216
|
-
description: <Typography>The initial zoom level of the map.</Typography>,
|
|
217
|
-
props: {
|
|
218
|
-
slotProps: {
|
|
219
|
-
input: {
|
|
220
|
-
max: 22,
|
|
221
|
-
min: 0,
|
|
222
|
-
step: 1,
|
|
223
|
-
},
|
|
224
|
-
},
|
|
225
|
-
type: "number",
|
|
226
|
-
},
|
|
227
|
-
type: "textfield",
|
|
228
|
-
},
|
|
229
|
-
};
|
|
8
|
+
let attrsConfig: Record<string, AttrConfig>;
|
|
9
|
+
|
|
230
10
|
function GeopsMobilityDoc() {
|
|
231
11
|
const isFullScreen = useIsFullScreen();
|
|
232
12
|
|
|
13
|
+
if (typeof window !== undefined) {
|
|
14
|
+
// @ts-expect-error - MobilityMapAttributes is added via a script file.
|
|
15
|
+
attrsConfig = window.MobilityMapAttributes;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
if (!attrsConfig) {
|
|
19
|
+
return null;
|
|
20
|
+
}
|
|
21
|
+
|
|
233
22
|
return (
|
|
234
23
|
<Suspense>
|
|
235
24
|
<WebComponentDoc
|
|
@@ -238,7 +27,7 @@ function GeopsMobilityDoc() {
|
|
|
238
27
|
Comp={GeopsMobility}
|
|
239
28
|
compProps={{
|
|
240
29
|
class: isFullScreen
|
|
241
|
-
? "fixed inset-0 w-screen h-sccreen z-
|
|
30
|
+
? "fixed inset-0 w-screen h-sccreen z-9000 bg-white"
|
|
242
31
|
: "block h-96 max-w-full resize overflow-auto bg-white",
|
|
243
32
|
}}
|
|
244
33
|
tagName="geops-mobility"
|
|
@@ -1,117 +1,21 @@
|
|
|
1
|
-
|
|
1
|
+
"use client";
|
|
2
2
|
import { Suspense } from "react";
|
|
3
3
|
|
|
4
|
-
import GeopsAPIKeyLink from "./GeopsAPIKeyLink";
|
|
5
4
|
import GeopsMobilitySearch from "./GeopsMobilitySearch";
|
|
6
|
-
import GeopsStopsAPILink from "./GeopsStopsAPILink";
|
|
7
5
|
import WebComponentDoc, { AttrConfig } from "./WebComponentDoc";
|
|
8
6
|
|
|
9
|
-
|
|
10
|
-
apikey: {
|
|
11
|
-
description: (
|
|
12
|
-
<Typography>
|
|
13
|
-
Your <GeopsAPIKeyLink />.
|
|
14
|
-
</Typography>
|
|
15
|
-
),
|
|
16
|
-
type: "textfield",
|
|
17
|
-
},
|
|
18
|
-
bbox: {
|
|
19
|
-
description: (
|
|
20
|
-
<Typography>
|
|
21
|
-
The extent where to search the stops (minx,miny,maxx,maxy).
|
|
22
|
-
</Typography>
|
|
23
|
-
),
|
|
24
|
-
type: "textfield",
|
|
25
|
-
},
|
|
26
|
-
countrycode: {
|
|
27
|
-
description: (
|
|
28
|
-
<Typography>
|
|
29
|
-
The country code to filter the results (IT, DE, CH ...)
|
|
30
|
-
</Typography>
|
|
31
|
-
),
|
|
32
|
-
type: "textfield",
|
|
33
|
-
},
|
|
34
|
-
event: {
|
|
35
|
-
defaultValue: "mwc:stopssearchselect",
|
|
36
|
-
description: (
|
|
37
|
-
<Typography>
|
|
38
|
-
The event&pos;s name to listen to when a stop is selected.
|
|
39
|
-
</Typography>
|
|
40
|
-
),
|
|
41
|
-
type: "textfield",
|
|
42
|
-
},
|
|
43
|
-
field: {
|
|
44
|
-
description: (
|
|
45
|
-
<Typography>
|
|
46
|
-
Which field to look up, default all of them, Possible values:id, name,
|
|
47
|
-
coords.
|
|
48
|
-
</Typography>
|
|
49
|
-
),
|
|
50
|
-
type: "textfield",
|
|
51
|
-
},
|
|
52
|
-
limit: {
|
|
53
|
-
defaultValue: "5",
|
|
54
|
-
description: <Typography>The number of suggestions to show.</Typography>,
|
|
55
|
-
props: {
|
|
56
|
-
slotProps: {
|
|
57
|
-
input: {
|
|
58
|
-
max: 100,
|
|
59
|
-
min: 0,
|
|
60
|
-
step: 1,
|
|
61
|
-
},
|
|
62
|
-
},
|
|
63
|
-
type: "number",
|
|
64
|
-
},
|
|
65
|
-
type: "textfield",
|
|
66
|
-
},
|
|
67
|
-
mots: {
|
|
68
|
-
description: (
|
|
69
|
-
<Typography>
|
|
70
|
-
Commas separated list of mots used to filter the results (rail, bus,
|
|
71
|
-
coach, foot, tram, subway, gondola, funicular, ferry, car).
|
|
72
|
-
</Typography>
|
|
73
|
-
),
|
|
74
|
-
type: "textfield",
|
|
75
|
-
},
|
|
76
|
-
params: {
|
|
77
|
-
description: (
|
|
78
|
-
<Typography>
|
|
79
|
-
JSON string with additional parameters to pass to the request to the
|
|
80
|
-
API. Ex: {"{ 'key': 'value' }"}
|
|
81
|
-
</Typography>
|
|
82
|
-
),
|
|
83
|
-
type: "textfield",
|
|
84
|
-
},
|
|
85
|
-
prefagencies: {
|
|
86
|
-
description: (
|
|
87
|
-
<Typography>
|
|
88
|
-
Comma seperated list, order chooses which agency will be preferred as
|
|
89
|
-
ident_source (for id and code fields). Possible values: sbb, db.
|
|
90
|
-
</Typography>
|
|
91
|
-
),
|
|
92
|
-
type: "textfield",
|
|
93
|
-
},
|
|
94
|
-
reflocation: {
|
|
95
|
-
description: (
|
|
96
|
-
<Typography>
|
|
97
|
-
Coordinates in WGS84 (in lat,lon order) used to rank stops close to this
|
|
98
|
-
position higher
|
|
99
|
-
</Typography>
|
|
100
|
-
),
|
|
101
|
-
type: "textfield",
|
|
102
|
-
},
|
|
103
|
-
url: {
|
|
104
|
-
defaultValue: "https://api.geops.io/stops/v1/",
|
|
105
|
-
description: (
|
|
106
|
-
<Typography>
|
|
107
|
-
The <GeopsStopsAPILink /> url to use.
|
|
108
|
-
</Typography>
|
|
109
|
-
),
|
|
110
|
-
type: "textfield",
|
|
111
|
-
},
|
|
112
|
-
};
|
|
7
|
+
let attrsConfig: Record<string, AttrConfig>;
|
|
113
8
|
|
|
114
9
|
function GeopsMobilitySearchDoc() {
|
|
10
|
+
if (typeof window !== undefined) {
|
|
11
|
+
// @ts-expect-error - MobilitySearchAttributes is added via a script file.
|
|
12
|
+
attrsConfig = window.MobilitySearchAttributes;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
if (!attrsConfig) {
|
|
16
|
+
return null;
|
|
17
|
+
}
|
|
18
|
+
|
|
115
19
|
return (
|
|
116
20
|
<Suspense>
|
|
117
21
|
<WebComponentDoc
|
|
@@ -2,8 +2,6 @@
|
|
|
2
2
|
import {
|
|
3
3
|
Button,
|
|
4
4
|
Checkbox,
|
|
5
|
-
MenuItem,
|
|
6
|
-
Select,
|
|
7
5
|
TextField,
|
|
8
6
|
TextFieldProps,
|
|
9
7
|
Typography,
|
|
@@ -26,7 +24,7 @@ export interface AttrConfig {
|
|
|
26
24
|
defaultValue?: string;
|
|
27
25
|
description: ReactNode;
|
|
28
26
|
props?: TextFieldProps;
|
|
29
|
-
type
|
|
27
|
+
type?: "boolean";
|
|
30
28
|
}
|
|
31
29
|
|
|
32
30
|
function WebComponentDoc({
|
|
@@ -175,7 +173,7 @@ function WebComponentDoc({
|
|
|
175
173
|
HTML code
|
|
176
174
|
</Typography>
|
|
177
175
|
<br />
|
|
178
|
-
<SyntaxHighlighter className="
|
|
176
|
+
<SyntaxHighlighter className="m-0!" language="xml">
|
|
179
177
|
{code}
|
|
180
178
|
</SyntaxHighlighter>
|
|
181
179
|
<br />
|
|
@@ -196,9 +194,8 @@ function WebComponentDoc({
|
|
|
196
194
|
<table className="w-full">
|
|
197
195
|
<thead>
|
|
198
196
|
<tr>
|
|
199
|
-
<th className="w-
|
|
200
|
-
<th className="w-
|
|
201
|
-
<th className="w-[45%] border px-4 py-2">Description</th>
|
|
197
|
+
<th className="w-1/5 border px-4 py-2">Name</th>
|
|
198
|
+
<th className="w-4/5 border px-4 py-2">Description</th>
|
|
202
199
|
</tr>
|
|
203
200
|
</thead>
|
|
204
201
|
<tbody>
|
|
@@ -218,21 +215,19 @@ function WebComponentDoc({
|
|
|
218
215
|
} = attrsConfig[key] || {};
|
|
219
216
|
return (
|
|
220
217
|
<tr key={key}>
|
|
221
|
-
<td className="border
|
|
222
|
-
<td className="border
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
<
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
<div className="mt-2">
|
|
218
|
+
<td className="w-1/5 border p-4">{key}</td>
|
|
219
|
+
<td className="w-2/5 border p-4">
|
|
220
|
+
<div className="flex flex-col gap-4 justify-start">
|
|
221
|
+
{!type && (
|
|
222
|
+
<div className="flex gap-2">
|
|
223
|
+
<TextField
|
|
224
|
+
defaultValue={attributes[key]}
|
|
225
|
+
id={key}
|
|
226
|
+
placeholder={defaultValue}
|
|
227
|
+
variant="outlined"
|
|
228
|
+
{...props}
|
|
229
|
+
/>
|
|
234
230
|
<Button
|
|
235
|
-
fullWidth
|
|
236
231
|
onClick={() => {
|
|
237
232
|
onChange(
|
|
238
233
|
key,
|
|
@@ -247,42 +242,36 @@ function WebComponentDoc({
|
|
|
247
242
|
Apply
|
|
248
243
|
</Button>
|
|
249
244
|
</div>
|
|
245
|
+
)}
|
|
246
|
+
{type === "boolean" && (
|
|
247
|
+
<Checkbox
|
|
248
|
+
className="w-8"
|
|
249
|
+
defaultChecked={
|
|
250
|
+
(searchParams.get(key) || defaultValue) === "true"
|
|
251
|
+
}
|
|
252
|
+
onChange={(evt) => {
|
|
253
|
+
onChange(
|
|
254
|
+
key,
|
|
255
|
+
evt.target.checked ? "true" : "false",
|
|
256
|
+
);
|
|
257
|
+
}}
|
|
258
|
+
/>
|
|
259
|
+
)}
|
|
260
|
+
<div>
|
|
261
|
+
{typeof description !== "string" ? (
|
|
262
|
+
description
|
|
263
|
+
) : (
|
|
264
|
+
<Typography
|
|
265
|
+
dangerouslySetInnerHTML={{ __html: description }}
|
|
266
|
+
/>
|
|
267
|
+
)}{" "}
|
|
268
|
+
{defaultValue && (
|
|
269
|
+
<>
|
|
270
|
+
<i>Default to "{defaultValue}"</i>
|
|
271
|
+
</>
|
|
272
|
+
)}
|
|
250
273
|
</div>
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
{type === "checkbox" && (
|
|
254
|
-
<Checkbox
|
|
255
|
-
defaultChecked={
|
|
256
|
-
(searchParams.get(key) || defaultValue) === "true"
|
|
257
|
-
}
|
|
258
|
-
onChange={(evt) => {
|
|
259
|
-
onChange(key, evt.target.checked ? "true" : "false");
|
|
260
|
-
}}
|
|
261
|
-
/>
|
|
262
|
-
)}
|
|
263
|
-
|
|
264
|
-
{type === "select" && (
|
|
265
|
-
<Select
|
|
266
|
-
defaultValue={searchParams.get(key) || defaultValue}
|
|
267
|
-
fullWidth
|
|
268
|
-
onChange={(evt) => {
|
|
269
|
-
onChange(key, evt.target.value);
|
|
270
|
-
}}
|
|
271
|
-
variant="standard"
|
|
272
|
-
>
|
|
273
|
-
<MenuItem value="travic_v2">Travic v2</MenuItem>
|
|
274
|
-
<MenuItem value="base_dark_v2">Dark v2</MenuItem>
|
|
275
|
-
</Select>
|
|
276
|
-
)}
|
|
277
|
-
</td>
|
|
278
|
-
<td className="border p-4">
|
|
279
|
-
{description}{" "}
|
|
280
|
-
{defaultValue && (
|
|
281
|
-
<>
|
|
282
|
-
<br />
|
|
283
|
-
<i>Default to "{defaultValue}"</i>
|
|
284
|
-
</>
|
|
285
|
-
)}
|
|
274
|
+
</div>
|
|
286
275
|
</td>
|
|
287
276
|
</tr>
|
|
288
277
|
);
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import
|
|
2
|
+
import dynamic from "next/dynamic";
|
|
3
|
+
|
|
4
|
+
const DynamicComponentWithNoSSR = dynamic(
|
|
5
|
+
() => import("../components/GeopsMobilityDoc"),
|
|
6
|
+
{ ssr: false },
|
|
7
|
+
);
|
|
3
8
|
|
|
4
9
|
export default function GeopsMobility() {
|
|
5
|
-
return <
|
|
10
|
+
return <DynamicComponentWithNoSSR />;
|
|
6
11
|
}
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use client";
|
|
2
|
+
import dynamic from "next/dynamic";
|
|
2
3
|
|
|
3
|
-
|
|
4
|
+
const DynamicComponentWithNoSSR = dynamic(
|
|
5
|
+
() => import("../components/GeopsMobilitySearchDoc"),
|
|
6
|
+
{ ssr: false },
|
|
7
|
+
);
|
|
4
8
|
|
|
5
9
|
export default function GeopsMobilitySearch() {
|
|
6
|
-
return <
|
|
10
|
+
return <DynamicComponentWithNoSSR />;
|
|
7
11
|
}
|