@mapsindoors/map-template 1.95.1 → 1.95.3

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 (66) hide show
  1. package/dist/{GoogleMapsMap-C5n6Bgtp.mjs → GoogleMapsMap-Dkn60-_e.mjs} +2 -2
  2. package/dist/{MapboxMap-UCqzt1AC.mjs → MapboxMap-B1oo7IUm.mjs} +2 -2
  3. package/dist/_commonjsHelpers-B85MJLTf.js +5 -0
  4. package/dist/app-globals-DQuL1Twl.js +3 -0
  5. package/dist/combo-box-item.entry.js +8 -10
  6. package/dist/icon-DT_sDkmK.js +11 -0
  7. package/dist/index-BZQHyS7V.js +1701 -0
  8. package/dist/loader.js +7 -14
  9. package/dist/mapsindoors-react.es.js +1 -1
  10. package/dist/mapsindoors-react.umd.js +175 -175
  11. package/dist/mapsindoors-webcomponent.es.js +2916 -2904
  12. package/dist/mi-card_2.entry.js +23 -18
  13. package/dist/mi-chip.entry.js +25 -16
  14. package/dist/mi-column.entry.js +47 -23
  15. package/dist/mi-combo-box.entry.js +412 -379
  16. package/dist/mi-components.js +15 -12
  17. package/dist/mi-data-table.entry.js +300 -278
  18. package/dist/mi-distance_2.entry.js +58 -56
  19. package/dist/mi-dropdown-item.entry.js +8 -10
  20. package/dist/mi-dropdown.entry.js +527 -481
  21. package/dist/mi-floor-selector.entry.js +187 -180
  22. package/dist/mi-keyboard.entry.js +209 -186
  23. package/dist/mi-list-item-category.entry.js +44 -41
  24. package/dist/mi-list-item-location.entry.js +168 -162
  25. package/dist/mi-list.entry.js +60 -48
  26. package/dist/mi-location-booking.entry.js +320 -295
  27. package/dist/mi-location-info.entry.js +61 -53
  28. package/dist/mi-map-googlemaps.entry.js +369 -324
  29. package/dist/mi-map-mapbox.entry.js +502 -439
  30. package/dist/mi-metric-card.entry.js +50 -37
  31. package/dist/mi-my-position.entry.js +2345 -874
  32. package/dist/mi-notification.entry.js +112 -102
  33. package/dist/mi-route-instructions-heading.entry.js +70 -65
  34. package/dist/mi-route-instructions-maneuver-legacy.entry.js +80 -76
  35. package/dist/mi-route-instructions-maneuver.entry.js +80 -76
  36. package/dist/mi-route-instructions-step-legacy.entry.js +296 -282
  37. package/dist/mi-route-instructions-step.entry.js +313 -292
  38. package/dist/mi-route-instructions.entry.js +169 -150
  39. package/dist/mi-scroll-buttons.entry.js +106 -98
  40. package/dist/mi-search.entry.js +378 -325
  41. package/dist/mi-share-sms.entry.js +84 -70
  42. package/dist/mi-step-switcher.entry.js +34 -25
  43. package/dist/mi-tab-panel.entry.js +18 -18
  44. package/dist/mi-tab.entry.js +5 -7
  45. package/dist/mi-tabs.entry.js +42 -40
  46. package/dist/mi-time.entry.js +49 -49
  47. package/dist/mi-variables-CDNvnTkH.js +5 -0
  48. package/dist/{reactcomponent-DQsjxRIN.mjs → reactcomponent-2Oa1vSiK.mjs} +8996 -8660
  49. package/dist/route-travel-mode.enum-BvqP1fpw.js +9 -0
  50. package/dist/sort-order.enum-jsLAbYWg.js +566 -0
  51. package/dist/{unit-system.enum-eaefb53e.js → unit-system.enum-BwPgAWqL.js} +2 -2
  52. package/dist/utils-DNHzysQ6.js +61 -0
  53. package/package.json +1 -1
  54. package/dist/_commonjsHelpers-ba3f0406.js +0 -21
  55. package/dist/icon-b8d01d6f.js +0 -24
  56. package/dist/index-7e9696f3.js +0 -1678
  57. package/dist/mi-variables-9a6c8d4d.js +0 -6
  58. package/dist/polyfills/core-js.js +0 -11
  59. package/dist/polyfills/css-shim.js +0 -1
  60. package/dist/polyfills/dom.js +0 -79
  61. package/dist/polyfills/es5-html-element.js +0 -1
  62. package/dist/polyfills/index.js +0 -34
  63. package/dist/polyfills/system.js +0 -6
  64. package/dist/route-travel-mode.enum-7f4ce9c7.js +0 -9
  65. package/dist/sort-order.enum-64ce8998.js +0 -552
  66. package/dist/utils-ae714467.js +0 -61
@@ -1,321 +1,342 @@
1
- import { r as registerInstance, c as createEvent, h } from './index-7e9696f3.js';
2
- import { U as UnitSystem } from './unit-system.enum-eaefb53e.js';
3
- import { c as isInternetExplorer } from './utils-ae714467.js';
1
+ import { r as registerInstance, c as createEvent, h } from './index-BZQHyS7V.js';
2
+ import { U as UnitSystem } from './unit-system.enum-BwPgAWqL.js';
3
+ import { c as isInternetExplorer } from './utils-DNHzysQ6.js';
4
4
 
5
- const routeInstructionsStepCss = ":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%}";
5
+ const routeInstructionsStepCss = () => `: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%}`;
6
6
 
7
7
  const RouteInstructionsStep = class {
8
- constructor(hostRef) {
9
- registerInstance(this, hostRef);
10
- this.stepClicked = createEvent(this, "stepClicked", 7);
11
- this.substepsToggled = createEvent(this, "substepsToggled", 7);
12
- this.isInternetExplorer = isInternetExplorer();
13
- this.step = undefined;
14
- this.stepData = undefined;
15
- this.hideIndoorSubsteps = true;
16
- this.fromRouteContext = '';
17
- this.fromTravelMode = undefined;
18
- this.fromTransitStop = undefined;
19
- this.unit = navigator.language === 'en-US' ? UnitSystem.Imperial : UnitSystem.Metric;
20
- this.showToggleButton = true;
21
- this.translations = undefined;
22
- this.translationsData = undefined;
23
- this.substepsAreOpen = false;
24
- }
25
- parseStepProp() {
26
- if (this.step) {
27
- this.stepData = JSON.parse(this.step);
8
+ constructor(hostRef) {
9
+ registerInstance(this, hostRef);
10
+ this.stepClicked = createEvent(this, "stepClicked", 7);
11
+ this.substepsToggled = createEvent(this, "substepsToggled", 7);
12
+ /**
13
+ * If indoor substeps/maneuvers should be hidden.
14
+ *
15
+ * @type {boolean}
16
+ */
17
+ this.hideIndoorSubsteps = true;
18
+ /**
19
+ * The route context of previous step, if any.
20
+ *
21
+ * @type {string}
22
+ */
23
+ this.fromRouteContext = '';
24
+ /**
25
+ * Set imperial or metric as default unit system. Default is Metric unless the browser is running US English. In that case Imperial.
26
+ *
27
+ * @type {UnitSystem}
28
+ */
29
+ this.unit = navigator.language === 'en-US' ? UnitSystem.Imperial : UnitSystem.Metric;
30
+ /**
31
+ * Indicates if it should show the toggle button.
32
+ *
33
+ * @type {boolean}
34
+ */
35
+ this.showToggleButton = true;
36
+ /**
37
+ * Signifies wether substeps are open or not.
38
+ */
39
+ this.substepsAreOpen = false;
40
+ this.isInternetExplorer = isInternetExplorer();
28
41
  }
29
- }
30
- parseTranslationsProp() {
31
- if (this.translations) {
32
- this.translationsData = JSON.parse(this.translations);
42
+ parseStepProp() {
43
+ if (this.step) {
44
+ this.stepData = JSON.parse(this.step);
45
+ }
33
46
  }
34
- }
35
- /**
36
- * Programmatically open the substeps.
37
- */
38
- openSubsteps() {
39
- this.substepsAreOpen = true;
40
- }
41
- /**
42
- * Programmatically close the substeps.
43
- */
44
- closeSubsteps() {
45
- this.substepsAreOpen = false;
46
- }
47
- /**
48
- * Component will load.
49
- */
50
- componentWillLoad() {
51
- this.parseStepProp();
52
- this.parseTranslationsProp();
53
- }
54
- /**
55
- * Render if there is step data.
56
- *
57
- * @returns {JSX.Element}
58
- */
59
- render() {
60
- return this.stepData && this.translationsData ? this.renderStep() : null;
61
- }
62
- /**
63
- * Emits stepClicked event (if click target is not related to an action).
64
- *
65
- * @param event - Event.
66
- */
67
- stepClickHandler(event) {
68
- // Don't emit click event if clicked on elements that are actions to other things
69
- if (Array.from(event.target.classList).includes('icon-toggle')) {
70
- return;
47
+ parseTranslationsProp() {
48
+ if (this.translations) {
49
+ this.translationsData = JSON.parse(this.translations);
50
+ }
71
51
  }
72
- let maneuverIndex = null;
73
- if (event.target.dataset.maneuverIndex !== undefined) {
74
- maneuverIndex = parseInt(event.target.dataset.maneuverIndex);
52
+ /**
53
+ * Programmatically open the substeps.
54
+ */
55
+ async openSubsteps() {
56
+ this.substepsAreOpen = true;
75
57
  }
76
- this.stepClicked.emit({ maneuverIndex });
77
- }
78
- /**
79
- * Render step part depending on travel mode.
80
- *
81
- * @returns {JSX.Element}
82
- */
83
- renderStep() {
84
- switch (this.stepData.travel_mode.toUpperCase()) {
85
- case 'DRIVING':
86
- return this.renderDrivingStep();
87
- case 'WALKING':
88
- return this.renderWalkingStep();
89
- case 'BICYCLING':
90
- return this.renderBicyclingStep();
91
- case 'TRANSIT':
92
- return this.renderTransitStep();
93
- default:
94
- return h("div", null, "Unknown travel mode: ", this.stepData.travel_mode);
58
+ /**
59
+ * Programmatically close the substeps.
60
+ */
61
+ async closeSubsteps() {
62
+ this.substepsAreOpen = false;
95
63
  }
96
- }
97
- /**
98
- * Render the travel mode indicator and dotted/solid line.
99
- *
100
- * @returns {JSX.Element}
101
- */
102
- renderTravelMode() {
103
- if (this.isInternetExplorer) {
104
- return null;
64
+ /**
65
+ * Component will load.
66
+ */
67
+ componentWillLoad() {
68
+ this.parseStepProp();
69
+ this.parseTranslationsProp();
105
70
  }
106
- let travelModeIcon;
107
- switch (this.stepData.travel_mode.toUpperCase()) {
108
- case 'DRIVING':
109
- travelModeIcon = 'car';
110
- break;
111
- case 'WALKING':
112
- travelModeIcon = 'walk';
113
- break;
114
- case 'BICYCLING':
115
- travelModeIcon = 'bike';
116
- break;
117
- case 'TRANSIT':
118
- travelModeIcon = this.getTransitVehicleIconName();
119
- break;
71
+ /**
72
+ * Render if there is step data.
73
+ *
74
+ * @returns {JSX.Element}
75
+ */
76
+ render() {
77
+ return this.stepData && this.translationsData ? this.renderStep() : null;
120
78
  }
121
- return (h("span", { part: "step-travel-mode", class: `step__travel-mode step__travel-mode--${this.stepData.travel_mode.toUpperCase() === 'TRANSIT' ? 'solid' : 'dotted'}` }, h("span", { class: "step__travel-mode-icon" }, h("mi-icon", { part: "step-travel-mode-icon", "icon-name": travelModeIcon }))));
122
- }
123
- /**
124
- * Get icon name for transit vehicle.
125
- *
126
- * @returns {string}
127
- */
128
- getTransitVehicleIconName() {
129
- var _a, _b;
130
- const stepTransitVehicleType = (_b = (_a = this.stepData.transit_information) === null || _a === void 0 ? void 0 : _a.line.vehicle) === null || _b === void 0 ? void 0 : _b.type.toLowerCase();
131
- const transitVehicleTypes = ['boat', 'bus', 'railway', 'train', 'subway']; // Supported Transit Vehicles
132
- return stepTransitVehicleType && transitVehicleTypes.some(type => type === stepTransitVehicleType) ? stepTransitVehicleType : 'transit';
133
- }
134
- /**
135
- * Toggles visibility of sub steps (steps in steps).
136
- */
137
- toggleSubsteps() {
138
- this.substepsToggled.emit();
139
- this.substepsAreOpen = !this.substepsAreOpen;
140
- }
141
- /**
142
- * Render substeps if they should be visible.
143
- *
144
- * @returns {JSX.Element}
145
- */
146
- renderSubsteps() {
147
- var _a;
148
- return this.substepsAreOpen === true ? h("div", { class: "step__substeps" }, (_a = this.stepData.steps) === null || _a === void 0 ? void 0 : _a.map((maneuver, index) => {
149
- return h("mi-route-instructions-maneuver", { "data-maneuver-index": index, maneuver: JSON.stringify(maneuver), translations: this.translations, unit: this.unit,
150
- // @ts-ignore
151
- exportparts: "\n maneuver-icon,\n maneuver-description,\n maneuver-description-distance,\n maneuver-description-distance-border" });
152
- })) : null;
153
- }
154
- /**
155
- * Render the toggle button for the sub step expander.
156
- *
157
- * @returns {JSX.Element}
158
- */
159
- renderToggleButton() {
160
- var _a;
161
- // Return null if none substeps/maneuvers is provided,
162
- // or if the showToggleButton is set to false.
163
- if (((_a = this.stepData.steps) === null || _a === void 0 ? void 0 : _a.length) <= 0 || !this.showToggleButton) {
164
- return null;
79
+ /**
80
+ * Emits stepClicked event (if click target is not related to an action).
81
+ *
82
+ * @param event - Event.
83
+ */
84
+ stepClickHandler(event) {
85
+ // Don't emit click event if clicked on elements that are actions to other things
86
+ if (Array.from(event.target.classList).includes('icon-toggle')) {
87
+ return;
88
+ }
89
+ let maneuverIndex = null;
90
+ if (event.target.dataset.maneuverIndex !== undefined) {
91
+ maneuverIndex = parseInt(event.target.dataset.maneuverIndex);
92
+ }
93
+ this.stepClicked.emit({ maneuverIndex });
165
94
  }
166
- return (h("span", { class: 'step__toggle', onClick: () => this.toggleSubsteps() }, this.substepsAreOpen ?
167
- h("mi-icon", { part: "step-toggle", "icon-name": "chevron-up" })
168
- :
169
- h("mi-icon", { part: "step-toggle", "icon-name": "chevron-down" })));
170
- }
171
- /**
172
- * Render distance part.
173
- *
174
- * @returns {JSX.Element}
175
- */
176
- renderDistance() {
177
- return h("span", { part: "step-info", class: "step__distance-duration" }, h("mi-distance", { meters: this.stepData.distance.value, unit: this.unit }), h("br", null));
178
- }
179
- /**
180
- * Render toggle and substeps.
181
- *
182
- * @returns {JSX.Element}
183
- */
184
- showSubsteps() {
185
- return h("div", { class: "step__details" }, this.renderSubsteps());
186
- }
187
- /**
188
- * Render a driving step.
189
- *
190
- * @returns {JSX.Element}
191
- */
192
- renderDrivingStep() {
193
- return h("div", { class: "step", onClick: (e) => this.stepClickHandler(e) }, h("div", { class: "step__info" }, h("div", { part: "step-heading", class: "step__heading" }, this.getStepHeading()), this.renderToggleButton()), this.showSubsteps());
194
- }
195
- /**
196
- * Get display heading.
197
- *
198
- * @returns {string}
199
- */
200
- getStepHeading() {
201
- var _a;
202
- const defaultHeadings = {
203
- 'driving': this.translationsData.drive,
204
- 'walking': this.translationsData.walk,
205
- 'bicycling': this.translationsData.bike,
206
- };
207
- return ((_a = this.stepData.steps[0]) === null || _a === void 0 ? void 0 : _a.instructions) ?
208
- this.stepData.steps[0].instructions :
209
- defaultHeadings[this.stepData.travel_mode.toLowerCase()];
210
- }
211
- /**
212
- * Render a walking step.
213
- *
214
- *
215
- * @returns {JSX.Element}
216
- */
217
- renderWalkingStep() {
218
- let heading;
219
- /*
220
- * Determine action heading:
95
+ /**
96
+ * Render step part depending on travel mode.
97
+ *
98
+ * @returns {JSX.Element}
221
99
  */
222
- if (this.stepData.parking === true) {
223
- // Park your vehicle
224
- heading = `${this.translationsData.park} ${this.stepData.label ? ` ${this.translationsData.at} ` + this.stepData.label : ''}`;
100
+ renderStep() {
101
+ switch (this.stepData.travel_mode.toUpperCase()) {
102
+ case 'DRIVING':
103
+ return this.renderDrivingStep();
104
+ case 'WALKING':
105
+ return this.renderWalkingStep();
106
+ case 'BICYCLING':
107
+ return this.renderBicyclingStep();
108
+ case 'TRANSIT':
109
+ return this.renderTransitStep();
110
+ default:
111
+ return h("div", null, "Unknown travel mode: ", this.stepData.travel_mode);
112
+ }
225
113
  }
226
- else if (this.stepData.highway && this.stepData.highway.toUpperCase() === 'STEPS') { // TODO: SDK, why is highway not always set?
227
- // Take stairs
228
- heading = `${this.translationsData.takeStaircaseToLevel} ${this.stepData.end_location.floor_name}`;
114
+ /**
115
+ * Render the travel mode indicator and dotted/solid line.
116
+ *
117
+ * @returns {JSX.Element}
118
+ */
119
+ renderTravelMode() {
120
+ if (this.isInternetExplorer) {
121
+ return null;
122
+ }
123
+ let travelModeIcon;
124
+ switch (this.stepData.travel_mode.toUpperCase()) {
125
+ case 'DRIVING':
126
+ travelModeIcon = 'car';
127
+ break;
128
+ case 'WALKING':
129
+ travelModeIcon = 'walk';
130
+ break;
131
+ case 'BICYCLING':
132
+ travelModeIcon = 'bike';
133
+ break;
134
+ case 'TRANSIT':
135
+ travelModeIcon = this.getTransitVehicleIconName();
136
+ break;
137
+ }
138
+ return (h("span", { part: "step-travel-mode", class: `step__travel-mode step__travel-mode--${this.stepData.travel_mode.toUpperCase() === 'TRANSIT' ? 'solid' : 'dotted'}` }, h("span", { class: "step__travel-mode-icon" }, h("mi-icon", { part: "step-travel-mode-icon", "icon-name": travelModeIcon }))));
229
139
  }
230
- else if (this.stepData.highway && this.stepData.highway.toUpperCase() === 'LADDER') {
231
- // Take a laddder
232
- heading = `${this.translationsData.takeLadderToLevel} ${this.stepData.end_location.floor_name}`;
140
+ /**
141
+ * Get icon name for transit vehicle.
142
+ *
143
+ * @returns {string}
144
+ */
145
+ getTransitVehicleIconName() {
146
+ var _a, _b;
147
+ const stepTransitVehicleType = (_b = (_a = this.stepData.transit_information) === null || _a === void 0 ? void 0 : _a.line.vehicle) === null || _b === void 0 ? void 0 : _b.type.toLowerCase();
148
+ const transitVehicleTypes = ['boat', 'bus', 'railway', 'train', 'subway']; // Supported Transit Vehicles
149
+ return stepTransitVehicleType && transitVehicleTypes.some(type => type === stepTransitVehicleType) ? stepTransitVehicleType : 'transit';
233
150
  }
234
- else if (this.stepData.highway && this.stepData.highway.toUpperCase() === 'ESCALATOR') {
235
- // Take an escalator
236
- heading = `${this.translationsData.takeEscalatorToLevel} ${this.stepData.end_location.floor_name}`;
151
+ /**
152
+ * Toggles visibility of sub steps (steps in steps).
153
+ */
154
+ toggleSubsteps() {
155
+ this.substepsToggled.emit();
156
+ this.substepsAreOpen = !this.substepsAreOpen;
237
157
  }
238
- else if (this.stepData.highway && this.stepData.highway.toUpperCase() === 'WHEELCHAIRRAMP') {
239
- // Take wheel chair ramp
240
- heading = `${this.translationsData.takeWheelchairRampToLevel} ${this.stepData.end_location.floor_name}`;
158
+ /**
159
+ * Render substeps if they should be visible.
160
+ *
161
+ * @returns {JSX.Element}
162
+ */
163
+ renderSubsteps() {
164
+ var _a;
165
+ return this.substepsAreOpen === true ? h("div", { class: "step__substeps" }, (_a = this.stepData.steps) === null || _a === void 0 ? void 0 : _a.map((maneuver, index) => {
166
+ return h("mi-route-instructions-maneuver", { "data-maneuver-index": index, maneuver: JSON.stringify(maneuver), translations: this.translations, unit: this.unit,
167
+ // @ts-ignore
168
+ exportparts: "\n maneuver-icon,\n maneuver-description,\n maneuver-description-distance,\n maneuver-description-distance-border" });
169
+ })) : null;
241
170
  }
242
- else if (this.stepData.highway && this.stepData.highway.toUpperCase() === 'WHEELCHAIRLIFT') {
243
- // Take wheel chair lift
244
- heading = `${this.translationsData.takeWheelchairLiftToLevel} ${this.stepData.end_location.floor_name}`;
171
+ /**
172
+ * Render the toggle button for the sub step expander.
173
+ *
174
+ * @returns {JSX.Element}
175
+ */
176
+ renderToggleButton() {
177
+ var _a;
178
+ // Return null if none substeps/maneuvers is provided,
179
+ // or if the showToggleButton is set to false.
180
+ if (((_a = this.stepData.steps) === null || _a === void 0 ? void 0 : _a.length) <= 0 || !this.showToggleButton) {
181
+ return null;
182
+ }
183
+ return (h("span", { class: 'step__toggle', onClick: () => this.toggleSubsteps() }, this.substepsAreOpen ?
184
+ h("mi-icon", { part: "step-toggle", "icon-name": "chevron-up" })
185
+ :
186
+ h("mi-icon", { part: "step-toggle", "icon-name": "chevron-down" })));
245
187
  }
246
- else if (this.stepData.highway && this.stepData.highway.toUpperCase() === 'ELEVATOR') {
247
- // Take elevator
248
- heading = `${this.translationsData.takeElevatorToLevel} ${this.stepData.end_location.floor_name}`;
188
+ /**
189
+ * Render distance part.
190
+ *
191
+ * @returns {JSX.Element}
192
+ */
193
+ renderDistance() {
194
+ return h("span", { part: "step-info", class: "step__distance-duration" }, h("mi-distance", { meters: this.stepData.distance.value, unit: this.unit }), h("br", null));
249
195
  }
250
- else if (this.fromRouteContext === 'InsideBuilding' && this.stepData.route_context === 'Outside') {
251
- // Exit from inside to outside
252
- heading = this.addStepContextNameToHeading(this.translationsData.exit, this.stepData.start_context);
196
+ /**
197
+ * Render toggle and substeps.
198
+ *
199
+ * @returns {JSX.Element}
200
+ */
201
+ showSubsteps() {
202
+ return h("div", { class: "step__details" }, this.renderSubsteps());
253
203
  }
254
- else if (this.fromRouteContext === 'InsideBuilding' && this.stepData.route_context === 'InsideBuilding') {
255
- heading = this.getStepHeading();
204
+ /**
205
+ * Render a driving step.
206
+ *
207
+ * @returns {JSX.Element}
208
+ */
209
+ renderDrivingStep() {
210
+ return h("div", { class: "step", onClick: (e) => this.stepClickHandler(e) }, h("div", { class: "step__info" }, h("div", { part: "step-heading", class: "step__heading" }, this.getStepHeading()), this.renderToggleButton()), this.showSubsteps());
256
211
  }
257
- else if (this.fromRouteContext === 'Outside' && this.stepData.route_context === 'Outside' && this.fromTravelMode.toUpperCase() === 'TRANSIT') {
258
- // Switching between public transportation
259
- heading = this.fromTransitStop;
212
+ /**
213
+ * Get display heading.
214
+ *
215
+ * @returns {string}
216
+ */
217
+ getStepHeading() {
218
+ var _a;
219
+ const defaultHeadings = {
220
+ 'driving': this.translationsData.drive,
221
+ 'walking': this.translationsData.walk,
222
+ 'bicycling': this.translationsData.bike,
223
+ };
224
+ return ((_a = this.stepData.steps[0]) === null || _a === void 0 ? void 0 : _a.instructions) ?
225
+ this.stepData.steps[0].instructions :
226
+ defaultHeadings[this.stepData.travel_mode.toLowerCase()];
260
227
  }
261
- else if (this.fromRouteContext === 'Outside' && this.stepData.route_context === 'Outside') {
262
- heading = this.getStepHeading();
228
+ /**
229
+ * Render a walking step.
230
+ *
231
+ *
232
+ * @returns {JSX.Element}
233
+ */
234
+ renderWalkingStep() {
235
+ let heading;
236
+ /*
237
+ * Determine action heading:
238
+ */
239
+ if (this.stepData.parking === true) {
240
+ // Park your vehicle
241
+ heading = `${this.translationsData.park} ${this.stepData.label ? ` ${this.translationsData.at} ` + this.stepData.label : ''}`;
242
+ }
243
+ else if (this.stepData.highway && this.stepData.highway.toUpperCase() === 'STEPS') { // TODO: SDK, why is highway not always set?
244
+ // Take stairs
245
+ heading = `${this.translationsData.takeStaircaseToLevel} ${this.stepData.end_location.floor_name}`;
246
+ }
247
+ else if (this.stepData.highway && this.stepData.highway.toUpperCase() === 'LADDER') {
248
+ // Take a laddder
249
+ heading = `${this.translationsData.takeLadderToLevel} ${this.stepData.end_location.floor_name}`;
250
+ }
251
+ else if (this.stepData.highway && this.stepData.highway.toUpperCase() === 'ESCALATOR') {
252
+ // Take an escalator
253
+ heading = `${this.translationsData.takeEscalatorToLevel} ${this.stepData.end_location.floor_name}`;
254
+ }
255
+ else if (this.stepData.highway && this.stepData.highway.toUpperCase() === 'WHEELCHAIRRAMP') {
256
+ // Take wheel chair ramp
257
+ heading = `${this.translationsData.takeWheelchairRampToLevel} ${this.stepData.end_location.floor_name}`;
258
+ }
259
+ else if (this.stepData.highway && this.stepData.highway.toUpperCase() === 'WHEELCHAIRLIFT') {
260
+ // Take wheel chair lift
261
+ heading = `${this.translationsData.takeWheelchairLiftToLevel} ${this.stepData.end_location.floor_name}`;
262
+ }
263
+ else if (this.stepData.highway && this.stepData.highway.toUpperCase() === 'ELEVATOR') {
264
+ // Take elevator
265
+ heading = `${this.translationsData.takeElevatorToLevel} ${this.stepData.end_location.floor_name}`;
266
+ }
267
+ else if (this.fromRouteContext === 'InsideBuilding' && this.stepData.route_context === 'Outside') {
268
+ // Exit from inside to outside
269
+ heading = this.addStepContextNameToHeading(this.translationsData.exit, this.stepData.start_context);
270
+ }
271
+ else if (this.fromRouteContext === 'InsideBuilding' && this.stepData.route_context === 'InsideBuilding') {
272
+ heading = this.getStepHeading();
273
+ }
274
+ else if (this.fromRouteContext === 'Outside' && this.stepData.route_context === 'Outside' && this.fromTravelMode.toUpperCase() === 'TRANSIT') {
275
+ // Switching between public transportation
276
+ heading = this.fromTransitStop;
277
+ }
278
+ else if (this.fromRouteContext === 'Outside' && this.stepData.route_context === 'Outside') {
279
+ heading = this.getStepHeading();
280
+ }
281
+ else if (this.fromRouteContext === 'Outside' && this.stepData.route_context === 'InsideBuilding') {
282
+ // Enter from outside to inside
283
+ heading = this.addStepContextNameToHeading(this.translationsData.enter, this.stepData.end_context);
284
+ }
285
+ else {
286
+ // Origin Location name or empty
287
+ heading = this.fromRouteContext === 'InsideBuilding' ? 'Inside Building' : this.fromRouteContext;
288
+ }
289
+ return h("div", { class: "step", onClick: (e) => this.stepClickHandler(e) }, h("div", { class: "step__info" }, h("div", { part: "step-heading", class: "step__heading" }, heading), this.renderToggleButton()), this.showSubsteps());
263
290
  }
264
- else if (this.fromRouteContext === 'Outside' && this.stepData.route_context === 'InsideBuilding') {
265
- // Enter from outside to inside
266
- heading = this.addStepContextNameToHeading(this.translationsData.enter, this.stepData.end_context);
291
+ /**
292
+ * Add building or venue name to the step heading.
293
+ *
294
+ * @param {string} heading
295
+ * @param {StepContext} stepContext
296
+ * @returns {string}
297
+ */
298
+ addStepContextNameToHeading(heading, stepContext) {
299
+ if (stepContext) {
300
+ if (stepContext.building) {
301
+ heading += ` ${stepContext.building.buildingInfo.name} ${this.translationsData.building}`;
302
+ }
303
+ else if (stepContext.venue) {
304
+ heading += ` ${stepContext.venue.venueInfo.name} ${this.translationsData.venue}`;
305
+ }
306
+ }
307
+ return heading;
267
308
  }
268
- else {
269
- // Origin Location name or empty
270
- heading = this.fromRouteContext === 'InsideBuilding' ? 'Inside Building' : this.fromRouteContext;
309
+ /**
310
+ * Render a bicycling step.
311
+ *
312
+ * @returns {JSX.Element}
313
+ */
314
+ renderBicyclingStep() {
315
+ return h("div", { class: "step", onClick: (e) => this.stepClickHandler(e) }, h("div", { class: "step__info" }, h("div", { part: "step-heading", class: "step__heading" }, this.getStepHeading()), this.renderToggleButton()), this.showSubsteps());
271
316
  }
272
- return h("div", { class: "step", onClick: (e) => this.stepClickHandler(e) }, h("div", { class: "step__info" }, h("div", { part: "step-heading", class: "step__heading" }, heading), this.renderToggleButton()), this.showSubsteps());
273
- }
274
- /**
275
- * Add building or venue name to the step heading.
276
- *
277
- * @param {string} heading
278
- * @param {StepContext} stepContext
279
- * @returns {string}
280
- */
281
- addStepContextNameToHeading(heading, stepContext) {
282
- if (stepContext) {
283
- if (stepContext.building) {
284
- heading += ` ${stepContext.building.buildingInfo.name} ${this.translationsData.building}`;
285
- }
286
- else if (stepContext.venue) {
287
- heading += ` ${stepContext.venue.venueInfo.name} ${this.translationsData.venue}`;
288
- }
317
+ /**
318
+ * Render a transit step. Inclusing BUSWAY instruction.
319
+ *
320
+ * @returns {JSX.Element}
321
+ */
322
+ renderTransitStep() {
323
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4;
324
+ return h("div", { class: "step", onClick: (e) => this.stepClickHandler(e) }, h("div", { class: "step__info" }, h("h3", { part: "step-heading", class: "step__heading" }, this.stepData.travel_mode === 'TRANSIT' ? `${this.translationsData.rideTheBus}` : (_a = this.stepData) === null || _a === void 0 ? void 0 : _a.instructions), this.renderToggleButton()), this.renderTravelMode(), h("div", { part: "step-description", class: "step__description" }, ((_d = (_c = (_b = this.stepData) === null || _b === void 0 ? void 0 : _b.transit_information) === null || _c === void 0 ? void 0 : _c.line) === null || _d === void 0 ? void 0 : _d.short_name) ?
325
+ h("span", { class: "step__short-name", style: {
326
+ backgroundColor: ((_g = (_f = (_e = this.stepData) === null || _e === void 0 ? void 0 : _e.transit_information) === null || _f === void 0 ? void 0 : _f.line) === null || _g === void 0 ? void 0 : _g.color) ? (_k = (_j = (_h = this.stepData) === null || _h === void 0 ? void 0 : _h.transit_information) === null || _j === void 0 ? void 0 : _j.line) === null || _k === void 0 ? void 0 : _k.color : null,
327
+ color: ((_o = (_m = (_l = this.stepData) === null || _l === void 0 ? void 0 : _l.transit_information) === null || _m === void 0 ? void 0 : _m.line) === null || _o === void 0 ? void 0 : _o.text_color) ? (_r = (_q = (_p = this.stepData) === null || _p === void 0 ? void 0 : _p.transit_information) === null || _q === void 0 ? void 0 : _q.line) === null || _r === void 0 ? void 0 : _r.text_color : null
328
+ } }, (_u = (_t = (_s = this.stepData) === null || _s === void 0 ? void 0 : _s.transit_information) === null || _t === void 0 ? void 0 : _t.line) === null || _u === void 0 ? void 0 : _u.short_name) :
329
+ null, ((_w = (_v = this.stepData) === null || _v === void 0 ? void 0 : _v.transit_information) === null || _w === void 0 ? void 0 : _w.headsign) ? (_y = (_x = this.stepData) === null || _x === void 0 ? void 0 : _x.transit_information) === null || _y === void 0 ? void 0 : _y.headsign : null, h("br", null), h("span", { part: "step-info", class: "step__distance-duration" }, h("mi-time", { seconds: (_0 = (_z = this.stepData) === null || _z === void 0 ? void 0 : _z.duration) === null || _0 === void 0 ? void 0 : _0.value, translations: `{"days":"${this.translationsData.days}","hours":"${this.translationsData.hours}","minutes":"${this.translationsData.minutes}"}` }), "\u00A0\u00B7\u00A0", ((_2 = (_1 = this.stepData) === null || _1 === void 0 ? void 0 : _1.transit_information) === null || _2 === void 0 ? void 0 : _2.num_stops) ? (_4 = (_3 = this.stepData) === null || _3 === void 0 ? void 0 : _3.transit_information) === null || _4 === void 0 ? void 0 : _4.num_stops : null, " ", this.translationsData.stops ? this.translationsData.stops : null)), this.showSubsteps());
289
330
  }
290
- return heading;
291
- }
292
- /**
293
- * Render a bicycling step.
294
- *
295
- * @returns {JSX.Element}
296
- */
297
- renderBicyclingStep() {
298
- return h("div", { class: "step", onClick: (e) => this.stepClickHandler(e) }, h("div", { class: "step__info" }, h("div", { part: "step-heading", class: "step__heading" }, this.getStepHeading()), this.renderToggleButton()), this.showSubsteps());
299
- }
300
- /**
301
- * Render a transit step. Inclusing BUSWAY instruction.
302
- *
303
- * @returns {JSX.Element}
304
- */
305
- renderTransitStep() {
306
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4;
307
- return h("div", { class: "step", onClick: (e) => this.stepClickHandler(e) }, h("div", { class: "step__info" }, h("h3", { part: "step-heading", class: "step__heading" }, this.stepData.travel_mode === 'TRANSIT' ? `${this.translationsData.rideTheBus}` : (_a = this.stepData) === null || _a === void 0 ? void 0 : _a.instructions), this.renderToggleButton()), this.renderTravelMode(), h("div", { part: "step-description", class: "step__description" }, ((_d = (_c = (_b = this.stepData) === null || _b === void 0 ? void 0 : _b.transit_information) === null || _c === void 0 ? void 0 : _c.line) === null || _d === void 0 ? void 0 : _d.short_name) ?
308
- h("span", { class: "step__short-name", style: {
309
- backgroundColor: ((_g = (_f = (_e = this.stepData) === null || _e === void 0 ? void 0 : _e.transit_information) === null || _f === void 0 ? void 0 : _f.line) === null || _g === void 0 ? void 0 : _g.color) ? (_k = (_j = (_h = this.stepData) === null || _h === void 0 ? void 0 : _h.transit_information) === null || _j === void 0 ? void 0 : _j.line) === null || _k === void 0 ? void 0 : _k.color : null,
310
- color: ((_o = (_m = (_l = this.stepData) === null || _l === void 0 ? void 0 : _l.transit_information) === null || _m === void 0 ? void 0 : _m.line) === null || _o === void 0 ? void 0 : _o.text_color) ? (_r = (_q = (_p = this.stepData) === null || _p === void 0 ? void 0 : _p.transit_information) === null || _q === void 0 ? void 0 : _q.line) === null || _r === void 0 ? void 0 : _r.text_color : null
311
- } }, (_u = (_t = (_s = this.stepData) === null || _s === void 0 ? void 0 : _s.transit_information) === null || _t === void 0 ? void 0 : _t.line) === null || _u === void 0 ? void 0 : _u.short_name) :
312
- null, ((_w = (_v = this.stepData) === null || _v === void 0 ? void 0 : _v.transit_information) === null || _w === void 0 ? void 0 : _w.headsign) ? (_y = (_x = this.stepData) === null || _x === void 0 ? void 0 : _x.transit_information) === null || _y === void 0 ? void 0 : _y.headsign : null, h("br", null), h("span", { part: "step-info", class: "step__distance-duration" }, h("mi-time", { seconds: (_0 = (_z = this.stepData) === null || _z === void 0 ? void 0 : _z.duration) === null || _0 === void 0 ? void 0 : _0.value, translations: `{"days":"${this.translationsData.days}","hours":"${this.translationsData.hours}","minutes":"${this.translationsData.minutes}"}` }), "\u00A0\u00B7\u00A0", ((_2 = (_1 = this.stepData) === null || _1 === void 0 ? void 0 : _1.transit_information) === null || _2 === void 0 ? void 0 : _2.num_stops) ? (_4 = (_3 = this.stepData) === null || _3 === void 0 ? void 0 : _3.transit_information) === null || _4 === void 0 ? void 0 : _4.num_stops : null, " ", this.translationsData.stops ? this.translationsData.stops : null)), this.showSubsteps());
313
- }
314
- static get watchers() { return {
315
- "step": ["parseStepProp"],
316
- "translations": ["parseTranslationsProp"]
317
- }; }
331
+ static get watchers() { return {
332
+ "step": [{
333
+ "parseStepProp": 0
334
+ }],
335
+ "translations": [{
336
+ "parseTranslationsProp": 0
337
+ }]
338
+ }; }
318
339
  };
319
- RouteInstructionsStep.style = routeInstructionsStepCss;
340
+ RouteInstructionsStep.style = routeInstructionsStepCss();
320
341
 
321
342
  export { RouteInstructionsStep as mi_route_instructions_step };