@geops/rvf-mobility-web-component 0.1.46 → 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/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/index.html
CHANGED
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
}
|
|
19
19
|
</script>
|
|
20
20
|
<script type="module" src="./index.js"></script>
|
|
21
|
+
<script type="module" src="./indexDoc.js"></script>
|
|
21
22
|
<script src="./docutils.js"></script>
|
|
22
23
|
<link rel="stylesheet" type="text/css" href="./output.css" />
|
|
23
24
|
<style>
|
|
@@ -32,21 +33,33 @@
|
|
|
32
33
|
</head>
|
|
33
34
|
<body class="p-8">
|
|
34
35
|
<!-- tailwind hack to add class used in docutils -->
|
|
35
|
-
<div
|
|
36
|
-
|
|
36
|
+
<div
|
|
37
|
+
class="absolute inset-0 flex h-full w-full table-auto gap-4 flex-col border bg-black p-0 px-4 py-2 pt-2 text-white hover:bg-gray-700"
|
|
38
|
+
style="display: none"
|
|
39
|
+
></div>
|
|
40
|
+
<div class="pt-2" style="display: none"></div>
|
|
37
41
|
<div id="doc" style="display: none" class="mx-auto max-w-3xl space-y-4">
|
|
38
42
|
<h1 class="flex gap-4"><img src="./Logo.svg">Mobility Web Component</h1>
|
|
39
43
|
<p>This is a demo of the Mobility Web Component.</p>
|
|
40
44
|
<h2>Usage example</h2>
|
|
41
|
-
<pre
|
|
45
|
+
<pre
|
|
46
|
+
id="code"
|
|
47
|
+
class="overflow-auto rounded bg-slate-800 p-4 text-slate-200"
|
|
48
|
+
></pre>
|
|
42
49
|
|
|
43
50
|
<geops-mobility
|
|
44
|
-
class="h-96
|
|
51
|
+
class="block h-96 w-full resize overflow-hidden rounded-2xl border"
|
|
52
|
+
></geops-mobility>
|
|
45
53
|
|
|
46
54
|
<br />
|
|
47
55
|
<h2 class="text-xl font-bold">Attributes</h2>
|
|
48
56
|
<div id="attributes"></div>
|
|
49
57
|
<h2 class="text-xl font-bold">Events</h2>
|
|
58
|
+
<pre id="code" class="rounded bg-slate-800 p-4 text-slate-200">
|
|
59
|
+
document.getElementById('map').addEventListener('mwc:attribute', (event) => {
|
|
60
|
+
console.log('Display last data received:', event.data);
|
|
61
|
+
});</pre
|
|
62
|
+
>
|
|
50
63
|
<div id="events"></div>
|
|
51
64
|
<br />
|
|
52
65
|
<br />
|
|
@@ -63,95 +76,102 @@
|
|
|
63
76
|
const pkgSrc = "https://www.unpkg.com/@geops/rvf-mobility-web-component";
|
|
64
77
|
const wc = document.querySelector("geops-mobility");
|
|
65
78
|
|
|
66
|
-
|
|
67
|
-
// "apikey",
|
|
68
|
-
// "baselayer",
|
|
69
|
-
"center",
|
|
70
|
-
"details",
|
|
71
|
-
"extent",
|
|
72
|
-
"geolocation",
|
|
73
|
-
"layers",
|
|
74
|
-
"layertree",
|
|
75
|
-
// "mapsurl",
|
|
76
|
-
// "mots",
|
|
77
|
-
"notification",
|
|
78
|
-
// "notificationat",
|
|
79
|
-
// "notificationurl",
|
|
80
|
-
// "notificationbeforelayerid",
|
|
81
|
-
"realtime",
|
|
82
|
-
"share",
|
|
83
|
-
// "realtimeUrl",
|
|
84
|
-
"search",
|
|
85
|
-
// "tenant",
|
|
86
|
-
"zoom",
|
|
87
|
-
"permalink",
|
|
88
|
-
"print",
|
|
89
|
-
"toolbar",
|
|
90
|
-
"maxextent",
|
|
91
|
-
"embed",
|
|
92
|
-
"debug",
|
|
93
|
-
"fullscreen",
|
|
94
|
-
"runs",
|
|
95
|
-
];
|
|
79
|
+
window.addEventListener("load", () => {
|
|
96
80
|
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
"fullscreen",
|
|
111
|
-
"runs",
|
|
112
|
-
];
|
|
113
|
-
const booleanTrueByDefault = [ "details", "print", "share", "layertree", "geolocation", "toolbar", "realtime"];
|
|
114
|
-
const reloadAttrs = [ "fullscreen" ]
|
|
81
|
+
// Add special parameters
|
|
82
|
+
window.MobilityMapAttributes.fullscreen = {
|
|
83
|
+
type: "boolean",
|
|
84
|
+
defaultValue: "false",
|
|
85
|
+
description: `Load the page in fullscreen mode.`,
|
|
86
|
+
reload: true,
|
|
87
|
+
};
|
|
88
|
+
window.MobilityMapAttributes.debug = {
|
|
89
|
+
type: "boolean",
|
|
90
|
+
defaultValue: "false",
|
|
91
|
+
description: "Displays debug information for vehicles when true, use only for debugging.",
|
|
92
|
+
reload: true,
|
|
93
|
+
};
|
|
115
94
|
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
95
|
+
/* Attributes */
|
|
96
|
+
const attrs = Object.keys(MobilityMapAttributes);
|
|
97
|
+
const booleanAttrs = Object.entries(MobilityMapAttributes)
|
|
98
|
+
.filter(([, attr]) => attr.type === "boolean")
|
|
99
|
+
.map(([key]) => key);
|
|
100
|
+
const booleanTrueByDefault = booleanAttrs.filter(
|
|
101
|
+
(key) => MobilityMapAttributes[key].defaultValue === "true",
|
|
102
|
+
);
|
|
103
|
+
const reloadAttrs = Object.entries(MobilityMapAttributes)
|
|
104
|
+
.filter(([key, attr]) => !!attr.reload)
|
|
105
|
+
.map(([key]) => key);
|
|
121
106
|
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
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-component. Default to false. Parameter required if extent is not set.",
|
|
127
|
-
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.",
|
|
128
|
-
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.",
|
|
129
|
-
print: "Show/hide the print button in the toolbar. Default to true.",
|
|
130
|
-
share: "Show/hide the share button in the toolbar. Default to true.",
|
|
131
|
-
layertree: "Show/hide the layer tree button in the toolbar. Default to true.",
|
|
132
|
-
geolocation: "Show/hide geolocation button on the map. Default to true.",
|
|
133
|
-
toolbar: "Show/hide the toolbar on the left. Default to true.",
|
|
134
|
-
layers: "A comma separated list of layers: echtzeit,haltestellen,verkaufsstellen,liniennetz,tarifzonen,fahrradfrelo,fahrradandere,cargobikefrelo,cargobikeandere,grueneflotte,naturenergie,autoandere,e-roller,mitfahrpunkt,pois",
|
|
135
|
-
details: "Show shared mobility details in the sidebar when we click on an shared mobility feature.",
|
|
136
|
-
realtime: "Show/hide the realtime data in the map. Default to true.",
|
|
137
|
-
embed: "Activate/deactivate the embedded navigation mode. In this mode zooming with mouse wheel is deactivated and, on touch device, you can only navigate with two finger, a warning message is displayed to warn the user. Default to false.",
|
|
138
|
-
debug: "Displays debug information for vehicles when true, use only for debugging. Default to false.",
|
|
139
|
-
fullscreen: "Load the component in fullscreen mode. Default to false.",
|
|
140
|
-
runs: "Shows the number of trips on a line in the sidebar, use only for debugging. Default to false.",
|
|
141
|
-
notification: "Show/hide the notifications (coming from geOps MOCO API) layer on the map. Default to false.",
|
|
142
|
-
};
|
|
107
|
+
const descriptionByAttr = Object.entries(MobilityMapAttributes).reduce((acc, [key, attr]) => {
|
|
108
|
+
acc[key] = attr.description;
|
|
109
|
+
return acc;
|
|
110
|
+
}, {});
|
|
143
111
|
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
112
|
+
const defaultValueByAttr = Object.entries(MobilityMapAttributes).reduce((acc, [key, attr]) => {
|
|
113
|
+
acc[key] = attr.defaultValue;
|
|
114
|
+
return acc;
|
|
115
|
+
}, {});
|
|
116
|
+
|
|
117
|
+
/* Events */
|
|
118
|
+
const events = [
|
|
119
|
+
"mwc:selectedfeature",
|
|
120
|
+
// "mwc:stopssearchselect",
|
|
121
|
+
// "mwc:attribute",
|
|
122
|
+
// "mwc:singleclick",
|
|
123
|
+
// "mwc:permalink",
|
|
124
|
+
// "mwc:messageready",
|
|
125
|
+
];
|
|
126
|
+
const descriptionByEvent = {
|
|
127
|
+
"mwc:selectedfeature":
|
|
128
|
+
"Event fired when a feature is selected on the map. The event data contains the selected feature in GeoJSON format.",
|
|
129
|
+
"mwc:stopssearchselect":
|
|
130
|
+
"Only when search attribute is 'true'. Event fired when a stop is selected in the stops search results. The event data contains the selected stop.",
|
|
131
|
+
"mwc:attribute":
|
|
132
|
+
"Event fired when an web component's attribute is changed. The event data contains the list of all attributes and their values.",
|
|
133
|
+
"mwc:permalink":
|
|
134
|
+
"Event fired when the map's state changes. The event data contains the permalink URL search parameters as string.",
|
|
135
|
+
"mwc:messageready":
|
|
136
|
+
"Only if the web-component is embedded in an iframe. Message event fired when the web component is ready to receive messages from parent window. ",
|
|
137
|
+
"mwc:singleclick":
|
|
138
|
+
"Event fired when the map is clicked. The event data contains the map coordinates in EPSG:3857 and the pixel coordinates.",
|
|
139
|
+
};
|
|
140
|
+
|
|
141
|
+
document.querySelector("#attributes").innerHTML =
|
|
142
|
+
generateAttributesTable(
|
|
143
|
+
wc,
|
|
144
|
+
attrs,
|
|
145
|
+
booleanAttrs,
|
|
146
|
+
booleanTrueByDefault,
|
|
147
|
+
descriptionByAttr,
|
|
148
|
+
defaultValueByAttr,
|
|
149
|
+
reloadAttrs,
|
|
150
|
+
);
|
|
151
|
+
document.querySelector("#events").innerHTML = generateEventsTable(
|
|
152
|
+
wc,
|
|
153
|
+
events,
|
|
154
|
+
descriptionByEvent,
|
|
155
|
+
);
|
|
156
|
+
document.querySelector("#code").innerHTML = generateCodeText(
|
|
157
|
+
wc,
|
|
158
|
+
attrs,
|
|
159
|
+
pkgSrc,
|
|
160
|
+
);
|
|
161
|
+
wc.addEventListener("mwc:attribute", (event) => {
|
|
162
|
+
document.querySelector("#code").innerHTML = generateCodeText(
|
|
163
|
+
wc,
|
|
164
|
+
attrs,
|
|
165
|
+
pkgSrc,
|
|
166
|
+
);
|
|
167
|
+
});
|
|
168
|
+
applyPermalinkParameters(wc);
|
|
169
|
+
events.forEach((eventName) => {
|
|
170
|
+
wc.addEventListener(eventName, (event) => {
|
|
171
|
+
console.log(`${eventName} event`, event);
|
|
172
|
+
});
|
|
173
|
+
});
|
|
153
174
|
});
|
|
154
|
-
applyPermalinkParameters(wc);
|
|
155
175
|
</script>
|
|
156
176
|
</body>
|
|
157
177
|
</html>
|