@geops/rvf-mobility-web-component 0.1.19 → 0.1.20
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/CHANGELOG.md +9 -0
- package/index.js +62 -74
- package/package.json +1 -1
- package/src/RvfFeatureDetails/RvfSharedMobilityDetail/FloatingVehiclesDetails/FloatingVehiclesDetails.tsx +14 -17
- package/src/RvfFeatureDetails/RvfSharedMobilityDetail/RvfSharedMobilityDetails.tsx +7 -9
- package/src/RvfFeatureDetails/RvfSharedMobilityDetail/StationDetails/StationDetails.tsx +2 -2
- package/src/RvfLink/RvfLink.tsx +45 -0
- package/src/RvfLink/index.tsx +1 -0
- package/src/RvfMobilityMap/RvfMobilityMap.tsx +1 -1
- package/src/logos/natur_energie_logo.png +0 -0
- package/src/logos/natur_energie_logo.xcf +0 -0
- package/src/logos/yoio_logo.png +0 -0
- package/src/logos/zeus_logo.png +0 -0
- package/src/logos/zeus_logo.xcf +0 -0
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@geops/rvf-mobility-web-component",
|
|
3
3
|
"license": "UNLICENSED",
|
|
4
4
|
"description": "Web components for rvf in the domains of mobility and logistics.",
|
|
5
|
-
"version": "0.1.
|
|
5
|
+
"version": "0.1.20",
|
|
6
6
|
"homepage": "https://rvf-mobility-web-component-geops.vercel.app/",
|
|
7
7
|
"type": "module",
|
|
8
8
|
"main": "index.js",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Feature } from "ol";
|
|
2
2
|
|
|
3
|
-
import
|
|
3
|
+
import RvfLink from "../../../RvfLink";
|
|
4
4
|
import { PROVIDER_BY_FEED_ID } from "../../../utils/constants";
|
|
5
5
|
import getLinkByDevice from "../../../utils/getLinkByDevice";
|
|
6
6
|
|
|
@@ -51,23 +51,20 @@ function FloatingVehiclesDetails({ features }: FloatingVehiclesDetailsProps) {
|
|
|
51
51
|
const link = getLinkByDevice(features?.[0]);
|
|
52
52
|
|
|
53
53
|
return (
|
|
54
|
-
<div className="flex flex-col overflow-scroll">
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
54
|
+
<div className="flex flex-1 flex-col gap-2 overflow-scroll">
|
|
55
|
+
<div className="flex flex-1 flex-col gap-2 overflow-scroll">
|
|
56
|
+
<div>{features.length} Fahrzeuge</div>
|
|
57
|
+
<div className="flex flex-1 flex-col overflow-scroll">
|
|
58
|
+
<div className="text-grey">Fahrzeug mieten</div>
|
|
59
|
+
<ul className="list-disc overflow-scroll pl-4 underline underline-offset-2">
|
|
60
|
+
{renderedDetails}
|
|
61
|
+
</ul>
|
|
62
|
+
</div>
|
|
63
|
+
</div>
|
|
60
64
|
{feedId && link && (
|
|
61
|
-
<
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
rel="noreferrer"
|
|
65
|
-
target="_blank"
|
|
66
|
-
>
|
|
67
|
-
<RvfButton className={"border-none"}>
|
|
68
|
-
Über {PROVIDER_BY_FEED_ID[feedId]}
|
|
69
|
-
</RvfButton>
|
|
70
|
-
</a>
|
|
65
|
+
<div className="flex justify-center">
|
|
66
|
+
<RvfLink href={link}>Über {PROVIDER_BY_FEED_ID[feedId]}</RvfLink>
|
|
67
|
+
</div>
|
|
71
68
|
)}
|
|
72
69
|
</div>
|
|
73
70
|
);
|
|
@@ -102,21 +102,19 @@ function RvfSharedMobilityDetails({
|
|
|
102
102
|
};
|
|
103
103
|
|
|
104
104
|
return (
|
|
105
|
-
|
|
106
|
-
<
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
/>
|
|
112
|
-
</div>
|
|
105
|
+
<>
|
|
106
|
+
<img
|
|
107
|
+
alt="logo"
|
|
108
|
+
className="max-w-24"
|
|
109
|
+
src={logos[features[0]?.get("feed_id")]}
|
|
110
|
+
/>
|
|
113
111
|
{features.length && isStationDetails && (
|
|
114
112
|
<StationDetails feature={features[0]} />
|
|
115
113
|
)}
|
|
116
114
|
{!!features[0]?.get("form_factor") && isFloatingVehicle && (
|
|
117
115
|
<FloatingVehiclesDetails features={features} />
|
|
118
116
|
)}
|
|
119
|
-
|
|
117
|
+
</>
|
|
120
118
|
);
|
|
121
119
|
}
|
|
122
120
|
|
|
@@ -13,11 +13,11 @@ function StationDetails({ feature }: StationDetailsProps) {
|
|
|
13
13
|
}, [feature]);
|
|
14
14
|
|
|
15
15
|
return (
|
|
16
|
-
<div className="flex flex-col">
|
|
16
|
+
<div className="flex flex-col gap-2">
|
|
17
17
|
{feature.get("num_vehicles_available")} Fahrzeuge
|
|
18
18
|
{link && (
|
|
19
19
|
<a
|
|
20
|
-
className={"my-
|
|
20
|
+
className={"my-10 flex items-center justify-center"}
|
|
21
21
|
href={link}
|
|
22
22
|
rel="noreferrer"
|
|
23
23
|
target="_blank"
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import type { JSX, PreactDOMAttributes } from "preact";
|
|
2
|
+
|
|
3
|
+
import { memo, useMemo } from "preact/compat";
|
|
4
|
+
import { twMerge } from "tailwind-merge";
|
|
5
|
+
|
|
6
|
+
export type RvfLinkProps = {
|
|
7
|
+
theme?: "primary" | "secondary";
|
|
8
|
+
} & JSX.AnchorHTMLAttributes<HTMLAnchorElement> &
|
|
9
|
+
PreactDOMAttributes;
|
|
10
|
+
|
|
11
|
+
const baseClasses =
|
|
12
|
+
"my-1 flex gap-2 text-[14px] @sm/main:text-[16px] @md/main:text-[18px] items-center justify-left font-semibold text-button";
|
|
13
|
+
|
|
14
|
+
export const themes = {
|
|
15
|
+
primary: {
|
|
16
|
+
classes:
|
|
17
|
+
"bg-red text-white disabled:bg-lightgrey hover:bg-darkred hover:border-darkred active:bg-lightred active:border-lightred ",
|
|
18
|
+
selectedClasses: "bg-darkred border-darkred",
|
|
19
|
+
},
|
|
20
|
+
secondary: {
|
|
21
|
+
classes: "bg-white text-grey hover:text-red active:text-lightred",
|
|
22
|
+
selectedClasses: "text-red",
|
|
23
|
+
},
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
function RvfLink({
|
|
27
|
+
children,
|
|
28
|
+
className,
|
|
29
|
+
theme = "secondary",
|
|
30
|
+
...props
|
|
31
|
+
}: RvfLinkProps) {
|
|
32
|
+
const classes = useMemo(() => {
|
|
33
|
+
return twMerge(
|
|
34
|
+
`${baseClasses} ${themes[theme].classes} ${className || ""}`,
|
|
35
|
+
);
|
|
36
|
+
}, [className, theme]);
|
|
37
|
+
|
|
38
|
+
return (
|
|
39
|
+
<a className={classes} rel="noreferrer" target="_blank" {...props}>
|
|
40
|
+
{children}
|
|
41
|
+
</a>
|
|
42
|
+
);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export default memo(RvfLink);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from "./RvfLink";
|
|
@@ -554,7 +554,7 @@ function RvfMobilityMap({
|
|
|
554
554
|
}}
|
|
555
555
|
title={getFeatureInformationTitle(selectedFeature)}
|
|
556
556
|
></RvfOverlayHeader>
|
|
557
|
-
<RvfFeatureDetails className="relative flex flex-col gap-
|
|
557
|
+
<RvfFeatureDetails className="relative flex h-full flex-col gap-4 overflow-y-auto overflow-x-hidden p-4" />
|
|
558
558
|
</>
|
|
559
559
|
)}
|
|
560
560
|
{hasToolbar && hasPrint && isExportMenuOpen && (
|
|
Binary file
|
|
Binary file
|
package/src/logos/yoio_logo.png
CHANGED
|
Binary file
|
package/src/logos/zeus_logo.png
CHANGED
|
Binary file
|
|
Binary file
|