@geops/rvf-mobility-web-component 0.1.30 → 0.1.32
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 +26 -0
- package/docutils.js +11 -2
- package/index.html +28 -10
- package/index.js +298 -148
- package/package.json +2 -1
- package/src/Map/Map.tsx +4 -0
- package/src/NotificationLayer/NotificationLayer.tsx +32 -2
- package/src/NotificationLayer/notificationUtils.ts +4 -0
- package/src/RvfFeatureDetails/RvfFeatureDetails.tsx +19 -4
- package/src/RvfFeatureDetails/RvfLineNetworkDetails/RvfLineNetworkDetails.tsx +98 -0
- package/src/RvfFeatureDetails/RvfLineNetworkDetails/index.js +1 -0
- package/src/RvfFeatureDetails/RvfNotificationDetails/RvfNotificationDetails.tsx +77 -0
- package/src/RvfFeatureDetails/RvfNotificationDetails/index.ts +1 -0
- package/src/RvfFeatureDetails/{RVFSellingPointDetails/RVFSellingPointDetails.tsx → RvfSellingPointDetails/RvfSellingPointDetails.tsx} +2 -2
- package/src/RvfFeatureDetails/RvfSellingPointDetails/index.js +1 -0
- package/src/RvfLineNetworkPlanLayer/RvfLineNetworkPlanLayer.tsx +3 -2
- package/src/RvfMobilityMap/RvfMobilityMap.tsx +3 -5
- package/src/RvfSelectedFeatureHighlightLayer/RvfSelectedFeatureHighlightLayer.tsx +9 -1
- package/src/utils/getFeatureInformationTitle.ts +4 -0
- package/tailwind.config.mjs +1 -1
- package/src/RvfFeatureDetails/RVFSellingPointDetails/index.js +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,32 @@
|
|
|
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.32](https://github.com/geops/rvf-mobility-web-component/compare/v0.1.31...v0.1.32) (2025-02-20)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
* remove default border and add documentation ([8291492](https://github.com/geops/rvf-mobility-web-component/commit/82914928dd2cbe2150d32f1a9cc4f4e82ffa3f9c))
|
|
11
|
+
|
|
12
|
+
### [0.1.31](https://github.com/geops/rvf-mobility-web-component/compare/v0.1.30...v0.1.31) (2025-02-19)
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
### Features
|
|
16
|
+
|
|
17
|
+
* add line network details view ([038082f](https://github.com/geops/rvf-mobility-web-component/commit/038082fec96a2b5b0a705556c742252d5c239d28))
|
|
18
|
+
* add notifications details ([b37e9e2](https://github.com/geops/rvf-mobility-web-component/commit/b37e9e29194664445558864bd36c0280855f8de9))
|
|
19
|
+
* add notifications details ([dfa3c10](https://github.com/geops/rvf-mobility-web-component/commit/dfa3c10c8493d195a909b42537fb1eef456b62aa))
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
### Bug Fixes
|
|
23
|
+
|
|
24
|
+
* add border radius ([19b0293](https://github.com/geops/rvf-mobility-web-component/commit/19b0293af213c7ccce043c5685323578e844d8ab))
|
|
25
|
+
* add border radius ([042d2b9](https://github.com/geops/rvf-mobility-web-component/commit/042d2b97f8f10d2ebcdd4244459b174aaa31a916))
|
|
26
|
+
* add border radius ([b5ca9d2](https://github.com/geops/rvf-mobility-web-component/commit/b5ca9d2ba77e78d74e38376d885c163944c62043))
|
|
27
|
+
* improve documentation ([7b1f39b](https://github.com/geops/rvf-mobility-web-component/commit/7b1f39b2dc33e6d3ee7b20379b7da2a323874e51))
|
|
28
|
+
* improve documentation ([d06619d](https://github.com/geops/rvf-mobility-web-component/commit/d06619d9a060fbdba3b6f1c874f5e95ae4ee3119))
|
|
29
|
+
* re add preview ([b994540](https://github.com/geops/rvf-mobility-web-component/commit/b994540bb51a9e593242e3c9cefaf90ffa628246))
|
|
30
|
+
|
|
5
31
|
### [0.1.30](https://github.com/geops/rvf-mobility-web-component/compare/v0.1.29...v0.1.30) (2025-02-18)
|
|
6
32
|
|
|
7
33
|
|
package/docutils.js
CHANGED
|
@@ -63,6 +63,7 @@ function generateAttributesTable(
|
|
|
63
63
|
wc,
|
|
64
64
|
attrs,
|
|
65
65
|
booleanAttrs = [],
|
|
66
|
+
booleanTrueByDefault = [],
|
|
66
67
|
descriptionByAttr = {},
|
|
67
68
|
) {
|
|
68
69
|
let innerHMTL = `<table class="table-auto w-full" >
|
|
@@ -79,6 +80,14 @@ function generateAttributesTable(
|
|
|
79
80
|
.sort()
|
|
80
81
|
.map((key) => {
|
|
81
82
|
const isBoolean = booleanAttrs.includes(key);
|
|
83
|
+
const defaultChecked = booleanTrueByDefault.includes(key)
|
|
84
|
+
? "checked"
|
|
85
|
+
: "";
|
|
86
|
+
const currValue = wc.getAttribute(key);
|
|
87
|
+
let checked = currValue === "true" ? "checked" : "";
|
|
88
|
+
if (currValue !== "true" && currValue !== "false") {
|
|
89
|
+
checked = defaultChecked;
|
|
90
|
+
}
|
|
82
91
|
return `
|
|
83
92
|
<tr>
|
|
84
93
|
<td class="border px-4 py-2">${key}</td>
|
|
@@ -92,7 +101,7 @@ function generateAttributesTable(
|
|
|
92
101
|
type="checkbox"
|
|
93
102
|
class="border"
|
|
94
103
|
name="${key}"
|
|
95
|
-
${
|
|
104
|
+
${checked ? "checked" : ""}
|
|
96
105
|
onchange="document.querySelector('${wc.localName}').setAttribute('${key}', this.checked);onAttributeUpdate(document.querySelector('${wc.localName}'),this.name, this.checked);"
|
|
97
106
|
/>`
|
|
98
107
|
: `
|
|
@@ -126,7 +135,7 @@ function generateCodeText(
|
|
|
126
135
|
let codeText = "";
|
|
127
136
|
codeText = `<script\n\ttype="module"\n\tsrc="${pkgSrc}">
|
|
128
137
|
</script>
|
|
129
|
-
<${wc.localName} style="display:block;width:100%;height:500px;"`;
|
|
138
|
+
<${wc.localName} style="display:block;width:100%;height:500px;border:1px solid #e5e7eb;border-radius:16px;"`;
|
|
130
139
|
|
|
131
140
|
attrs.forEach((key) => {
|
|
132
141
|
const attributeValue = wc.getAttribute(key);
|
package/index.html
CHANGED
|
@@ -38,10 +38,10 @@
|
|
|
38
38
|
<h1 class="flex gap-4"><img src="./Logo.svg">Mobility Web Component</h1>
|
|
39
39
|
<p>This is a demo of the Mobility Web Component.</p>
|
|
40
40
|
<h2>Usage example</h2>
|
|
41
|
-
<pre id="code" class="bg-slate-800 text-slate-200 p-4 rounded"></pre>
|
|
41
|
+
<pre id="code" class="bg-slate-800 text-slate-200 p-4 rounded overflow-auto"></pre>
|
|
42
42
|
|
|
43
43
|
<geops-mobility
|
|
44
|
-
class="h-96 block resize overflow-
|
|
44
|
+
class="h-96 block resize overflow-hidden w-full border rounded-[16px]"
|
|
45
45
|
></geops-mobility>
|
|
46
46
|
|
|
47
47
|
<br />
|
|
@@ -67,11 +67,13 @@
|
|
|
67
67
|
const attrs = [
|
|
68
68
|
// "apikey",
|
|
69
69
|
// "baselayer",
|
|
70
|
-
|
|
70
|
+
"center",
|
|
71
71
|
"details",
|
|
72
|
-
|
|
72
|
+
"extent",
|
|
73
|
+
"geolocation",
|
|
73
74
|
"layers",
|
|
74
75
|
"layertree",
|
|
76
|
+
"maxextent",
|
|
75
77
|
// "mapsurl",
|
|
76
78
|
// "mots",
|
|
77
79
|
// "notification",
|
|
@@ -81,11 +83,13 @@
|
|
|
81
83
|
"realtime",
|
|
82
84
|
"share",
|
|
83
85
|
// "realtimeUrl",
|
|
84
|
-
"search",
|
|
86
|
+
// "search",
|
|
85
87
|
// "tenant",
|
|
86
|
-
|
|
88
|
+
"zoom",
|
|
87
89
|
"permalink",
|
|
88
|
-
"print"
|
|
90
|
+
"print",
|
|
91
|
+
"toolbar",
|
|
92
|
+
"maxextent",
|
|
89
93
|
];
|
|
90
94
|
|
|
91
95
|
const booleanAttrs = [
|
|
@@ -93,12 +97,14 @@
|
|
|
93
97
|
"geolocation",
|
|
94
98
|
"notification",
|
|
95
99
|
"realtime",
|
|
96
|
-
"search",
|
|
100
|
+
// "search",
|
|
97
101
|
"permalink",
|
|
98
102
|
"layertree",
|
|
99
103
|
"share",
|
|
100
|
-
"print"
|
|
104
|
+
"print",
|
|
105
|
+
"toolbar",
|
|
101
106
|
];
|
|
107
|
+
const booleanTrueByDefault = [ "details", "print", "share", "layertree", "geolocation", "toolbar", "realtime"];
|
|
102
108
|
|
|
103
109
|
const events = [
|
|
104
110
|
"singleclick",
|
|
@@ -107,11 +113,23 @@
|
|
|
107
113
|
];
|
|
108
114
|
|
|
109
115
|
const descriptionByAttr = {
|
|
116
|
+
extent: "The extent to show when opening the map in EPSG:3857 coordinates, ex: 831634,5933959,940649,6173660. Default is the RVF data extent: 834896.1809495519,6057089.852937808,940649.6972031617,6173660.451962929 . Parameter required if center and zoom are not set.",
|
|
117
|
+
maxextent: "The maximum extent of the map in EPSG:3857 coordinates, ex: 831634,5933959,940649,6173660. Default is the RVF data extent: [834896.1809495519,6057089.852937808,940649.6972031617,6173660.451962929 .",
|
|
118
|
+
search: "Show/hide the search bar on the map. Default to false.",
|
|
119
|
+
permalink: "Add/remove url paremeters to the current window location. These parameters are used to store the current state of the map. They will be used on page load to configure the web-compnent. Default to false. Parameter required if extent is not set.",
|
|
120
|
+
center: "The center of the map in EPSG:3857 coordinates, ex: 831634,5933959. The center must be inside the RVF extent: [834896.1809495519, 6057089.852937808, 940649.6972031617, 6173660.451962929]. Default to null. Parameter required if extent is not set.",
|
|
121
|
+
zoom: "The zoom level of the map (between 0 and 20). Default to null. If maxextent paramter is defined some values will not have any effects because the view will be constraint to the maxextent defined. Parameter required if extent is not set.",
|
|
122
|
+
print: "Show/hide the print button in the toolbar. Default to true.",
|
|
123
|
+
share: "Show/hide the share button in the toolbar. Default to true.",
|
|
124
|
+
layertree: "Show/hide the layer tree button in the toolbar. Default to true.",
|
|
125
|
+
geolocation: "Show/hide geolocation button on the map. Default to true.",
|
|
126
|
+
toolbar: "Show/hide the toolbar on the left. Default to true.",
|
|
110
127
|
layers: "A comma separated list of layers: echtzeit,haltestellen,verkaufsstellen,liniennetz,tarifzonen,fahrrad,auto,cargobike,e-roller,mitfahrpunkt,pois",
|
|
111
128
|
details: "Show shared mobility details in the sidebar when we click on an shared mobility feature.",
|
|
129
|
+
realtime: "Show/hide the realtime data in the map. Default to true."
|
|
112
130
|
};
|
|
113
131
|
|
|
114
|
-
document.querySelector('#attributes').innerHTML = generateAttributesTable(wc, attrs, booleanAttrs, descriptionByAttr);
|
|
132
|
+
document.querySelector('#attributes').innerHTML = generateAttributesTable(wc, attrs, booleanAttrs, booleanTrueByDefault, descriptionByAttr);
|
|
115
133
|
document.querySelector('#events').innerHTML = generateEventsTable(wc, events);
|
|
116
134
|
document.querySelector('#code').innerHTML = generateCodeText(wc, attrs, pkgSrc);
|
|
117
135
|
wc.addEventListener('mwc:attribute', (event) => {
|