@mapsindoors/map-template 1.93.2 → 1.94.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/dist/{GoogleMapsMap-982405ad.mjs → GoogleMapsMap-BqYRaFgc.mjs} +51 -62
- package/dist/MapboxMap-CUYrfLHY.mjs +34732 -0
- package/dist/_commonjsHelpers-ba3f0406.js +21 -0
- package/dist/combo-box-item.entry.js +15 -0
- package/dist/icon-b8d01d6f.js +24 -0
- package/dist/index-7e9696f3.js +1678 -0
- package/dist/index.js +1 -0
- package/dist/loader.js +18 -0
- package/dist/mapsindoors-react.es.js +3 -5
- package/dist/mapsindoors-react.umd.js +197 -582
- package/dist/mapsindoors-webcomponent.es.js +58512 -75790
- package/dist/mi-card_2.entry.js +28 -0
- package/dist/mi-chip.entry.js +22 -0
- package/dist/mi-column.entry.js +28 -0
- package/dist/mi-combo-box.entry.js +416 -0
- package/dist/mi-components.js +18 -0
- package/dist/mi-data-table.entry.js +302 -0
- package/dist/mi-distance_2.entry.js +67 -0
- package/dist/mi-dropdown-item.entry.js +15 -0
- package/dist/mi-dropdown.entry.js +610 -0
- package/dist/mi-floor-selector.entry.js +202 -0
- package/dist/mi-keyboard.entry.js +238 -0
- package/dist/mi-list-item-category.entry.js +48 -0
- package/dist/mi-list-item-location.entry.js +171 -0
- package/dist/mi-list.entry.js +56 -0
- package/dist/mi-location-booking.entry.js +5193 -0
- package/dist/mi-location-info.entry.js +63 -0
- package/dist/mi-map-googlemaps.entry.js +750 -0
- package/dist/mi-map-mapbox.entry.js +467 -0
- package/dist/mi-metric-card.entry.js +48 -0
- package/dist/mi-my-position.entry.js +986 -0
- package/dist/mi-notification.entry.js +127 -0
- package/dist/mi-route-instructions-heading.entry.js +73 -0
- package/dist/mi-route-instructions-maneuver-legacy.entry.js +82 -0
- package/dist/mi-route-instructions-maneuver.entry.js +82 -0
- package/dist/mi-route-instructions-step-legacy.entry.js +308 -0
- package/dist/mi-route-instructions-step.entry.js +321 -0
- package/dist/mi-route-instructions.entry.js +157 -0
- package/dist/mi-scroll-buttons.entry.js +112 -0
- package/dist/mi-search.entry.js +376 -0
- package/dist/mi-share-sms.entry.js +80 -0
- package/dist/mi-step-switcher.entry.js +31 -0
- package/dist/mi-tab-panel.entry.js +25 -0
- package/dist/mi-tab.entry.js +12 -0
- package/dist/mi-tabs.entry.js +47 -0
- package/dist/mi-time.entry.js +57 -0
- package/dist/mi-variables-9a6c8d4d.js +6 -0
- package/dist/polyfills/core-js.js +11 -0
- package/dist/polyfills/css-shim.js +1 -0
- package/dist/polyfills/dom.js +79 -0
- package/dist/polyfills/es5-html-element.js +1 -0
- package/dist/polyfills/index.js +34 -0
- package/dist/polyfills/system.js +6 -0
- package/dist/{reactcomponent-7fbbd9b2.mjs → reactcomponent-DTepe7hB.mjs} +14121 -14626
- package/dist/route-travel-mode.enum-7f4ce9c7.js +9 -0
- package/dist/sort-order.enum-64ce8998.js +552 -0
- package/dist/unit-system.enum-eaefb53e.js +7 -0
- package/dist/utils-ae714467.js +61 -0
- package/package.json +10 -6
- package/dist/MapboxMap-06ef82a3.mjs +0 -37815
- package/dist/_commonjsHelpers-ba3f0406-b96e6d6a.mjs +0 -22
- package/dist/combo-box-item.entry-d35f3d51.mjs +0 -15
- package/dist/icon-b8d01d6f-ddfa2c17.mjs +0 -25
- package/dist/mapsindoors-webcomponent.umd.js +0 -3245
- package/dist/mi-card_2.entry-fc772c35.mjs +0 -26
- package/dist/mi-chip.entry-81c742a1.mjs +0 -19
- package/dist/mi-column.entry-3a083282.mjs +0 -21
- package/dist/mi-combo-box.entry-cae6401a.mjs +0 -263
- package/dist/mi-data-table.entry-d4c3f445.mjs +0 -224
- package/dist/mi-distance_2.entry-a33ed69a.mjs +0 -339
- package/dist/mi-dropdown-item.entry-974d1e4f.mjs +0 -15
- package/dist/mi-dropdown.entry-5317db65.mjs +0 -349
- package/dist/mi-floor-selector.entry-185fbd8b.mjs +0 -115
- package/dist/mi-keyboard.entry-eaf4b9ef.mjs +0 -3103
- package/dist/mi-list-item-category.entry-9c95008c.mjs +0 -39
- package/dist/mi-list-item-location.entry-8b41e8f0.mjs +0 -137
- package/dist/mi-list.entry-1218d29d.mjs +0 -42
- package/dist/mi-location-booking.entry-270aaf5a.mjs +0 -4866
- package/dist/mi-location-info.entry-e4f7fd04.mjs +0 -32
- package/dist/mi-map-googlemaps.entry-81fa28d2.mjs +0 -467
- package/dist/mi-map-mapbox.entry-31821da3.mjs +0 -301
- package/dist/mi-metric-card.entry-40407f04.mjs +0 -29
- package/dist/mi-my-position.entry-bc48fe6e.mjs +0 -703
- package/dist/mi-notification.entry-9a2bc53b.mjs +0 -84
- package/dist/mi-route-instructions-heading.entry-e5b1ff04.mjs +0 -75
- package/dist/mi-route-instructions-maneuver-legacy.entry-2c3d73ab.mjs +0 -76
- package/dist/mi-route-instructions-maneuver.entry-c6f01024.mjs +0 -76
- package/dist/mi-route-instructions-step-legacy.entry-80bcf097.mjs +0 -202
- package/dist/mi-route-instructions-step.entry-db802e13.mjs +0 -231
- package/dist/mi-route-instructions.entry-62416e29.mjs +0 -143
- package/dist/mi-scroll-buttons.entry-92b62b21.mjs +0 -83
- package/dist/mi-search.entry-87f1e64a.mjs +0 -251
- package/dist/mi-share-sms.entry-b6725edb.mjs +0 -56
- package/dist/mi-step-switcher.entry-f8f6c040.mjs +0 -27
- package/dist/mi-tab-panel.entry-a89213c2.mjs +0 -22
- package/dist/mi-tab.entry-a2fb3f8c.mjs +0 -14
- package/dist/mi-tabs.entry-cd638ea7.mjs +0 -37
- package/dist/mi-time.entry-0b02870d.mjs +0 -46
- package/dist/mi-variables-9a6c8d4d-e06eec88.mjs +0 -8
- package/dist/route-travel-mode.enum-7f4ce9c7-a9c95a83.mjs +0 -8
- package/dist/sort-order.enum-64ce8998-b75ac596.mjs +0 -318
- package/dist/unit-system.enum-eaefb53e-0f424da4.mjs +0 -8
- package/dist/utils-ae714467-b07fc3be.mjs +0 -37
|
@@ -1,231 +0,0 @@
|
|
|
1
|
-
import { r as B, c as R, h as e } from "./reactcomponent-7fbbd9b2.mjs";
|
|
2
|
-
import { U as $ } from "./unit-system.enum-eaefb53e-0f424da4.mjs";
|
|
3
|
-
import { c as N } from "./utils-ae714467-b07fc3be.mjs";
|
|
4
|
-
import "react";
|
|
5
|
-
import "react-dom";
|
|
6
|
-
const H = ':host{display:block;font-family:Figtree, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Fira Sans", "Droid Sans", "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"}.step{display:grid;gap:16px;justify-items:center}.step__info{display:grid;grid-auto-flow:column;align-items:center;justify-content:space-between;width:100%;position:sticky;top:50px;background:white;z-index:1000;padding-bottom:8px}.step__destination{display:grid;gap:8px;align-items:center;justify-content:center;grid-auto-flow:column}.step__heading{font-weight:500;font-size:1.25rem;margin:0}.step__heading>span{font-size:0.875rem;color:#6b7280}.step__travel-mode{display:flex;justify-content:center;align-items:center;position:relative;min-height:72px}.step__travel-mode::before{position:absolute;width:calc(50% - 2px);left:0;height:100%;content:""}.step__travel-mode--dotted::before{border-right:4px dotted #bfdbfe}.step__travel-mode--solid::before{border-right:4px solid #bfdbfe}.step__travel-mode-icon{position:absolute;left:50%;top:24px;transform:translateX(-50%);background-color:#fcfcfc;padding:3px;border-radius:4px}.step__travel-mode-icon mi-icon{width:16px;height:16px;background-color:#6b7280;display:block}.step__short-name{margin-right:4px;padding:2px 4px;font-size:0.875rem;color:#fcfcfc;background-color:#6b7280;border-radius:2px}.step__distance-duration{color:#6b7280;font-size:0.875rem}.step__transit-action{font-weight:400;font-size:0.875rem;color:#6b7280}.step__toggle{display:grid;justify-content:center}.step__toggle mi-icon{width:24px;height:24px;display:block}.step__details{display:grid;gap:24px;width:100%}', O = class {
|
|
7
|
-
constructor(t) {
|
|
8
|
-
B(this, t), this.stepClicked = R(this, "stepClicked", 7), this.substepsToggled = R(this, "substepsToggled", 7), this.isInternetExplorer = N(), this.step = void 0, this.stepData = void 0, this.hideIndoorSubsteps = !0, this.fromRouteContext = "", this.fromTravelMode = void 0, this.fromTransitStop = void 0, this.unit = navigator.language === "en-US" ? $.Imperial : $.Metric, this.showToggleButton = !0, this.translations = void 0, this.translationsData = void 0, this.substepsAreOpen = !1;
|
|
9
|
-
}
|
|
10
|
-
parseStepProp() {
|
|
11
|
-
this.step && (this.stepData = JSON.parse(this.step));
|
|
12
|
-
}
|
|
13
|
-
parseTranslationsProp() {
|
|
14
|
-
this.translations && (this.translationsData = JSON.parse(this.translations));
|
|
15
|
-
}
|
|
16
|
-
/**
|
|
17
|
-
* Programmatically open the substeps.
|
|
18
|
-
*/
|
|
19
|
-
openSubsteps() {
|
|
20
|
-
this.substepsAreOpen = !0;
|
|
21
|
-
}
|
|
22
|
-
/**
|
|
23
|
-
* Programmatically close the substeps.
|
|
24
|
-
*/
|
|
25
|
-
closeSubsteps() {
|
|
26
|
-
this.substepsAreOpen = !1;
|
|
27
|
-
}
|
|
28
|
-
/**
|
|
29
|
-
* Component will load.
|
|
30
|
-
*/
|
|
31
|
-
componentWillLoad() {
|
|
32
|
-
this.parseStepProp(), this.parseTranslationsProp();
|
|
33
|
-
}
|
|
34
|
-
/**
|
|
35
|
-
* Render if there is step data.
|
|
36
|
-
*
|
|
37
|
-
* @returns {JSX.Element}
|
|
38
|
-
*/
|
|
39
|
-
render() {
|
|
40
|
-
return this.stepData && this.translationsData ? this.renderStep() : null;
|
|
41
|
-
}
|
|
42
|
-
/**
|
|
43
|
-
* Emits stepClicked event (if click target is not related to an action).
|
|
44
|
-
*
|
|
45
|
-
* @param event - Event.
|
|
46
|
-
*/
|
|
47
|
-
stepClickHandler(t) {
|
|
48
|
-
if (Array.from(t.target.classList).includes("icon-toggle"))
|
|
49
|
-
return;
|
|
50
|
-
let s = null;
|
|
51
|
-
t.target.dataset.maneuverIndex !== void 0 && (s = parseInt(t.target.dataset.maneuverIndex)), this.stepClicked.emit({ maneuverIndex: s });
|
|
52
|
-
}
|
|
53
|
-
/**
|
|
54
|
-
* Render step part depending on travel mode.
|
|
55
|
-
*
|
|
56
|
-
* @returns {JSX.Element}
|
|
57
|
-
*/
|
|
58
|
-
renderStep() {
|
|
59
|
-
switch (this.stepData.travel_mode.toUpperCase()) {
|
|
60
|
-
case "DRIVING":
|
|
61
|
-
return this.renderDrivingStep();
|
|
62
|
-
case "WALKING":
|
|
63
|
-
return this.renderWalkingStep();
|
|
64
|
-
case "BICYCLING":
|
|
65
|
-
return this.renderBicyclingStep();
|
|
66
|
-
case "TRANSIT":
|
|
67
|
-
return this.renderTransitStep();
|
|
68
|
-
default:
|
|
69
|
-
return e("div", null, "Unknown travel mode: ", this.stepData.travel_mode);
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
/**
|
|
73
|
-
* Render the travel mode indicator and dotted/solid line.
|
|
74
|
-
*
|
|
75
|
-
* @returns {JSX.Element}
|
|
76
|
-
*/
|
|
77
|
-
renderTravelMode() {
|
|
78
|
-
if (this.isInternetExplorer)
|
|
79
|
-
return null;
|
|
80
|
-
let t;
|
|
81
|
-
switch (this.stepData.travel_mode.toUpperCase()) {
|
|
82
|
-
case "DRIVING":
|
|
83
|
-
t = "car";
|
|
84
|
-
break;
|
|
85
|
-
case "WALKING":
|
|
86
|
-
t = "walk";
|
|
87
|
-
break;
|
|
88
|
-
case "BICYCLING":
|
|
89
|
-
t = "bike";
|
|
90
|
-
break;
|
|
91
|
-
case "TRANSIT":
|
|
92
|
-
t = this.getTransitVehicleIconName();
|
|
93
|
-
break;
|
|
94
|
-
}
|
|
95
|
-
return e("span", { part: "step-travel-mode", class: `step__travel-mode step__travel-mode--${this.stepData.travel_mode.toUpperCase() === "TRANSIT" ? "solid" : "dotted"}` }, e("span", { class: "step__travel-mode-icon" }, e("mi-icon", { part: "step-travel-mode-icon", "icon-name": t })));
|
|
96
|
-
}
|
|
97
|
-
/**
|
|
98
|
-
* Get icon name for transit vehicle.
|
|
99
|
-
*
|
|
100
|
-
* @returns {string}
|
|
101
|
-
*/
|
|
102
|
-
getTransitVehicleIconName() {
|
|
103
|
-
var t, s;
|
|
104
|
-
const i = (s = (t = this.stepData.transit_information) === null || t === void 0 ? void 0 : t.line.vehicle) === null || s === void 0 ? void 0 : s.type.toLowerCase();
|
|
105
|
-
return i && ["boat", "bus", "railway", "train", "subway"].some((a) => a === i) ? i : "transit";
|
|
106
|
-
}
|
|
107
|
-
/**
|
|
108
|
-
* Toggles visibility of sub steps (steps in steps).
|
|
109
|
-
*/
|
|
110
|
-
toggleSubsteps() {
|
|
111
|
-
this.substepsToggled.emit(), this.substepsAreOpen = !this.substepsAreOpen;
|
|
112
|
-
}
|
|
113
|
-
/**
|
|
114
|
-
* Render substeps if they should be visible.
|
|
115
|
-
*
|
|
116
|
-
* @returns {JSX.Element}
|
|
117
|
-
*/
|
|
118
|
-
renderSubsteps() {
|
|
119
|
-
var t;
|
|
120
|
-
return this.substepsAreOpen === !0 ? e("div", { class: "step__substeps" }, (t = this.stepData.steps) === null || t === void 0 ? void 0 : t.map((s, i) => e("mi-route-instructions-maneuver", {
|
|
121
|
-
"data-maneuver-index": i,
|
|
122
|
-
maneuver: JSON.stringify(s),
|
|
123
|
-
translations: this.translations,
|
|
124
|
-
unit: this.unit,
|
|
125
|
-
// @ts-ignore
|
|
126
|
-
exportparts: `
|
|
127
|
-
maneuver-icon,
|
|
128
|
-
maneuver-description,
|
|
129
|
-
maneuver-description-distance,
|
|
130
|
-
maneuver-description-distance-border`
|
|
131
|
-
}))) : null;
|
|
132
|
-
}
|
|
133
|
-
/**
|
|
134
|
-
* Render the toggle button for the sub step expander.
|
|
135
|
-
*
|
|
136
|
-
* @returns {JSX.Element}
|
|
137
|
-
*/
|
|
138
|
-
renderToggleButton() {
|
|
139
|
-
var t;
|
|
140
|
-
return ((t = this.stepData.steps) === null || t === void 0 ? void 0 : t.length) <= 0 || !this.showToggleButton ? null : e("span", { class: "step__toggle", onClick: () => this.toggleSubsteps() }, this.substepsAreOpen ? e("mi-icon", { part: "step-toggle", "icon-name": "chevron-up" }) : e("mi-icon", { part: "step-toggle", "icon-name": "chevron-down" }));
|
|
141
|
-
}
|
|
142
|
-
/**
|
|
143
|
-
* Render distance part.
|
|
144
|
-
*
|
|
145
|
-
* @returns {JSX.Element}
|
|
146
|
-
*/
|
|
147
|
-
renderDistance() {
|
|
148
|
-
return e("span", { part: "step-info", class: "step__distance-duration" }, e("mi-distance", { meters: this.stepData.distance.value, unit: this.unit }), e("br", null));
|
|
149
|
-
}
|
|
150
|
-
/**
|
|
151
|
-
* Render toggle and substeps.
|
|
152
|
-
*
|
|
153
|
-
* @returns {JSX.Element}
|
|
154
|
-
*/
|
|
155
|
-
showSubsteps() {
|
|
156
|
-
return e("div", { class: "step__details" }, this.renderSubsteps());
|
|
157
|
-
}
|
|
158
|
-
/**
|
|
159
|
-
* Render a driving step.
|
|
160
|
-
*
|
|
161
|
-
* @returns {JSX.Element}
|
|
162
|
-
*/
|
|
163
|
-
renderDrivingStep() {
|
|
164
|
-
return e("div", { class: "step", onClick: (t) => this.stepClickHandler(t) }, e("div", { class: "step__info" }, e("div", { part: "step-heading", class: "step__heading" }, this.getStepHeading()), this.renderToggleButton()), this.showSubsteps());
|
|
165
|
-
}
|
|
166
|
-
/**
|
|
167
|
-
* Get display heading.
|
|
168
|
-
*
|
|
169
|
-
* @returns {string}
|
|
170
|
-
*/
|
|
171
|
-
getStepHeading() {
|
|
172
|
-
var t;
|
|
173
|
-
const s = {
|
|
174
|
-
driving: this.translationsData.drive,
|
|
175
|
-
walking: this.translationsData.walk,
|
|
176
|
-
bicycling: this.translationsData.bike
|
|
177
|
-
};
|
|
178
|
-
return !((t = this.stepData.steps[0]) === null || t === void 0) && t.instructions ? this.stepData.steps[0].instructions : s[this.stepData.travel_mode.toLowerCase()];
|
|
179
|
-
}
|
|
180
|
-
/**
|
|
181
|
-
* Render a walking step.
|
|
182
|
-
*
|
|
183
|
-
*
|
|
184
|
-
* @returns {JSX.Element}
|
|
185
|
-
*/
|
|
186
|
-
renderWalkingStep() {
|
|
187
|
-
let t;
|
|
188
|
-
return this.stepData.parking === !0 ? t = `${this.translationsData.park} ${this.stepData.label ? ` ${this.translationsData.at} ` + this.stepData.label : ""}` : this.stepData.highway && this.stepData.highway.toUpperCase() === "STEPS" ? t = `${this.translationsData.takeStaircaseToLevel} ${this.stepData.end_location.floor_name}` : this.stepData.highway && this.stepData.highway.toUpperCase() === "LADDER" ? t = `${this.translationsData.takeLadderToLevel} ${this.stepData.end_location.floor_name}` : this.stepData.highway && this.stepData.highway.toUpperCase() === "ESCALATOR" ? t = `${this.translationsData.takeEscalatorToLevel} ${this.stepData.end_location.floor_name}` : this.stepData.highway && this.stepData.highway.toUpperCase() === "WHEELCHAIRRAMP" ? t = `${this.translationsData.takeWheelchairRampToLevel} ${this.stepData.end_location.floor_name}` : this.stepData.highway && this.stepData.highway.toUpperCase() === "WHEELCHAIRLIFT" ? t = `${this.translationsData.takeWheelchairLiftToLevel} ${this.stepData.end_location.floor_name}` : this.stepData.highway && this.stepData.highway.toUpperCase() === "ELEVATOR" ? t = `${this.translationsData.takeElevatorToLevel} ${this.stepData.end_location.floor_name}` : this.fromRouteContext === "InsideBuilding" && this.stepData.route_context === "Outside" ? t = this.addStepContextNameToHeading(this.translationsData.exit, this.stepData.start_context) : this.fromRouteContext === "InsideBuilding" && this.stepData.route_context === "InsideBuilding" ? t = this.getStepHeading() : this.fromRouteContext === "Outside" && this.stepData.route_context === "Outside" && this.fromTravelMode.toUpperCase() === "TRANSIT" ? t = this.fromTransitStop : this.fromRouteContext === "Outside" && this.stepData.route_context === "Outside" ? t = this.getStepHeading() : this.fromRouteContext === "Outside" && this.stepData.route_context === "InsideBuilding" ? t = this.addStepContextNameToHeading(this.translationsData.enter, this.stepData.end_context) : t = this.fromRouteContext === "InsideBuilding" ? "Inside Building" : this.fromRouteContext, e("div", { class: "step", onClick: (s) => this.stepClickHandler(s) }, e("div", { class: "step__info" }, e("div", { part: "step-heading", class: "step__heading" }, t), this.renderToggleButton()), this.showSubsteps());
|
|
189
|
-
}
|
|
190
|
-
/**
|
|
191
|
-
* Add building or venue name to the step heading.
|
|
192
|
-
*
|
|
193
|
-
* @param {string} heading
|
|
194
|
-
* @param {StepContext} stepContext
|
|
195
|
-
* @returns {string}
|
|
196
|
-
*/
|
|
197
|
-
addStepContextNameToHeading(t, s) {
|
|
198
|
-
return s && (s.building ? t += ` ${s.building.buildingInfo.name} ${this.translationsData.building}` : s.venue && (t += ` ${s.venue.venueInfo.name} ${this.translationsData.venue}`)), t;
|
|
199
|
-
}
|
|
200
|
-
/**
|
|
201
|
-
* Render a bicycling step.
|
|
202
|
-
*
|
|
203
|
-
* @returns {JSX.Element}
|
|
204
|
-
*/
|
|
205
|
-
renderBicyclingStep() {
|
|
206
|
-
return e("div", { class: "step", onClick: (t) => this.stepClickHandler(t) }, e("div", { class: "step__info" }, e("div", { part: "step-heading", class: "step__heading" }, this.getStepHeading()), this.renderToggleButton()), this.showSubsteps());
|
|
207
|
-
}
|
|
208
|
-
/**
|
|
209
|
-
* Render a transit step. Inclusing BUSWAY instruction.
|
|
210
|
-
*
|
|
211
|
-
* @returns {JSX.Element}
|
|
212
|
-
*/
|
|
213
|
-
renderTransitStep() {
|
|
214
|
-
var t, s, i, n, a, o, r, l, p, d, h, u, c, _, v, g, m, f, D, b, S, T, x, y, k, I, w, C, A;
|
|
215
|
-
return e("div", { class: "step", onClick: (L) => this.stepClickHandler(L) }, e("div", { class: "step__info" }, e("h3", { part: "step-heading", class: "step__heading" }, this.stepData.travel_mode === "TRANSIT" ? `${this.translationsData.rideTheBus}` : (t = this.stepData) === null || t === void 0 ? void 0 : t.instructions), this.renderToggleButton()), this.renderTravelMode(), e("div", { part: "step-description", class: "step__description" }, !((n = (i = (s = this.stepData) === null || s === void 0 ? void 0 : s.transit_information) === null || i === void 0 ? void 0 : i.line) === null || n === void 0) && n.short_name ? e("span", { class: "step__short-name", style: {
|
|
216
|
-
backgroundColor: !((r = (o = (a = this.stepData) === null || a === void 0 ? void 0 : a.transit_information) === null || o === void 0 ? void 0 : o.line) === null || r === void 0) && r.color ? (d = (p = (l = this.stepData) === null || l === void 0 ? void 0 : l.transit_information) === null || p === void 0 ? void 0 : p.line) === null || d === void 0 ? void 0 : d.color : null,
|
|
217
|
-
color: !((c = (u = (h = this.stepData) === null || h === void 0 ? void 0 : h.transit_information) === null || u === void 0 ? void 0 : u.line) === null || c === void 0) && c.text_color ? (g = (v = (_ = this.stepData) === null || _ === void 0 ? void 0 : _.transit_information) === null || v === void 0 ? void 0 : v.line) === null || g === void 0 ? void 0 : g.text_color : null
|
|
218
|
-
} }, (D = (f = (m = this.stepData) === null || m === void 0 ? void 0 : m.transit_information) === null || f === void 0 ? void 0 : f.line) === null || D === void 0 ? void 0 : D.short_name) : null, !((S = (b = this.stepData) === null || b === void 0 ? void 0 : b.transit_information) === null || S === void 0) && S.headsign ? (x = (T = this.stepData) === null || T === void 0 ? void 0 : T.transit_information) === null || x === void 0 ? void 0 : x.headsign : null, e("br", null), e("span", { part: "step-info", class: "step__distance-duration" }, e("mi-time", { seconds: (k = (y = this.stepData) === null || y === void 0 ? void 0 : y.duration) === null || k === void 0 ? void 0 : k.value, translations: `{"days":"${this.translationsData.days}","hours":"${this.translationsData.hours}","minutes":"${this.translationsData.minutes}"}` }), " · ", !((w = (I = this.stepData) === null || I === void 0 ? void 0 : I.transit_information) === null || w === void 0) && w.num_stops ? (A = (C = this.stepData) === null || C === void 0 ? void 0 : C.transit_information) === null || A === void 0 ? void 0 : A.num_stops : null, " ", this.translationsData.stops ? this.translationsData.stops : null)), this.showSubsteps());
|
|
219
|
-
}
|
|
220
|
-
static get watchers() {
|
|
221
|
-
return {
|
|
222
|
-
step: ["parseStepProp"],
|
|
223
|
-
translations: ["parseTranslationsProp"]
|
|
224
|
-
};
|
|
225
|
-
}
|
|
226
|
-
};
|
|
227
|
-
O.style = H;
|
|
228
|
-
export {
|
|
229
|
-
O as mi_route_instructions_step
|
|
230
|
-
};
|
|
231
|
-
//# sourceMappingURL=mi-route-instructions-step.entry-db802e13.mjs.map
|
|
@@ -1,143 +0,0 @@
|
|
|
1
|
-
import { r as u, c as g, h as s, H as m } from "./reactcomponent-7fbbd9b2.mjs";
|
|
2
|
-
import { R as v } from "./route-travel-mode.enum-7f4ce9c7-a9c95a83.mjs";
|
|
3
|
-
import { U as f } from "./unit-system.enum-eaefb53e-0f424da4.mjs";
|
|
4
|
-
import { c as S } from "./utils-ae714467-b07fc3be.mjs";
|
|
5
|
-
import "react";
|
|
6
|
-
import "react-dom";
|
|
7
|
-
const x = ':host{display:block;background-color:#fcfcfc;font-family:Figtree, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Fira Sans", "Droid Sans", "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"}:host mi-route-instructions-step:hover{cursor:pointer;background-color:#f9fafb;transition:300ms ease}:host mi-route-instructions-step.active{background-color:#f3f4f6;transition:none;cursor:default}:host .instructions-destination{display:flex}:host .instructions-destination-icon{width:40px;display:flex;justify-content:center;align-items:center}:host .instructions-destination-icon mi-icon{width:24px;height:24px;background-color:#1c1917}:host .instructions-destination-details{flex:1;padding:12px}:host .instructions-destination-details mi-location-info{font-size:0.875rem}', I = class {
|
|
8
|
-
constructor(t) {
|
|
9
|
-
u(this, t), this.clicked = g(this, "clicked", 7), this.miStepElements = [], this.lastStepRouteContext = null, this.lastStepTravelMode = null, this.lastStepTransitStop = null, this.activeStep = {
|
|
10
|
-
legIndex: 0,
|
|
11
|
-
stepIndex: 0
|
|
12
|
-
}, this.unit = f.Metric, this.route = void 0, this.hideIndoorSubsteps = !1, this.travelMode = v.Walking, this.originLocation = void 0, this.originName = void 0, this.destinationLocation = void 0, this.destinationName = void 0, this.translations = {
|
|
13
|
-
walk: "Walk",
|
|
14
|
-
bike: "Bike",
|
|
15
|
-
transit: "Transit",
|
|
16
|
-
drive: "Drive",
|
|
17
|
-
leave: "Leave",
|
|
18
|
-
from: "From",
|
|
19
|
-
park: "Park",
|
|
20
|
-
at: "at",
|
|
21
|
-
building: "Building",
|
|
22
|
-
venue: "Venue",
|
|
23
|
-
takeStaircaseToLevel: "Take staircase to level",
|
|
24
|
-
takeLadderToLevel: "Take the ladder to level",
|
|
25
|
-
takeElevatorToLevel: "Take elevator to level",
|
|
26
|
-
takeEscalatorToLevel: "Take escalator to level",
|
|
27
|
-
takeWheelchairLiftToLevel: "Take wheelchair lift to level",
|
|
28
|
-
takeWheelchairRampToLevel: "Take wheelchair ramp to level",
|
|
29
|
-
exit: "Exit",
|
|
30
|
-
enter: "Enter",
|
|
31
|
-
stops: "stops",
|
|
32
|
-
andContinue: "and continue",
|
|
33
|
-
continueStraightAhead: "Continue straight ahead",
|
|
34
|
-
goLeft: "Go left",
|
|
35
|
-
goSharpLeft: "Go sharp left",
|
|
36
|
-
goSlightLeft: "Go slight left",
|
|
37
|
-
goRight: "Go right",
|
|
38
|
-
goSharpRight: "Go sharp right",
|
|
39
|
-
goSlightRight: "Go slight right",
|
|
40
|
-
turnAround: "Turn around",
|
|
41
|
-
days: "d",
|
|
42
|
-
hours: "h",
|
|
43
|
-
minutes: "min",
|
|
44
|
-
rideTheBus: "Ride the bus"
|
|
45
|
-
};
|
|
46
|
-
}
|
|
47
|
-
componentDidRender() {
|
|
48
|
-
this.miStepElements.forEach((t) => {
|
|
49
|
-
t.hideIndoorSubsteps = this.hideIndoorSubsteps;
|
|
50
|
-
});
|
|
51
|
-
}
|
|
52
|
-
/**
|
|
53
|
-
* Transform the step in legs to a flat array of steps.
|
|
54
|
-
*
|
|
55
|
-
* @returns {Step[]}
|
|
56
|
-
*/
|
|
57
|
-
getRouteSteps() {
|
|
58
|
-
return this.route ? this.route.legs.reduce((t, i, e) => {
|
|
59
|
-
for (const o in i.steps) {
|
|
60
|
-
const n = i.steps[o];
|
|
61
|
-
n.originalLegIndex = e, n.originalStepIndex = parseInt(o), t.push(n);
|
|
62
|
-
}
|
|
63
|
-
return t;
|
|
64
|
-
}, []) : [];
|
|
65
|
-
}
|
|
66
|
-
/**
|
|
67
|
-
* Updates the activeStep attribute and emits an object with leg, step and maneuver index information.
|
|
68
|
-
*
|
|
69
|
-
* @param {CustomEvent<any>} event Step object.
|
|
70
|
-
* @param {number} stepIndex step index.
|
|
71
|
-
*/
|
|
72
|
-
stepClickedHandler(t, i) {
|
|
73
|
-
const e = this.getRouteSteps()[i];
|
|
74
|
-
this.activeStep = {
|
|
75
|
-
legIndex: e.originalLegIndex,
|
|
76
|
-
stepIndex: e.originalStepIndex
|
|
77
|
-
}, this.clicked.emit({
|
|
78
|
-
legIndex: e.originalLegIndex,
|
|
79
|
-
stepIndex: e.originalStepIndex,
|
|
80
|
-
maneuverIndex: t.detail.maneuverIndex
|
|
81
|
-
});
|
|
82
|
-
}
|
|
83
|
-
/**
|
|
84
|
-
* Check if the step is active.
|
|
85
|
-
*
|
|
86
|
-
* @param {Step} step
|
|
87
|
-
* @returns {boolean}
|
|
88
|
-
*/
|
|
89
|
-
isActiveStep(t) {
|
|
90
|
-
return this.activeStep ? this.activeStep.legIndex === t.originalLegIndex && this.activeStep.stepIndex === t.originalStepIndex : !1;
|
|
91
|
-
}
|
|
92
|
-
render() {
|
|
93
|
-
return this.route ? this.renderInstructions() : null;
|
|
94
|
-
}
|
|
95
|
-
/**
|
|
96
|
-
* Render instructions.
|
|
97
|
-
*
|
|
98
|
-
* @returns {JSX.Element}
|
|
99
|
-
*/
|
|
100
|
-
renderInstructions() {
|
|
101
|
-
return s(m, null, this.getRouteSteps().map((t, i) => {
|
|
102
|
-
var e, o, n, a, r;
|
|
103
|
-
const d = !((o = (e = this.originLocation) === null || e === void 0 ? void 0 : e.properties) === null || o === void 0) && o.name ? this.originLocation.properties.name : this.originName || "", c = t.originalLegIndex === 0 && t.originalStepIndex === 0 ? d : this.lastStepRouteContext, p = this.lastStepTravelMode, h = this.lastStepTransitStop;
|
|
104
|
-
return this.lastStepRouteContext = t.route_context, this.lastStepTravelMode = t.travel_mode, this.lastStepTransitStop = !((a = (n = t.transit_information) === null || n === void 0 ? void 0 : n.arrival_stop) === null || a === void 0) && a.name ? (r = t.transit_information) === null || r === void 0 ? void 0 : r.arrival_stop.name : null, s("mi-route-instructions-step-legacy", {
|
|
105
|
-
ref: (l) => this.miStepElements.push(l),
|
|
106
|
-
"from-travel-mode": p,
|
|
107
|
-
"from-route-context": c,
|
|
108
|
-
"from-transit-stop": h,
|
|
109
|
-
step: JSON.stringify(t),
|
|
110
|
-
translations: JSON.stringify(this.translations),
|
|
111
|
-
unit: this.unit,
|
|
112
|
-
onStepClicked: (l) => this.stepClickedHandler(l, i),
|
|
113
|
-
class: this.isActiveStep(t) ? "active" : "",
|
|
114
|
-
part: this.isActiveStep(t) ? "step active" : "step",
|
|
115
|
-
// @ts-ignore
|
|
116
|
-
exportparts: `
|
|
117
|
-
step-toggle,
|
|
118
|
-
step-heading,
|
|
119
|
-
step-description,
|
|
120
|
-
step-info,
|
|
121
|
-
step-travel-mode,
|
|
122
|
-
step-travel-mode-icon,
|
|
123
|
-
maneuver-icon,
|
|
124
|
-
maneuver-description,
|
|
125
|
-
maneuver-description-distance,
|
|
126
|
-
maneuver-description-distance-border`
|
|
127
|
-
});
|
|
128
|
-
}), this.destinationLocation || this.destinationName ? this.renderDestination() : null);
|
|
129
|
-
}
|
|
130
|
-
/**
|
|
131
|
-
* Render destination.
|
|
132
|
-
*
|
|
133
|
-
* @returns {JSX.Element}
|
|
134
|
-
*/
|
|
135
|
-
renderDestination() {
|
|
136
|
-
return s("div", { class: "instructions-destination" }, s("div", { class: "instructions-destination-icon" }, S() ? null : s("mi-icon", { "icon-name": "marker" })), s("div", { part: "instructions-destination", class: "instructions-destination-details" }, this.destinationLocation ? this.destinationLocation.properties.name : this.destinationName, this.destinationLocation ? s("mi-location-info", { part: "instructions-destination-info", location: this.destinationLocation }) : null));
|
|
137
|
-
}
|
|
138
|
-
};
|
|
139
|
-
I.style = x;
|
|
140
|
-
export {
|
|
141
|
-
I as mi_route_instructions
|
|
142
|
-
};
|
|
143
|
-
//# sourceMappingURL=mi-route-instructions.entry-62416e29.mjs.map
|
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
import { r as n, h as e } from "./reactcomponent-7fbbd9b2.mjs";
|
|
2
|
-
import "react";
|
|
3
|
-
import "react-dom";
|
|
4
|
-
const i = 'a.mi-button{cursor:default}.mi-button{border-radius:4px;border-width:1px;border-style:solid;font-family:Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Fira Sans", "Droid Sans", "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";font-size:1rem;font-weight:500;padding-left:16px;padding-right:16px;padding-top:12px;padding-bottom:12px;display:inline-flex;align-items:center}.mi-button:disabled{opacity:0.48;cursor:not-allowed}.mi-button object{filter:invert(9%) sepia(13%) saturate(692%) hue-rotate(185deg) brightness(98%) contrast(91%);width:16px;height:16px}.mi-button--small{padding-left:12px;padding-right:12px;padding-top:8px;padding-bottom:8px;font-size:0.875rem;height:32px}.mi-button--small object{width:16px;height:16px}.mi-button--large{padding-left:16px;padding-right:16px;font-size:1.25rem}.mi-button--large object{width:20px;height:20px}.mi-button--full-width{width:100%;justify-content:center}.mi-button--icon-left{padding-left:12px}.mi-button--icon-left object{margin-right:8px}.mi-button--icon-right{padding-right:12px}.mi-button--icon-right object{margin-left:8px}.mi-button--icon-both{padding-top:12px;padding-bottom:12px}.mi-button--icon-both object:first-of-type{margin-right:8px}.mi-button--icon-both object:last-of-type{margin-left:8px}.mi-button--base{background:linear-gradient(#f5f7fa, #ebeff5);color:#1e2025;border-color:#c8d0e0}.mi-button--base:not(:disabled):hover{background:linear-gradient(#ebeff5, #dee3ed);border-color:#aeb9cb}.mi-button--base:not(:disabled):active{background:linear-gradient(#dee3ed, #ebeff5)}.mi-button--primary{color:#ffffff;border-color:#20693e;background:linear-gradient(#3ba064, #2a844e)}.mi-button--primary object{filter:invert(100%) sepia(93%) saturate(0%) hue-rotate(201deg) brightness(106%) contrast(106%)}.mi-button--primary:not(:disabled):hover{background:linear-gradient(#2a844e, #20693e)}.mi-button--primary:not(:disabled):active{background:linear-gradient(#20693e, #2a844e)}.mi-button--delete{background:linear-gradient(#f55151, #de1b1b);color:#ffffff;border-color:#ba0d0d}.mi-button--delete object{filter:invert(100%) sepia(93%) saturate(0%) hue-rotate(201deg) brightness(106%) contrast(106%)}.mi-button--delete:not(:disabled):hover{background:linear-gradient(#de1b1b, #ba0d0d)}.mi-button--delete:not(:disabled):active{background:linear-gradient(#ba0d0d, #de1b1b)}.mi-button--outline{color:#3071d9;border-color:#3071d9;background-color:transparent}.mi-button--outline object{filter:invert(38%) sepia(97%) saturate(742%) hue-rotate(188deg) brightness(86%) contrast(97%)}.mi-button--outline:not(:disabled):hover{color:#1d5bbf;border-color:#1d5bbf;background-color:#eef4fc}.mi-button--outline:not(:disabled):active{color:#1d5bbf;border-color:#1d5bbf;background-color:#cfe0fc}.mi-button--link{color:#3071d9;border-style:none;background-color:transparent;cursor:pointer}.mi-button--link object{filter:invert(38%) sepia(97%) saturate(742%) hue-rotate(188deg) brightness(86%) contrast(97%)}.mi-button--link:not(:disabled):hover{color:#1d5bbf;border-color:#1d5bbf;background-color:#eef4fc}.mi-button--link:disabled:hover{cursor:not-allowed}.mi-button--link:not(:disabled):active{color:#1d5bbf;border-color:#1d5bbf;background-color:#cfe0fc}html{box-sizing:border-box}*,*:before,*:after{box-sizing:inherit}.scroll-buttons{height:100%;width:64px;display:flex;flex-direction:column;align-items:center;justify-content:center;row-gap:16px}.scroll-buttons .btn{margin:0;padding:0;background:none;width:64px;height:64px;background-color:#ffffff;border:none;border-radius:8px;display:flex;align-items:center;justify-content:center}.scroll-buttons .btn mi-icon{width:32px}.scroll-buttons .btn:hover{background:none;background-color:#ffffff;cursor:pointer}.scroll-buttons .btn:disabled{opacity:1}.scroll-buttons .btn:disabled mi-icon{background-color:#a5a9af}', r = class {
|
|
5
|
-
constructor(t) {
|
|
6
|
-
n(this, t), this.scrollContainerElementRef = void 0, this.scrollLength = 100;
|
|
7
|
-
}
|
|
8
|
-
/**
|
|
9
|
-
* Update scroll buttons enabled/disabled states.
|
|
10
|
-
*/
|
|
11
|
-
async updateScrollButtons() {
|
|
12
|
-
this.updateScrollButtonsState();
|
|
13
|
-
}
|
|
14
|
-
/**
|
|
15
|
-
* Watch for container scroll events.
|
|
16
|
-
*/
|
|
17
|
-
addScrollEventListener() {
|
|
18
|
-
var t, o;
|
|
19
|
-
(t = this.resizeObserver) === null || t === void 0 || t.disconnect(), (o = this.scrollContainerElementRef) === null || o === void 0 || o.addEventListener("scroll", () => {
|
|
20
|
-
this.updateScrollButtonsState();
|
|
21
|
-
}), this.scrollContainerElementRef && (this.resizeObserver = new ResizeObserver(() => {
|
|
22
|
-
this.updateScrollButtonsState();
|
|
23
|
-
}), this.resizeObserver.observe(this.scrollContainerElementRef));
|
|
24
|
-
}
|
|
25
|
-
/**
|
|
26
|
-
* Adds scroll event listener to the container element when this component is first attached to the DOM.
|
|
27
|
-
*/
|
|
28
|
-
connectedCallback() {
|
|
29
|
-
this.addScrollEventListener();
|
|
30
|
-
}
|
|
31
|
-
/**
|
|
32
|
-
* Disconnects ResizeObserver.
|
|
33
|
-
*/
|
|
34
|
-
disconnectedCallback() {
|
|
35
|
-
var t;
|
|
36
|
-
(t = this.resizeObserver) === null || t === void 0 || t.disconnect();
|
|
37
|
-
}
|
|
38
|
-
/**
|
|
39
|
-
* Updates enable/disable state for scroll up and down buttons.
|
|
40
|
-
*
|
|
41
|
-
* @returns {Promise<void>}
|
|
42
|
-
*/
|
|
43
|
-
async updateScrollButtonsState() {
|
|
44
|
-
this.scrollContainerElementRef.scrollTop === 0 ? this.upButtonElement.disabled = !0 : this.upButtonElement.disabled && (this.upButtonElement.disabled = !1), this.scrollContainerElementRef.scrollHeight - this.scrollContainerElementRef.scrollTop === this.scrollContainerElementRef.clientHeight && this.upButtonElement.disabled === !0 ? this.downButtonElement.disabled = !0 : this.scrollContainerElementRef.scrollHeight - this.scrollContainerElementRef.scrollTop > this.scrollContainerElementRef.clientHeight ? this.downButtonElement.disabled = !1 : this.downButtonElement.disabled = !0;
|
|
45
|
-
}
|
|
46
|
-
/**
|
|
47
|
-
* Update scroll position.
|
|
48
|
-
*
|
|
49
|
-
* @param {number} value - Value to scroll.
|
|
50
|
-
*/
|
|
51
|
-
updateScrollPosition(t) {
|
|
52
|
-
"scrollBehavior" in document.documentElement.style ? this.scrollContainerElementRef.scroll({
|
|
53
|
-
top: this.scrollContainerElementRef.scrollTop + t,
|
|
54
|
-
behavior: "smooth"
|
|
55
|
-
}) : this.scrollContainerElementRef.scrollTop = t;
|
|
56
|
-
}
|
|
57
|
-
/**
|
|
58
|
-
* Render scroll buttons.
|
|
59
|
-
*
|
|
60
|
-
* @returns {JSX.Element}
|
|
61
|
-
*/
|
|
62
|
-
render() {
|
|
63
|
-
return e("div", { part: "container", class: "scroll-buttons" }, e("button", { part: "button button-up", class: "mi-button mi-button--base btn btn-up", type: "button", disabled: !0, "aria-label": "Scroll Up", ref: (t) => {
|
|
64
|
-
this.upButtonElement = t;
|
|
65
|
-
}, onClick: (t) => {
|
|
66
|
-
t.stopPropagation(), this.updateScrollPosition(-this.scrollLength);
|
|
67
|
-
} }, e("mi-icon", { "icon-name": "chevron-up" })), e("button", { part: "button button-down", class: "mi-button mi-button--base btn btn-down", type: "button", "aria-label": "Scroll Down", ref: (t) => {
|
|
68
|
-
this.downButtonElement = t;
|
|
69
|
-
}, onClick: (t) => {
|
|
70
|
-
t.stopPropagation(), this.updateScrollPosition(this.scrollLength);
|
|
71
|
-
} }, e("mi-icon", { "icon-name": "chevron-down" })));
|
|
72
|
-
}
|
|
73
|
-
static get watchers() {
|
|
74
|
-
return {
|
|
75
|
-
scrollContainerElementRef: ["addScrollEventListener"]
|
|
76
|
-
};
|
|
77
|
-
}
|
|
78
|
-
};
|
|
79
|
-
r.style = i;
|
|
80
|
-
export {
|
|
81
|
-
r as mi_scroll_buttons
|
|
82
|
-
};
|
|
83
|
-
//# sourceMappingURL=mi-scroll-buttons.entry-92b62b21.mjs.map
|