@mapsindoors/map-template 1.0.0-rc.2 → 1.1.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.
Files changed (141) hide show
  1. package/README.md +3 -2
  2. package/package.json +7 -3
  3. package/dist/_commonjsHelpers-ba3f0406-b96e6d6a.mjs +0 -21
  4. package/dist/combo-box-item.entry-59124312.mjs +0 -14
  5. package/dist/combo-box-item.entry-8762d714.mjs +0 -12
  6. package/dist/combo-box-item.entry-92232c29.mjs +0 -12
  7. package/dist/combo-box-item.entry-f244c01a.mjs +0 -14
  8. package/dist/icon-b8d01d6f-ddfa2c17.mjs +0 -24
  9. package/dist/mapsindoors-react.es.js +0 -7
  10. package/dist/mapsindoors-react.umd.js +0 -1391
  11. package/dist/mapsindoors-webcomponent.es.js +0 -5
  12. package/dist/mapsindoors-webcomponent.umd.js +0 -1385
  13. package/dist/mi-card_2.entry-3de1663c.mjs +0 -25
  14. package/dist/mi-card_2.entry-508f65b2.mjs +0 -23
  15. package/dist/mi-card_2.entry-7dabf461.mjs +0 -23
  16. package/dist/mi-card_2.entry-d24478d0.mjs +0 -25
  17. package/dist/mi-chip.entry-74b3118c.mjs +0 -15
  18. package/dist/mi-chip.entry-8bfee95c.mjs +0 -13
  19. package/dist/mi-chip.entry-bcc6599b.mjs +0 -15
  20. package/dist/mi-chip.entry-d43333c8.mjs +0 -13
  21. package/dist/mi-column.entry-6a55a95f.mjs +0 -20
  22. package/dist/mi-column.entry-9b46d3b8.mjs +0 -18
  23. package/dist/mi-column.entry-f66623b9.mjs +0 -20
  24. package/dist/mi-column.entry-f901d5d1.mjs +0 -18
  25. package/dist/mi-combo-box.entry-0e6d9797.mjs +0 -262
  26. package/dist/mi-combo-box.entry-144ed7be.mjs +0 -260
  27. package/dist/mi-combo-box.entry-5cd60eff.mjs +0 -262
  28. package/dist/mi-combo-box.entry-69a04955.mjs +0 -260
  29. package/dist/mi-data-table.entry-0ace7eb1.mjs +0 -213
  30. package/dist/mi-data-table.entry-6cae08b0.mjs +0 -215
  31. package/dist/mi-data-table.entry-7fe09cbe.mjs +0 -213
  32. package/dist/mi-data-table.entry-ff1bd14d.mjs +0 -215
  33. package/dist/mi-distance_2.entry-02d887f0.mjs +0 -56
  34. package/dist/mi-distance_2.entry-33e65994.mjs +0 -54
  35. package/dist/mi-distance_2.entry-dca308c3.mjs +0 -54
  36. package/dist/mi-distance_2.entry-dffb2e64.mjs +0 -56
  37. package/dist/mi-dropdown-item.entry-508c6605.mjs +0 -12
  38. package/dist/mi-dropdown-item.entry-aeae3cf1.mjs +0 -14
  39. package/dist/mi-dropdown-item.entry-b6aa9d36.mjs +0 -14
  40. package/dist/mi-dropdown-item.entry-be1c1055.mjs +0 -12
  41. package/dist/mi-dropdown.entry-1f1fce9f.mjs +0 -298
  42. package/dist/mi-dropdown.entry-43258637.mjs +0 -296
  43. package/dist/mi-dropdown.entry-e00c3e14.mjs +0 -296
  44. package/dist/mi-dropdown.entry-e1325610.mjs +0 -298
  45. package/dist/mi-keyboard.entry-60e47fb9.mjs +0 -2962
  46. package/dist/mi-keyboard.entry-c97c80e8.mjs +0 -2960
  47. package/dist/mi-keyboard.entry-e320a1e8.mjs +0 -2960
  48. package/dist/mi-keyboard.entry-f1813a27.mjs +0 -2962
  49. package/dist/mi-list-item-category.entry-6aa84b17.mjs +0 -38
  50. package/dist/mi-list-item-category.entry-b0f61751.mjs +0 -38
  51. package/dist/mi-list-item-category.entry-b5f547b8.mjs +0 -36
  52. package/dist/mi-list-item-category.entry-bcac342a.mjs +0 -36
  53. package/dist/mi-list-item-location.entry-15ec9c7e.mjs +0 -125
  54. package/dist/mi-list-item-location.entry-72f8d5db.mjs +0 -127
  55. package/dist/mi-list-item-location.entry-b642f1fb.mjs +0 -125
  56. package/dist/mi-list-item-location.entry-ee56967a.mjs +0 -127
  57. package/dist/mi-list.entry-656130ea.mjs +0 -41
  58. package/dist/mi-list.entry-6eddb682.mjs +0 -39
  59. package/dist/mi-list.entry-c8f1f377.mjs +0 -39
  60. package/dist/mi-list.entry-e8089911.mjs +0 -41
  61. package/dist/mi-location-booking.entry-36f5d6a4.mjs +0 -4865
  62. package/dist/mi-location-booking.entry-4424927f.mjs +0 -4863
  63. package/dist/mi-location-booking.entry-a5b9b331.mjs +0 -4863
  64. package/dist/mi-location-booking.entry-ea841d6e.mjs +0 -4865
  65. package/dist/mi-location-info.entry-2f1c328d.mjs +0 -24
  66. package/dist/mi-location-info.entry-78f0dbde.mjs +0 -22
  67. package/dist/mi-location-info.entry-89b37774.mjs +0 -22
  68. package/dist/mi-location-info.entry-fe2c6c32.mjs +0 -24
  69. package/dist/mi-map-googlemaps.entry-6cb264de.mjs +0 -398
  70. package/dist/mi-map-googlemaps.entry-73b0ae03.mjs +0 -396
  71. package/dist/mi-map-googlemaps.entry-85c05897.mjs +0 -398
  72. package/dist/mi-map-googlemaps.entry-8877f16d.mjs +0 -396
  73. package/dist/mi-map-mapbox.entry-7a41963d.mjs +0 -298
  74. package/dist/mi-map-mapbox.entry-928da21a.mjs +0 -300
  75. package/dist/mi-map-mapbox.entry-9fc28c96.mjs +0 -298
  76. package/dist/mi-map-mapbox.entry-a53b3e68.mjs +0 -300
  77. package/dist/mi-metric-card.entry-1215b29e.mjs +0 -26
  78. package/dist/mi-metric-card.entry-3d06eaea.mjs +0 -28
  79. package/dist/mi-metric-card.entry-51daca25.mjs +0 -28
  80. package/dist/mi-metric-card.entry-95dbb9f1.mjs +0 -26
  81. package/dist/mi-notification.entry-20418bdd.mjs +0 -83
  82. package/dist/mi-notification.entry-29b28ba8.mjs +0 -81
  83. package/dist/mi-notification.entry-9e49e3de.mjs +0 -81
  84. package/dist/mi-notification.entry-f7677761.mjs +0 -83
  85. package/dist/mi-route-instructions-heading.entry-60a49210.mjs +0 -72
  86. package/dist/mi-route-instructions-heading.entry-79c22cdd.mjs +0 -72
  87. package/dist/mi-route-instructions-heading.entry-874593f4.mjs +0 -74
  88. package/dist/mi-route-instructions-heading.entry-a4c7f18f.mjs +0 -74
  89. package/dist/mi-route-instructions-maneuver_2.entry-2950c143.mjs +0 -113
  90. package/dist/mi-route-instructions-maneuver_2.entry-383704ad.mjs +0 -115
  91. package/dist/mi-route-instructions-maneuver_2.entry-80c51e6a.mjs +0 -113
  92. package/dist/mi-route-instructions-maneuver_2.entry-b62eb513.mjs +0 -115
  93. package/dist/mi-route-instructions-step-legacy.entry-4058ea77.mjs +0 -201
  94. package/dist/mi-route-instructions-step-legacy.entry-785cb60b.mjs +0 -199
  95. package/dist/mi-route-instructions-step-legacy.entry-eff068ed.mjs +0 -201
  96. package/dist/mi-route-instructions-step-legacy.entry-f6ca174d.mjs +0 -199
  97. package/dist/mi-route-instructions-step.entry-057d5c48.mjs +0 -201
  98. package/dist/mi-route-instructions-step.entry-272e3c84.mjs +0 -199
  99. package/dist/mi-route-instructions-step.entry-8ecfdbd0.mjs +0 -199
  100. package/dist/mi-route-instructions-step.entry-95f5dc43.mjs +0 -201
  101. package/dist/mi-route-instructions.entry-0628d220.mjs +0 -139
  102. package/dist/mi-route-instructions.entry-1b4fb352.mjs +0 -141
  103. package/dist/mi-route-instructions.entry-2ded8acb.mjs +0 -141
  104. package/dist/mi-route-instructions.entry-4adef014.mjs +0 -139
  105. package/dist/mi-scroll-buttons.entry-274b003f.mjs +0 -48
  106. package/dist/mi-scroll-buttons.entry-55fa9459.mjs +0 -46
  107. package/dist/mi-scroll-buttons.entry-5ebd3f9b.mjs +0 -48
  108. package/dist/mi-scroll-buttons.entry-6132935b.mjs +0 -46
  109. package/dist/mi-search.entry-140efd52.mjs +0 -206
  110. package/dist/mi-search.entry-994c0189.mjs +0 -206
  111. package/dist/mi-search.entry-b04e74ff.mjs +0 -208
  112. package/dist/mi-search.entry-d0e582d1.mjs +0 -208
  113. package/dist/mi-share-sms.entry-26650f3b.mjs +0 -53
  114. package/dist/mi-share-sms.entry-ae15cf77.mjs +0 -53
  115. package/dist/mi-share-sms.entry-ced7f275.mjs +0 -55
  116. package/dist/mi-share-sms.entry-d082547b.mjs +0 -55
  117. package/dist/mi-step-switcher.entry-1863a369.mjs +0 -26
  118. package/dist/mi-step-switcher.entry-812a5096.mjs +0 -24
  119. package/dist/mi-step-switcher.entry-c9e28e79.mjs +0 -26
  120. package/dist/mi-step-switcher.entry-ecfc6a44.mjs +0 -24
  121. package/dist/mi-tab-panel.entry-089486fd.mjs +0 -21
  122. package/dist/mi-tab-panel.entry-63c34f28.mjs +0 -19
  123. package/dist/mi-tab-panel.entry-bde9bd39.mjs +0 -21
  124. package/dist/mi-tab-panel.entry-cbe08c18.mjs +0 -19
  125. package/dist/mi-tab.entry-1767468e.mjs +0 -13
  126. package/dist/mi-tab.entry-81e86bc6.mjs +0 -11
  127. package/dist/mi-tab.entry-b5ac50ac.mjs +0 -11
  128. package/dist/mi-tab.entry-ec6a52fb.mjs +0 -13
  129. package/dist/mi-tabs.entry-1209c5bb.mjs +0 -36
  130. package/dist/mi-tabs.entry-1b8327bf.mjs +0 -34
  131. package/dist/mi-tabs.entry-bd190e21.mjs +0 -36
  132. package/dist/mi-tabs.entry-c6b55639.mjs +0 -34
  133. package/dist/mi-variables-9a6c8d4d-e06eec88.mjs +0 -7
  134. package/dist/reactcomponent-2f9f051f.mjs +0 -27190
  135. package/dist/reactcomponent-aa96e777.mjs +0 -27210
  136. package/dist/route-travel-mode.enum-7f4ce9c7-a9c95a83.mjs +0 -7
  137. package/dist/sort-order.enum-64ce8998-b75ac596.mjs +0 -317
  138. package/dist/unit-system.enum-eaefb53e-0f424da4.mjs +0 -7
  139. package/dist/utils-ae714467-b07fc3be.mjs +0 -36
  140. package/dist/webcomponent-a10be1e6.mjs +0 -31969
  141. package/dist/webcomponent-ac588828.mjs +0 -31989
@@ -1,199 +0,0 @@
1
- import { r as n, c as r, h as e } from "./webcomponent-ac588828.mjs";
2
- import { U as o } from "./unit-system.enum-eaefb53e-0f424da4.mjs";
3
- import { c as l } from "./utils-ae714467-b07fc3be.mjs";
4
- const p = ':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;grid-template-columns:40px 1fr 40px;grid-template-areas:"actionicon heading heading" "modeicon description toggle" "modeicon substeps substeps"}.step__action-icon{-ms-grid-row:1;-ms-grid-column:1;display:flex;justify-content:center;align-items:center;grid-area:actionicon}.step__action-icon--circled{position:relative}.step__action-icon--circled::before{position:absolute;width:24px;height:24px;border:1px solid #1c1917;content:"";border-radius:50%}.step__action-icon mi-icon{display:block;width:12px;height:12px}.step__heading{-ms-grid-row:1;-ms-grid-column:2;-ms-grid-column-span:2;grid-area:heading;font-size:1rem;margin:0;border-bottom:1px solid #DCDCDF;border-top:1px solid #DCDCDF;padding:12px}.step__heading>span{font-size:0.875rem;color:#6b7280}.step__travel-mode{-ms-grid-row:2;-ms-grid-row-span:2;-ms-grid-column:1;grid-area:modeicon;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__description{-ms-grid-row:2;-ms-grid-column:2;grid-area:description;padding:12px}.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__toggle{-ms-grid-row:2;-ms-grid-column:3;grid-area:toggle;display:flex;justify-content:center;align-items:center;transition:transform 300ms;cursor:pointer}.step__toggle--open{transform:rotate(180deg)}.step__toggle mi-icon{width:16px;height:16px;display:block;background-color:#3b82f6}.step__substeps{-ms-grid-row:3;-ms-grid-column:2;-ms-grid-column-span:2;grid-area:substeps}', d = class {
5
- constructor(t) {
6
- n(this, t), this.stepClicked = r(this, "stepClicked", 7), this.isInternetExplorer = l(), this.step = void 0, this.stepData = void 0, this.hideIndoorSubsteps = !0, this.fromRouteContext = "", this.fromTravelMode = void 0, this.fromTransitStop = void 0, this.unit = o.Metric, this.translations = void 0, this.translationsData = void 0, this.substepsAreOpen = !1;
7
- }
8
- parseStepProp() {
9
- this.step && (this.stepData = JSON.parse(this.step));
10
- }
11
- parseTranslationsProp() {
12
- this.translations && (this.translationsData = JSON.parse(this.translations));
13
- }
14
- componentWillLoad() {
15
- this.parseStepProp(), this.parseTranslationsProp();
16
- }
17
- /**
18
- * Render if there is step data.
19
- */
20
- render() {
21
- return this.stepData && this.translationsData ? this.renderStep() : null;
22
- }
23
- /**
24
- * Emits stepClicked event (if click target is not related to an action)
25
- * @param event Event
26
- */
27
- stepClickHandler(t) {
28
- if (Array.from(t.target.classList).includes("icon-toggle"))
29
- return;
30
- let s = null;
31
- t.target.dataset.maneuverIndex !== void 0 && (s = parseInt(t.target.dataset.maneuverIndex)), this.stepClicked.emit({ maneuverIndex: s });
32
- }
33
- /**
34
- * Render step part depending on travel mode.
35
- *
36
- * @returns {JSX.Element}
37
- */
38
- renderStep() {
39
- switch (this.stepData.travel_mode.toUpperCase()) {
40
- case "DRIVING":
41
- return this.renderDrivingStep();
42
- case "WALKING":
43
- return this.renderWalkingStep();
44
- case "BICYCLING":
45
- return this.renderBicyclingStep();
46
- case "TRANSIT":
47
- return this.renderTransitStep();
48
- default:
49
- return e("div", null, "Unknown travel mode: ", this.stepData.travel_mode);
50
- }
51
- }
52
- /**
53
- * Render the travel mode indicator and dotted/solid line.
54
- *
55
- * @returns {JSX.Element}
56
- */
57
- renderTravelMode() {
58
- if (this.isInternetExplorer)
59
- return null;
60
- let t;
61
- switch (this.stepData.travel_mode.toUpperCase()) {
62
- case "DRIVING":
63
- t = "car";
64
- break;
65
- case "WALKING":
66
- t = "walk";
67
- break;
68
- case "BICYCLING":
69
- t = "bike";
70
- break;
71
- case "TRANSIT":
72
- t = this.getTransitVehicleIconName();
73
- break;
74
- }
75
- 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 })));
76
- }
77
- /**
78
- * Get icon name for transit vehicle.
79
- *
80
- * @returns {string}
81
- */
82
- getTransitVehicleIconName() {
83
- var t, s;
84
- 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();
85
- return i && ["boat", "bus", "railway", "train", "subway"].some((a) => a === i) ? i : "transit";
86
- }
87
- /**
88
- * Toggles visibility of sub steps (steps in steps)
89
- */
90
- toggleSubsteps() {
91
- this.substepsAreOpen = !this.substepsAreOpen;
92
- }
93
- /**
94
- * Render substeps if they should be visible.
95
- *
96
- * @returns {JSX.Element}
97
- */
98
- renderSubsteps() {
99
- return this.substepsAreOpen === !0 ? e("div", { class: "step__substeps" }, this.stepData.steps.map((t, s) => e("mi-route-instructions-maneuver", {
100
- "data-maneuver-index": s,
101
- maneuver: JSON.stringify(t),
102
- translations: this.translations,
103
- unit: this.unit,
104
- // @ts-ignore
105
- exportparts: `
106
- maneuver-icon,
107
- maneuver-description,
108
- maneuver-description-distance,
109
- maneuver-description-distance-border`
110
- }))) : null;
111
- }
112
- /**
113
- * Render the toggle button for the sub step expander.
114
- *
115
- * @returns {JSX.Element}
116
- */
117
- renderToggleButton() {
118
- return this.stepData.steps.length <= 0 || this.hideIndoorSubsteps === !0 && this.stepData.route_context.toLowerCase() === "insidebuilding" ? null : e("span", { class: `step__toggle ${this.substepsAreOpen ? "step__toggle--open" : ""}`, onClick: () => this.toggleSubsteps() }, this.isInternetExplorer ? "▼" : e("mi-icon", { part: "step-toggle", "icon-name": "toggle" }));
119
- }
120
- /**
121
- * Render time and distance part.
122
- *
123
- * @returns {JSX.Element}
124
- */
125
- renderTimeAndDistance() {
126
- return e("span", { part: "step-info", class: "step__distance-duration" }, e("mi-time", { seconds: this.stepData.duration.value, translations: `{"days":"${this.translationsData.days}","hours":"${this.translationsData.hours}","minutes":"${this.translationsData.minutes}"}` }), " · ", e("mi-distance", { meters: this.stepData.distance.value, unit: this.unit }), e("br", null));
127
- }
128
- /**
129
- * Render a driving step.
130
- *
131
- * @returns {JSX.Element}
132
- */
133
- renderDrivingStep() {
134
- return e("div", { class: "step", onClick: (t) => this.stepClickHandler(t) }, this.isInternetExplorer ? null : e("span", { class: "step__action-icon step__action-icon--circled" }, e("mi-icon", { "icon-name": "car" })), e("h3", { part: "step-heading", class: "step__heading" }, this.getStepHeading()), this.renderTravelMode(), e("div", { part: "step-description", class: "step__description" }, this.translationsData.drive, e("br", null), this.renderTimeAndDistance()), this.renderToggleButton(), this.renderSubsteps());
135
- }
136
- /**
137
- * Get display heading.
138
- *
139
- * @returns {string}
140
- */
141
- getStepHeading() {
142
- var t;
143
- const s = {
144
- driving: this.translationsData.drive,
145
- walking: this.translationsData.walk,
146
- bicycling: this.translationsData.bike
147
- };
148
- return !((t = this.stepData.steps[0]) === null || t === void 0) && t.instructions ? this.stepData.steps[0].instructions : s[this.stepData.travel_mode.toLowerCase()];
149
- }
150
- /**
151
- * Render a walking step.
152
- *
153
- *
154
- * @returns {JSX.Element}
155
- */
156
- renderWalkingStep() {
157
- let t, s;
158
- return this.stepData.parking === !0 ? (t = `${this.translationsData.park} ${this.stepData.label ? ` ${this.translationsData.at} ` + this.stepData.label : ""}`, s = "park") : this.stepData.highway && this.stepData.highway.toUpperCase() === "STEPS" ? (t = `${this.translationsData.takeStaircaseToLevel} ${this.stepData.end_location.floor_name}`, s = "stairs") : this.stepData.highway && this.stepData.highway.toUpperCase() === "LADDER" ? (t = `${this.translationsData.takeLadderToLevel} ${this.stepData.end_location.floor_name}`, s = "ladder") : this.stepData.highway && this.stepData.highway.toUpperCase() === "ESCALATOR" ? (t = `${this.translationsData.takeEscalatorToLevel} ${this.stepData.end_location.floor_name}`, s = "escalator") : this.stepData.highway && this.stepData.highway.toUpperCase() === "WHEELCHAIRRAMP" ? (t = `${this.translationsData.takeWheelchairRampToLevel} ${this.stepData.end_location.floor_name}`, s = "wheelchair-ramp") : this.stepData.highway && this.stepData.highway.toUpperCase() === "WHEELCHAIRLIFT" ? (t = `${this.translationsData.takeWheelchairLiftToLevel} ${this.stepData.end_location.floor_name}`, s = "wheelchair-lift") : this.stepData.highway && this.stepData.highway.toUpperCase() === "ELEVATOR" ? (t = `${this.translationsData.takeElevatorToLevel} ${this.stepData.end_location.floor_name}`, s = "elevator") : this.fromRouteContext === "InsideBuilding" && this.stepData.route_context === "Outside" ? (t = this.addStepContextNameToHeading(this.translationsData.exit, this.stepData.start_context), s = "exit") : this.fromRouteContext === "InsideBuilding" && this.stepData.route_context === "InsideBuilding" ? (t = this.getStepHeading(), s = "walk") : this.fromRouteContext === "Outside" && this.stepData.route_context === "Outside" && this.fromTravelMode.toUpperCase() === "TRANSIT" ? (t = this.fromTransitStop, s = "transit-stop") : this.fromRouteContext === "Outside" && this.stepData.route_context === "Outside" ? (t = this.getStepHeading(), s = "walk") : this.fromRouteContext === "Outside" && this.stepData.route_context === "InsideBuilding" ? (t = this.addStepContextNameToHeading(this.translationsData.enter, this.stepData.end_context), s = "enter") : (t = this.fromRouteContext, s = "circle"), e("div", { class: "step", onClick: (i) => this.stepClickHandler(i) }, this.isInternetExplorer ? null : e("span", { class: `step__action-icon ${s !== "circle" ? "step__action-icon--circled" : ""}` }, e("mi-icon", { "icon-name": s })), e("h3", { part: "step-heading", class: "step__heading" }, t), this.renderTravelMode(), e("div", { part: "step-description", class: "step__description" }, this.translationsData.walk, e("br", null), this.renderTimeAndDistance()), this.renderToggleButton(), this.renderSubsteps());
159
- }
160
- /**
161
- * Add building or venue name to the step heading
162
- * @param {string} heading
163
- * @param {StepContext} stepContext
164
- * @returns
165
- */
166
- addStepContextNameToHeading(t, s) {
167
- return s && (s.building ? t += ` ${s.building.buildingInfo.name} ${this.translationsData.building}` : s.venue && (t += ` ${s.venue.venueInfo.name} ${this.translationsData.venue}`)), t;
168
- }
169
- /**
170
- * Render a bicycling step.
171
- *
172
- * @returns {JSX.Element}
173
- */
174
- renderBicyclingStep() {
175
- return e("div", { class: "step", onClick: (t) => this.stepClickHandler(t) }, this.isInternetExplorer ? null : e("span", { class: "step__action-icon step__action-icon--circled" }, e("mi-icon", { "icon-name": "bike" })), e("h3", { part: "step-heading", class: "step__heading" }, this.getStepHeading()), this.renderTravelMode(), e("div", { part: "step-description", class: "step__description" }, this.translationsData.bike, e("br", null), this.renderTimeAndDistance()), this.renderToggleButton(), this.renderSubsteps());
176
- }
177
- /**
178
- * Render a transit step.
179
- *
180
- * @returns {JSX.Element}
181
- */
182
- renderTransitStep() {
183
- var t, s;
184
- return e("div", { class: "step", onClick: (i) => this.stepClickHandler(i) }, this.isInternetExplorer ? null : e("span", { class: "step__action-icon step__action-icon--circled" }, e("mi-icon", { "icon-name": "transit-stop" })), e("h3", { part: "step-heading", class: "step__heading" }, this.stepData.instructions), this.renderTravelMode(), e("div", { part: "step-description", class: "step__description" }, this.stepData.transit_information.line.short_name ? e("span", { class: "step__short-name", style: {
185
- backgroundColor: !((t = this.stepData.transit_information.line) === null || t === void 0) && t.color ? this.stepData.transit_information.line.color : null,
186
- color: !((s = this.stepData.transit_information.line) === null || s === void 0) && s.text_color ? this.stepData.transit_information.line.text_color : null
187
- } }, this.stepData.transit_information.line.short_name) : null, this.stepData.transit_information.headsign ? this.stepData.transit_information.headsign : null, e("br", null), e("span", { part: "step-info", class: "step__distance-duration" }, e("mi-time", { seconds: this.stepData.duration.value, translations: `{"days":"${this.translationsData.days}","hours":"${this.translationsData.hours}","minutes":"${this.translationsData.minutes}"}` }), " · ", this.stepData.transit_information.num_stops ? this.stepData.transit_information.num_stops : null, " ", this.translationsData.stops ? this.translationsData.stops : null)), this.renderToggleButton(), this.renderSubsteps());
188
- }
189
- static get watchers() {
190
- return {
191
- step: ["parseStepProp"],
192
- translations: ["parseTranslationsProp"]
193
- };
194
- }
195
- };
196
- d.style = p;
197
- export {
198
- d as mi_route_instructions_step_legacy
199
- };
@@ -1,201 +0,0 @@
1
- import { r, c as o, h as e } from "./reactcomponent-aa96e777.mjs";
2
- import { U as a } from "./unit-system.enum-eaefb53e-0f424da4.mjs";
3
- import { c as l } from "./utils-ae714467-b07fc3be.mjs";
4
- import "react";
5
- import "react-dom";
6
- const p = ':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:8px;justify-items:center}.step__info{display:grid;grid-auto-flow:column;gap:8px;align-items:center}.step__action-icon--circled{position:relative}.step__action-icon mi-icon{display:block;width:40px;height:40px}.step__heading{font-size:1.25rem;margin:0}.step__heading>span{font-size:0.875rem;color:#6b7280}.step__travel-mode{grid-area:modeicon;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__toggle{grid-area:toggle;display:flex;justify-content:center;align-items:center;transition:transform 300ms;cursor:pointer}.step__toggle--open{transform:rotate(180deg)}.step__toggle mi-icon{width:16px;height:16px;display:block;background-color:#3b82f6}.step__substeps{grid-area:substeps}', d = class {
7
- constructor(t) {
8
- r(this, t), this.stepClicked = o(this, "stepClicked", 7), this.isInternetExplorer = l(), 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" ? a.Imperial : a.Metric, 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
- componentWillLoad() {
17
- this.parseStepProp(), this.parseTranslationsProp();
18
- }
19
- /**
20
- * Render if there is step data.
21
- */
22
- render() {
23
- return this.stepData && this.translationsData ? this.renderStep() : null;
24
- }
25
- /**
26
- * Emits stepClicked event (if click target is not related to an action)
27
- * @param event Event
28
- */
29
- stepClickHandler(t) {
30
- if (Array.from(t.target.classList).includes("icon-toggle"))
31
- return;
32
- let s = null;
33
- t.target.dataset.maneuverIndex !== void 0 && (s = parseInt(t.target.dataset.maneuverIndex)), this.stepClicked.emit({ maneuverIndex: s });
34
- }
35
- /**
36
- * Render step part depending on travel mode.
37
- *
38
- * @returns {JSX.Element}
39
- */
40
- renderStep() {
41
- switch (this.stepData.travel_mode.toUpperCase()) {
42
- case "DRIVING":
43
- return this.renderDrivingStep();
44
- case "WALKING":
45
- return this.renderWalkingStep();
46
- case "BICYCLING":
47
- return this.renderBicyclingStep();
48
- case "TRANSIT":
49
- return this.renderTransitStep();
50
- default:
51
- return e("div", null, "Unknown travel mode: ", this.stepData.travel_mode);
52
- }
53
- }
54
- /**
55
- * Render the travel mode indicator and dotted/solid line.
56
- *
57
- * @returns {JSX.Element}
58
- */
59
- renderTravelMode() {
60
- if (this.isInternetExplorer)
61
- return null;
62
- let t;
63
- switch (this.stepData.travel_mode.toUpperCase()) {
64
- case "DRIVING":
65
- t = "car";
66
- break;
67
- case "WALKING":
68
- t = "walk";
69
- break;
70
- case "BICYCLING":
71
- t = "bike";
72
- break;
73
- case "TRANSIT":
74
- t = this.getTransitVehicleIconName();
75
- break;
76
- }
77
- 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 })));
78
- }
79
- /**
80
- * Get icon name for transit vehicle.
81
- *
82
- * @returns {string}
83
- */
84
- getTransitVehicleIconName() {
85
- var t, s;
86
- 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();
87
- return i && ["boat", "bus", "railway", "train", "subway"].some((n) => n === i) ? i : "transit";
88
- }
89
- /**
90
- * Toggles visibility of sub steps (steps in steps)
91
- */
92
- toggleSubsteps() {
93
- this.substepsAreOpen = !this.substepsAreOpen;
94
- }
95
- /**
96
- * Render substeps if they should be visible.
97
- *
98
- * @returns {JSX.Element}
99
- */
100
- renderSubsteps() {
101
- return this.substepsAreOpen === !0 ? e("div", { class: "step__substeps" }, this.stepData.steps.map((t, s) => e("mi-route-instructions-maneuver", {
102
- "data-maneuver-index": s,
103
- maneuver: JSON.stringify(t),
104
- translations: this.translations,
105
- unit: this.unit,
106
- // @ts-ignore
107
- exportparts: `
108
- maneuver-icon,
109
- maneuver-description,
110
- maneuver-description-distance,
111
- maneuver-description-distance-border`
112
- }))) : null;
113
- }
114
- /**
115
- * Render the toggle button for the sub step expander.
116
- *
117
- * @returns {JSX.Element}
118
- */
119
- renderToggleButton() {
120
- return this.stepData.steps.length <= 0 || this.hideIndoorSubsteps === !0 && this.stepData.route_context.toLowerCase() === "insidebuilding" ? null : e("span", { class: `step__toggle ${this.substepsAreOpen ? "step__toggle--open" : ""}`, onClick: () => this.toggleSubsteps() }, this.isInternetExplorer ? "▼" : e("mi-icon", { part: "step-toggle", "icon-name": "toggle" }));
121
- }
122
- /**
123
- * Render distance part.
124
- *
125
- * @returns {JSX.Element}
126
- */
127
- renderDistance() {
128
- return e("span", { part: "step-info", class: "step__distance-duration" }, e("mi-distance", { meters: this.stepData.distance.value, unit: this.unit }), e("br", null));
129
- }
130
- /**
131
- * Render a driving step.
132
- *
133
- * @returns {JSX.Element}
134
- */
135
- renderDrivingStep() {
136
- return e("div", { class: "step", onClick: (t) => this.stepClickHandler(t) }, this.isInternetExplorer ? null : e("span", { class: "step__action-icon step__action-icon--circled" }, e("mi-icon", { "icon-name": "car" })), e("h3", { part: "step-heading", class: "step__heading" }, this.getStepHeading()), this.renderTravelMode(), e("div", { part: "step-description", class: "step__description" }, this.translationsData.drive, e("br", null), this.renderDistance()), this.renderToggleButton(), this.renderSubsteps());
137
- }
138
- /**
139
- * Get display heading.
140
- *
141
- * @returns {string}
142
- */
143
- getStepHeading() {
144
- var t;
145
- const s = {
146
- driving: this.translationsData.drive,
147
- walking: this.translationsData.walk,
148
- bicycling: this.translationsData.bike
149
- };
150
- return !((t = this.stepData.steps[0]) === null || t === void 0) && t.instructions ? this.stepData.steps[0].instructions : s[this.stepData.travel_mode.toLowerCase()];
151
- }
152
- /**
153
- * Render a walking step.
154
- *
155
- *
156
- * @returns {JSX.Element}
157
- */
158
- renderWalkingStep() {
159
- let t, s;
160
- return this.stepData.parking === !0 ? (t = `${this.translationsData.park} ${this.stepData.label ? ` ${this.translationsData.at} ` + this.stepData.label : ""}`, s = "park") : this.stepData.highway && this.stepData.highway.toUpperCase() === "STEPS" ? (t = `${this.translationsData.takeStaircaseToLevel} ${this.stepData.end_location.floor_name}`, s = "stairs") : this.stepData.highway && this.stepData.highway.toUpperCase() === "LADDER" ? (t = `${this.translationsData.takeLadderToLevel} ${this.stepData.end_location.floor_name}`, s = "ladder") : this.stepData.highway && this.stepData.highway.toUpperCase() === "ESCALATOR" ? (t = `${this.translationsData.takeEscalatorToLevel} ${this.stepData.end_location.floor_name}`, s = "escalator") : this.stepData.highway && this.stepData.highway.toUpperCase() === "WHEELCHAIRRAMP" ? (t = `${this.translationsData.takeWheelchairRampToLevel} ${this.stepData.end_location.floor_name}`, s = "wheelchair-ramp") : this.stepData.highway && this.stepData.highway.toUpperCase() === "WHEELCHAIRLIFT" ? (t = `${this.translationsData.takeWheelchairLiftToLevel} ${this.stepData.end_location.floor_name}`, s = "wheelchair-lift") : this.stepData.highway && this.stepData.highway.toUpperCase() === "ELEVATOR" ? (t = `${this.translationsData.takeElevatorToLevel} ${this.stepData.end_location.floor_name}`, s = "elevator") : this.fromRouteContext === "InsideBuilding" && this.stepData.route_context === "Outside" ? (t = this.addStepContextNameToHeading(this.translationsData.exit, this.stepData.start_context), s = "exit") : this.fromRouteContext === "InsideBuilding" && this.stepData.route_context === "InsideBuilding" ? (t = this.getStepHeading(), s = "walk") : this.fromRouteContext === "Outside" && this.stepData.route_context === "Outside" && this.fromTravelMode.toUpperCase() === "TRANSIT" ? (t = this.fromTransitStop, s = "transit-stop") : this.fromRouteContext === "Outside" && this.stepData.route_context === "Outside" ? (t = this.getStepHeading(), s = "walk") : this.fromRouteContext === "Outside" && this.stepData.route_context === "InsideBuilding" ? (t = this.addStepContextNameToHeading(this.translationsData.enter, this.stepData.end_context), s = "enter") : (t = this.fromRouteContext, s = "circle"), e("div", { class: "step", onClick: (i) => this.stepClickHandler(i) }, e("div", { part: "step-description", class: "step__description" }, this.renderDistance()), e("div", { class: "step__info" }, this.isInternetExplorer ? null : e("span", { class: `step__action-icon ${s !== "circle" ? "step__action-icon--circled" : ""}` }, e("mi-icon", { "icon-name": s })), e("div", { part: "step-heading", class: "step__heading" }, t)));
161
- }
162
- /**
163
- * Add building or venue name to the step heading
164
- * @param {string} heading
165
- * @param {StepContext} stepContext
166
- * @returns
167
- */
168
- addStepContextNameToHeading(t, s) {
169
- return s && (s.building ? t += ` ${s.building.buildingInfo.name} ${this.translationsData.building}` : s.venue && (t += ` ${s.venue.venueInfo.name} ${this.translationsData.venue}`)), t;
170
- }
171
- /**
172
- * Render a bicycling step.
173
- *
174
- * @returns {JSX.Element}
175
- */
176
- renderBicyclingStep() {
177
- return e("div", { class: "step", onClick: (t) => this.stepClickHandler(t) }, this.isInternetExplorer ? null : e("span", { class: "step__action-icon step__action-icon--circled" }, e("mi-icon", { "icon-name": "bike" })), e("h3", { part: "step-heading", class: "step__heading" }, this.getStepHeading()), this.renderTravelMode(), e("div", { part: "step-description", class: "step__description" }, this.translationsData.bike, e("br", null), this.renderDistance()), this.renderToggleButton(), this.renderSubsteps());
178
- }
179
- /**
180
- * Render a transit step.
181
- *
182
- * @returns {JSX.Element}
183
- */
184
- renderTransitStep() {
185
- var t, s;
186
- return e("div", { class: "step", onClick: (i) => this.stepClickHandler(i) }, this.isInternetExplorer ? null : e("span", { class: "step__action-icon step__action-icon--circled" }, e("mi-icon", { "icon-name": "transit-stop" })), e("h3", { part: "step-heading", class: "step__heading" }, this.stepData.instructions), this.renderTravelMode(), e("div", { part: "step-description", class: "step__description" }, this.stepData.transit_information.line.short_name ? e("span", { class: "step__short-name", style: {
187
- backgroundColor: !((t = this.stepData.transit_information.line) === null || t === void 0) && t.color ? this.stepData.transit_information.line.color : null,
188
- color: !((s = this.stepData.transit_information.line) === null || s === void 0) && s.text_color ? this.stepData.transit_information.line.text_color : null
189
- } }, this.stepData.transit_information.line.short_name) : null, this.stepData.transit_information.headsign ? this.stepData.transit_information.headsign : null, e("br", null), e("span", { part: "step-info", class: "step__distance-duration" }, e("mi-time", { seconds: this.stepData.duration.value, translations: `{"days":"${this.translationsData.days}","hours":"${this.translationsData.hours}","minutes":"${this.translationsData.minutes}"}` }), " · ", this.stepData.transit_information.num_stops ? this.stepData.transit_information.num_stops : null, " ", this.translationsData.stops ? this.translationsData.stops : null)), this.renderToggleButton(), this.renderSubsteps());
190
- }
191
- static get watchers() {
192
- return {
193
- step: ["parseStepProp"],
194
- translations: ["parseTranslationsProp"]
195
- };
196
- }
197
- };
198
- d.style = p;
199
- export {
200
- d as mi_route_instructions_step
201
- };
@@ -1,199 +0,0 @@
1
- import { r, c as o, h as e } from "./webcomponent-a10be1e6.mjs";
2
- import { U as a } from "./unit-system.enum-eaefb53e-0f424da4.mjs";
3
- import { c as l } from "./utils-ae714467-b07fc3be.mjs";
4
- const p = ':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:8px;justify-items:center}.step__info{display:grid;grid-auto-flow:column;gap:8px;align-items:center}.step__action-icon--circled{position:relative}.step__action-icon mi-icon{display:block;width:40px;height:40px}.step__heading{font-size:1.25rem;margin:0}.step__heading>span{font-size:0.875rem;color:#6b7280}.step__travel-mode{grid-area:modeicon;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__toggle{grid-area:toggle;display:flex;justify-content:center;align-items:center;transition:transform 300ms;cursor:pointer}.step__toggle--open{transform:rotate(180deg)}.step__toggle mi-icon{width:16px;height:16px;display:block;background-color:#3b82f6}.step__substeps{grid-area:substeps}', d = class {
5
- constructor(t) {
6
- r(this, t), this.stepClicked = o(this, "stepClicked", 7), this.isInternetExplorer = l(), 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" ? a.Imperial : a.Metric, this.translations = void 0, this.translationsData = void 0, this.substepsAreOpen = !1;
7
- }
8
- parseStepProp() {
9
- this.step && (this.stepData = JSON.parse(this.step));
10
- }
11
- parseTranslationsProp() {
12
- this.translations && (this.translationsData = JSON.parse(this.translations));
13
- }
14
- componentWillLoad() {
15
- this.parseStepProp(), this.parseTranslationsProp();
16
- }
17
- /**
18
- * Render if there is step data.
19
- */
20
- render() {
21
- return this.stepData && this.translationsData ? this.renderStep() : null;
22
- }
23
- /**
24
- * Emits stepClicked event (if click target is not related to an action)
25
- * @param event Event
26
- */
27
- stepClickHandler(t) {
28
- if (Array.from(t.target.classList).includes("icon-toggle"))
29
- return;
30
- let s = null;
31
- t.target.dataset.maneuverIndex !== void 0 && (s = parseInt(t.target.dataset.maneuverIndex)), this.stepClicked.emit({ maneuverIndex: s });
32
- }
33
- /**
34
- * Render step part depending on travel mode.
35
- *
36
- * @returns {JSX.Element}
37
- */
38
- renderStep() {
39
- switch (this.stepData.travel_mode.toUpperCase()) {
40
- case "DRIVING":
41
- return this.renderDrivingStep();
42
- case "WALKING":
43
- return this.renderWalkingStep();
44
- case "BICYCLING":
45
- return this.renderBicyclingStep();
46
- case "TRANSIT":
47
- return this.renderTransitStep();
48
- default:
49
- return e("div", null, "Unknown travel mode: ", this.stepData.travel_mode);
50
- }
51
- }
52
- /**
53
- * Render the travel mode indicator and dotted/solid line.
54
- *
55
- * @returns {JSX.Element}
56
- */
57
- renderTravelMode() {
58
- if (this.isInternetExplorer)
59
- return null;
60
- let t;
61
- switch (this.stepData.travel_mode.toUpperCase()) {
62
- case "DRIVING":
63
- t = "car";
64
- break;
65
- case "WALKING":
66
- t = "walk";
67
- break;
68
- case "BICYCLING":
69
- t = "bike";
70
- break;
71
- case "TRANSIT":
72
- t = this.getTransitVehicleIconName();
73
- break;
74
- }
75
- 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 })));
76
- }
77
- /**
78
- * Get icon name for transit vehicle.
79
- *
80
- * @returns {string}
81
- */
82
- getTransitVehicleIconName() {
83
- var t, s;
84
- 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();
85
- return i && ["boat", "bus", "railway", "train", "subway"].some((n) => n === i) ? i : "transit";
86
- }
87
- /**
88
- * Toggles visibility of sub steps (steps in steps)
89
- */
90
- toggleSubsteps() {
91
- this.substepsAreOpen = !this.substepsAreOpen;
92
- }
93
- /**
94
- * Render substeps if they should be visible.
95
- *
96
- * @returns {JSX.Element}
97
- */
98
- renderSubsteps() {
99
- return this.substepsAreOpen === !0 ? e("div", { class: "step__substeps" }, this.stepData.steps.map((t, s) => e("mi-route-instructions-maneuver", {
100
- "data-maneuver-index": s,
101
- maneuver: JSON.stringify(t),
102
- translations: this.translations,
103
- unit: this.unit,
104
- // @ts-ignore
105
- exportparts: `
106
- maneuver-icon,
107
- maneuver-description,
108
- maneuver-description-distance,
109
- maneuver-description-distance-border`
110
- }))) : null;
111
- }
112
- /**
113
- * Render the toggle button for the sub step expander.
114
- *
115
- * @returns {JSX.Element}
116
- */
117
- renderToggleButton() {
118
- return this.stepData.steps.length <= 0 || this.hideIndoorSubsteps === !0 && this.stepData.route_context.toLowerCase() === "insidebuilding" ? null : e("span", { class: `step__toggle ${this.substepsAreOpen ? "step__toggle--open" : ""}`, onClick: () => this.toggleSubsteps() }, this.isInternetExplorer ? "▼" : e("mi-icon", { part: "step-toggle", "icon-name": "toggle" }));
119
- }
120
- /**
121
- * Render distance part.
122
- *
123
- * @returns {JSX.Element}
124
- */
125
- renderDistance() {
126
- return e("span", { part: "step-info", class: "step__distance-duration" }, e("mi-distance", { meters: this.stepData.distance.value, unit: this.unit }), e("br", null));
127
- }
128
- /**
129
- * Render a driving step.
130
- *
131
- * @returns {JSX.Element}
132
- */
133
- renderDrivingStep() {
134
- return e("div", { class: "step", onClick: (t) => this.stepClickHandler(t) }, this.isInternetExplorer ? null : e("span", { class: "step__action-icon step__action-icon--circled" }, e("mi-icon", { "icon-name": "car" })), e("h3", { part: "step-heading", class: "step__heading" }, this.getStepHeading()), this.renderTravelMode(), e("div", { part: "step-description", class: "step__description" }, this.translationsData.drive, e("br", null), this.renderDistance()), this.renderToggleButton(), this.renderSubsteps());
135
- }
136
- /**
137
- * Get display heading.
138
- *
139
- * @returns {string}
140
- */
141
- getStepHeading() {
142
- var t;
143
- const s = {
144
- driving: this.translationsData.drive,
145
- walking: this.translationsData.walk,
146
- bicycling: this.translationsData.bike
147
- };
148
- return !((t = this.stepData.steps[0]) === null || t === void 0) && t.instructions ? this.stepData.steps[0].instructions : s[this.stepData.travel_mode.toLowerCase()];
149
- }
150
- /**
151
- * Render a walking step.
152
- *
153
- *
154
- * @returns {JSX.Element}
155
- */
156
- renderWalkingStep() {
157
- let t, s;
158
- return this.stepData.parking === !0 ? (t = `${this.translationsData.park} ${this.stepData.label ? ` ${this.translationsData.at} ` + this.stepData.label : ""}`, s = "park") : this.stepData.highway && this.stepData.highway.toUpperCase() === "STEPS" ? (t = `${this.translationsData.takeStaircaseToLevel} ${this.stepData.end_location.floor_name}`, s = "stairs") : this.stepData.highway && this.stepData.highway.toUpperCase() === "LADDER" ? (t = `${this.translationsData.takeLadderToLevel} ${this.stepData.end_location.floor_name}`, s = "ladder") : this.stepData.highway && this.stepData.highway.toUpperCase() === "ESCALATOR" ? (t = `${this.translationsData.takeEscalatorToLevel} ${this.stepData.end_location.floor_name}`, s = "escalator") : this.stepData.highway && this.stepData.highway.toUpperCase() === "WHEELCHAIRRAMP" ? (t = `${this.translationsData.takeWheelchairRampToLevel} ${this.stepData.end_location.floor_name}`, s = "wheelchair-ramp") : this.stepData.highway && this.stepData.highway.toUpperCase() === "WHEELCHAIRLIFT" ? (t = `${this.translationsData.takeWheelchairLiftToLevel} ${this.stepData.end_location.floor_name}`, s = "wheelchair-lift") : this.stepData.highway && this.stepData.highway.toUpperCase() === "ELEVATOR" ? (t = `${this.translationsData.takeElevatorToLevel} ${this.stepData.end_location.floor_name}`, s = "elevator") : this.fromRouteContext === "InsideBuilding" && this.stepData.route_context === "Outside" ? (t = this.addStepContextNameToHeading(this.translationsData.exit, this.stepData.start_context), s = "exit") : this.fromRouteContext === "InsideBuilding" && this.stepData.route_context === "InsideBuilding" ? (t = this.getStepHeading(), s = "walk") : this.fromRouteContext === "Outside" && this.stepData.route_context === "Outside" && this.fromTravelMode.toUpperCase() === "TRANSIT" ? (t = this.fromTransitStop, s = "transit-stop") : this.fromRouteContext === "Outside" && this.stepData.route_context === "Outside" ? (t = this.getStepHeading(), s = "walk") : this.fromRouteContext === "Outside" && this.stepData.route_context === "InsideBuilding" ? (t = this.addStepContextNameToHeading(this.translationsData.enter, this.stepData.end_context), s = "enter") : (t = this.fromRouteContext, s = "circle"), e("div", { class: "step", onClick: (i) => this.stepClickHandler(i) }, e("div", { part: "step-description", class: "step__description" }, this.renderDistance()), e("div", { class: "step__info" }, this.isInternetExplorer ? null : e("span", { class: `step__action-icon ${s !== "circle" ? "step__action-icon--circled" : ""}` }, e("mi-icon", { "icon-name": s })), e("div", { part: "step-heading", class: "step__heading" }, t)));
159
- }
160
- /**
161
- * Add building or venue name to the step heading
162
- * @param {string} heading
163
- * @param {StepContext} stepContext
164
- * @returns
165
- */
166
- addStepContextNameToHeading(t, s) {
167
- return s && (s.building ? t += ` ${s.building.buildingInfo.name} ${this.translationsData.building}` : s.venue && (t += ` ${s.venue.venueInfo.name} ${this.translationsData.venue}`)), t;
168
- }
169
- /**
170
- * Render a bicycling step.
171
- *
172
- * @returns {JSX.Element}
173
- */
174
- renderBicyclingStep() {
175
- return e("div", { class: "step", onClick: (t) => this.stepClickHandler(t) }, this.isInternetExplorer ? null : e("span", { class: "step__action-icon step__action-icon--circled" }, e("mi-icon", { "icon-name": "bike" })), e("h3", { part: "step-heading", class: "step__heading" }, this.getStepHeading()), this.renderTravelMode(), e("div", { part: "step-description", class: "step__description" }, this.translationsData.bike, e("br", null), this.renderDistance()), this.renderToggleButton(), this.renderSubsteps());
176
- }
177
- /**
178
- * Render a transit step.
179
- *
180
- * @returns {JSX.Element}
181
- */
182
- renderTransitStep() {
183
- var t, s;
184
- return e("div", { class: "step", onClick: (i) => this.stepClickHandler(i) }, this.isInternetExplorer ? null : e("span", { class: "step__action-icon step__action-icon--circled" }, e("mi-icon", { "icon-name": "transit-stop" })), e("h3", { part: "step-heading", class: "step__heading" }, this.stepData.instructions), this.renderTravelMode(), e("div", { part: "step-description", class: "step__description" }, this.stepData.transit_information.line.short_name ? e("span", { class: "step__short-name", style: {
185
- backgroundColor: !((t = this.stepData.transit_information.line) === null || t === void 0) && t.color ? this.stepData.transit_information.line.color : null,
186
- color: !((s = this.stepData.transit_information.line) === null || s === void 0) && s.text_color ? this.stepData.transit_information.line.text_color : null
187
- } }, this.stepData.transit_information.line.short_name) : null, this.stepData.transit_information.headsign ? this.stepData.transit_information.headsign : null, e("br", null), e("span", { part: "step-info", class: "step__distance-duration" }, e("mi-time", { seconds: this.stepData.duration.value, translations: `{"days":"${this.translationsData.days}","hours":"${this.translationsData.hours}","minutes":"${this.translationsData.minutes}"}` }), " · ", this.stepData.transit_information.num_stops ? this.stepData.transit_information.num_stops : null, " ", this.translationsData.stops ? this.translationsData.stops : null)), this.renderToggleButton(), this.renderSubsteps());
188
- }
189
- static get watchers() {
190
- return {
191
- step: ["parseStepProp"],
192
- translations: ["parseTranslationsProp"]
193
- };
194
- }
195
- };
196
- d.style = p;
197
- export {
198
- d as mi_route_instructions_step
199
- };