@mapsindoors/map-template 1.95.8 → 1.95.9

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 (59) hide show
  1. package/dist/{GoogleMapsMap-mNXwkS5r.mjs → GoogleMapsMap-CV6Wgkhg.mjs} +2 -2
  2. package/dist/{MapboxMap-JSpSXMbZ.mjs → MapboxMap-EuKWsGtq.mjs} +2 -2
  3. package/dist/favicon.png +0 -0
  4. package/dist/logo-192.png +0 -0
  5. package/dist/manifest.json +21 -0
  6. package/dist/mapsindoors-react.es.js +1 -1
  7. package/dist/mapsindoors-react.umd.js +236 -198
  8. package/dist/mapsindoors-webcomponent.es.js +51234 -42442
  9. package/dist/reactcomponent-DcNpL3XF.mjs +37841 -0
  10. package/dist/robots.txt +3 -0
  11. package/package.json +5 -7
  12. package/dist/_commonjsHelpers-B85MJLTf.js +0 -5
  13. package/dist/app-globals-DQuL1Twl.js +0 -3
  14. package/dist/combo-box-item.entry.js +0 -13
  15. package/dist/icon-DT_sDkmK.js +0 -11
  16. package/dist/index-BZQHyS7V.js +0 -1701
  17. package/dist/index.js +0 -1
  18. package/dist/loader.js +0 -11
  19. package/dist/mi-card_2.entry.js +0 -33
  20. package/dist/mi-chip.entry.js +0 -31
  21. package/dist/mi-column.entry.js +0 -52
  22. package/dist/mi-combo-box.entry.js +0 -449
  23. package/dist/mi-components.js +0 -21
  24. package/dist/mi-data-table.entry.js +0 -324
  25. package/dist/mi-distance_2.entry.js +0 -69
  26. package/dist/mi-dropdown-item.entry.js +0 -13
  27. package/dist/mi-dropdown.entry.js +0 -656
  28. package/dist/mi-floor-selector.entry.js +0 -209
  29. package/dist/mi-keyboard.entry.js +0 -261
  30. package/dist/mi-list-item-category.entry.js +0 -51
  31. package/dist/mi-list-item-location.entry.js +0 -177
  32. package/dist/mi-list.entry.js +0 -68
  33. package/dist/mi-location-booking.entry.js +0 -5218
  34. package/dist/mi-location-info.entry.js +0 -71
  35. package/dist/mi-map-googlemaps.entry.js +0 -795
  36. package/dist/mi-map-mapbox.entry.js +0 -530
  37. package/dist/mi-metric-card.entry.js +0 -61
  38. package/dist/mi-my-position.entry.js +0 -2457
  39. package/dist/mi-notification.entry.js +0 -137
  40. package/dist/mi-route-instructions-heading.entry.js +0 -78
  41. package/dist/mi-route-instructions-maneuver-legacy.entry.js +0 -86
  42. package/dist/mi-route-instructions-maneuver.entry.js +0 -86
  43. package/dist/mi-route-instructions-step-legacy.entry.js +0 -322
  44. package/dist/mi-route-instructions-step.entry.js +0 -342
  45. package/dist/mi-route-instructions.entry.js +0 -176
  46. package/dist/mi-scroll-buttons.entry.js +0 -120
  47. package/dist/mi-search.entry.js +0 -429
  48. package/dist/mi-share-sms.entry.js +0 -94
  49. package/dist/mi-step-switcher.entry.js +0 -40
  50. package/dist/mi-tab-panel.entry.js +0 -25
  51. package/dist/mi-tab.entry.js +0 -10
  52. package/dist/mi-tabs.entry.js +0 -49
  53. package/dist/mi-time.entry.js +0 -57
  54. package/dist/mi-variables-CDNvnTkH.js +0 -5
  55. package/dist/reactcomponent-BrPGG2Eb.mjs +0 -29048
  56. package/dist/route-travel-mode.enum-BvqP1fpw.js +0 -9
  57. package/dist/sort-order.enum-jsLAbYWg.js +0 -566
  58. package/dist/unit-system.enum-BwPgAWqL.js +0 -7
  59. package/dist/utils-DNHzysQ6.js +0 -61
@@ -1,137 +0,0 @@
1
- import { r as registerInstance, f as forceUpdate, h, H as Host, g as getElement } from './index-BZQHyS7V.js';
2
-
3
- var NotificationPosition;
4
- (function (NotificationPosition) {
5
- NotificationPosition["TOP_LEFT"] = "top-left";
6
- NotificationPosition["TOP_CENTER"] = "top-center";
7
- NotificationPosition["TOP_RIGHT"] = "top-right";
8
- NotificationPosition["BOTTOM_CENTER"] = "bottom-center";
9
- NotificationPosition["BOTTOM_LEFT"] = "bottom-left";
10
- NotificationPosition["BOTTOM_RIGHT"] = "bottom-right";
11
- })(NotificationPosition || (NotificationPosition = {}));
12
-
13
- var NotificationType;
14
- (function (NotificationType) {
15
- NotificationType["Error"] = "error";
16
- NotificationType["Info"] = "info";
17
- NotificationType["Success"] = "success";
18
- NotificationType["Warning"] = "warning";
19
- NotificationType["None"] = "none";
20
- })(NotificationType || (NotificationType = {}));
21
-
22
- const notificationCss = () => `:host{padding:16px;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";position:fixed;z-index:1000;display:flex;flex-direction:column}:host(.top-left){top:0;left:0}:host(.top-center){top:0;align-items:center;left:50%;transform:translate(-50%, 0)}:host(.top-right){top:0;right:0;align-items:flex-end}:host(.bottom-left){bottom:0;left:0}:host(.bottom-center){bottom:0;align-items:center;left:50%;transform:translate(-50%, 0)}:host(.bottom-right){bottom:0;right:0;align-items:flex-end}.notification{margin-top:16px;display:flex;flex-direction:row;box-shadow:0px 4px 4px rgba(0, 0, 0, 0.16), 0px 2px 2px rgba(0, 0, 0, 0.18), 0px 1px 1px rgba(0, 0, 0, 0.2);border-radius:2px;background-color:#fcfcfc;overflow:hidden}.notification .icon{width:48px;display:flex;justify-content:center;align-items:center}.notification .icon-type--error{background-color:#ef4444}.notification .icon-type--success{background-color:#22c55e}.notification .icon-type--warning{background-color:#f59e0b}.notification .icon-type--info{background-color:#6b7280}.notification .label{padding-left:16px;flex:1;font-size:0.875rem}.notification .btn{padding-left:24px;padding-right:16px;display:flex;align-items:center;border:none;background-color:#fcfcfc}.notification .btn:focus{outline:none;box-shadow:none}`;
23
-
24
- const Notification = class {
25
- constructor(hostRef) {
26
- registerInstance(this, hostRef);
27
- /**
28
- * Where the notifications should be positioned.
29
- *
30
- * @type {NotificationPosition}
31
- */
32
- this.position = NotificationPosition.BOTTOM_RIGHT;
33
- /**
34
- * Time the notification should be visible. Default value is 3.
35
- *
36
- * @type {number} - Duration in seconds.
37
- */
38
- this.duration = 3;
39
- /**
40
- * List of currently displayed notifications.
41
- *
42
- * @type {NotificationMessage[]}
43
- */
44
- this.notifications = [];
45
- /**
46
- * Used for setting a unique identifier for each notification.
47
- *
48
- * @type {number}
49
- */
50
- this.notificationId = 0;
51
- }
52
- /**
53
- * Show a notification.
54
- *
55
- * @param {string} message - Message to display.
56
- * @param {string} [type='none'] - Type of notification. Available types: 'info', 'warning', 'success', 'error' and 'none'.
57
- * @param {boolean} [sticky=false] - Set message as sticky to prevent it from disappearing.
58
- * @returns {Promise<void>}
59
- */
60
- async push(message, type = 'none', sticky = false) {
61
- if (typeof message !== 'string' || message.length < 1) {
62
- return;
63
- }
64
- // Check validity of type
65
- const typeExist = Object.values(NotificationType)
66
- .some((notificationType) => notificationType === type);
67
- if (!typeExist) {
68
- // eslint-disable-next-line no-console
69
- console.error('Invalid notification type');
70
- return;
71
- }
72
- const notificationMessage = {
73
- id: this.notificationId,
74
- message: message,
75
- sticky: sticky,
76
- type: type,
77
- };
78
- if (sticky === false) {
79
- notificationMessage.timer = window.setTimeout(() => this.dismiss(notificationMessage.id), (this.duration * 1000));
80
- }
81
- this.notificationId++;
82
- this.notifications.push(notificationMessage);
83
- forceUpdate(this.hostElement);
84
- }
85
- /**
86
- * Clear all notifications.
87
- *
88
- * @returns {Promise<void>}
89
- */
90
- async clearAll() {
91
- this.notifications = [];
92
- forceUpdate(this.hostElement);
93
- }
94
- /**
95
- * Dismiss a single notification.
96
- *
97
- * @param {number} id
98
- */
99
- dismiss(id) {
100
- this.notifications = this.notifications.filter((notification) => notification.id !== id);
101
- forceUpdate(this.hostElement);
102
- }
103
- render() {
104
- return (h(Host, { key: 'df85a60b1ee91303adcae496907fb42839842de1', class: this.position }, this.notifications.map((notification) => this.renderNotification(notification))));
105
- }
106
- /**
107
- * Get JSX for notification.
108
- *
109
- * @param {NotificationMessage} { id, message }
110
- * @returns {JSX.Element}
111
- */
112
- renderNotification({ id, message, type }) {
113
- return (h("div", { class: "notification", role: "alert" }, type && type !== 'none' ? this.renderIcon(type) : null, h("p", { class: "label" }, message), h("button", { type: "button", "aria-label": "Dismiss notification", class: "btn", onClick: () => this.dismiss(id) }, h("svg", { width: "14", height: "14", viewBox: "0 0 14 14", fill: "none", xmlns: "http://www.w3.org/2000/svg", role: "img", "aria-hidden": "true", focusable: "false" }, h("path", { d: "M14 1.41L12.59 0L7 5.59L1.41 0L0 1.41L5.59 7L0 12.59L1.41 14L7 8.41L12.59 14L14 12.59L8.41 7L14 1.41Z", fill: "#1E2025" })))));
114
- }
115
- /**
116
- * Get JSX for type-icon.
117
- *
118
- * @param {NotificationType} type
119
- * @returns {JSX.Element}
120
- */
121
- renderIcon(type) {
122
- if (type === NotificationType.Error) {
123
- return (h("div", { class: "icon icon-type--error" }, h("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg", role: "img", "aria-hidden": "true", focusable: "false" }, h("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M10 0C4.48 0 0 4.48 0 10C0 15.52 4.48 20 10 20C15.52 20 20 15.52 20 10C20 4.48 15.52 0 10 0ZM9 15V13H11V15H9ZM9 5V11H11V5H9Z", fill: "#FCFCFC" }))));
124
- }
125
- else if (type === NotificationType.Success) {
126
- return (h("div", { class: "icon icon-type--success" }, h("svg", { width: "18", height: "14", viewBox: "0 0 18 14", fill: "none", xmlns: "http://www.w3.org/2000/svg", role: "img", "aria-hidden": "true", focusable: "false" }, h("path", { d: "M5.99997 11.17L1.82997 7L0.409973 8.41L5.99997 14L18 2L16.59 0.59L5.99997 11.17Z", fill: "#FCFCFC" }))));
127
- }
128
- else if (type === NotificationType.Warning) {
129
- return (h("div", { class: "icon icon-type--warning" }, h("svg", { width: "22", height: "19", viewBox: "0 0 22 19", fill: "none", xmlns: "http://www.w3.org/2000/svg", role: "img", "aria-hidden": "true", focusable: "false" }, h("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M22 19L11 0L0 19H22ZM10 16V14H12V16H10ZM10 12H12V8H10V12Z", fill: "#FCFCFC" }))));
130
- }
131
- return (h("div", { class: "icon icon-type--info" }, h("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg", role: "img", "aria-hidden": "true", focusable: "false" }, h("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M10 0C4.48 0 0 4.48 0 10C0 15.52 4.48 20 10 20C15.52 20 20 15.52 20 10C20 4.48 15.52 0 10 0ZM9 15V9H11V15H9ZM9 5V7H11V5H9Z", fill: "#FCFCFC" }))));
132
- }
133
- get hostElement() { return getElement(this); }
134
- };
135
- Notification.style = notificationCss();
136
-
137
- export { Notification as mi_notification };
@@ -1,78 +0,0 @@
1
- import { r as registerInstance, h } from './index-BZQHyS7V.js';
2
- import { R as RouteTravelMode } from './route-travel-mode.enum-BvqP1fpw.js';
3
- import { U as UnitSystem } from './unit-system.enum-BwPgAWqL.js';
4
-
5
- const routeInstructionsHeadingCss = () => `.directions{border-bottom:1px solid #d1d5db;color:#1c1917;font-size:1rem;font-weight:400;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"}.directions-way-points{padding-top:24px;padding-bottom:24px;padding-left:16px;padding-right:16px;border-bottom:1px solid #f3f4f6}.directions-way-points span{display:block}.directions-way-points span:first-child{font-size:1.25rem;font-weight:500;line-height:1.5rem}.directions-way-points span:last-child{color:#6b7280}.directions-way-points span:last-child a{color:#3b82f6;text-decoration:none}.directions-details{padding:16px;display:flex;flex-direction:row;justify-content:space-between}.directions-details-numbers mi-time{font-weight:500}.directions-details-numbers-distance{color:#6b7280;font-size:0.875rem;font-weight:400;text-transform:lowercase}.directions-details-travel-mode-selector{display:flex;align-items:center;color:#3b82f6;text-decoration:none}.directions-details-travel-mode-selector mi-icon{width:24px;height:24px;margin-left:8px;background-color:#3b82f6}`;
6
-
7
- const RouteInstructionsHeading = class {
8
- constructor(hostRef) {
9
- registerInstance(this, hostRef);
10
- /**
11
- * Set preferred travel mode. Defaults to "walking".
12
- *
13
- * @type {RouteTravelMode} 'walking', 'bicycling', 'transit', 'driving'.
14
- */
15
- this.travelMode = RouteTravelMode.Walking;
16
- /**
17
- * Set 'imperial' or 'metric' as default unit system.
18
- * @type {UnitSystem} 'imperial' or 'metric'
19
- */
20
- this.unit = UnitSystem.Metric;
21
- this.translations = {
22
- from: 'From',
23
- to: 'To',
24
- avoidStairs: 'Avoid stairs',
25
- walk: 'Walk',
26
- walking: 'Walking',
27
- bike: 'Bike',
28
- bicycling: 'Bicycling',
29
- transit: 'Transit',
30
- car: 'Car',
31
- driving: 'Driving'
32
- };
33
- }
34
- /**
35
- * Get travel mode as a string. Eg. "Walking", "Driving", "Transit", "Bicycling".
36
- *
37
- * @returns {string}
38
- */
39
- getTravelModeString() {
40
- switch (this.travelMode) {
41
- case RouteTravelMode.Walking: return this.translations.walk;
42
- case RouteTravelMode.Driving: return this.translations.car;
43
- case RouteTravelMode.Transit: return this.translations.transit;
44
- case RouteTravelMode.Bicycling: return this.translations.bike;
45
- default: return this.translations.walk;
46
- }
47
- }
48
- /**
49
- * Get icon name for travel mode.
50
- *
51
- * @returns {string}
52
- */
53
- getTravelModeIconName() {
54
- switch (this.travelMode) {
55
- case RouteTravelMode.Walking: return 'walk';
56
- case RouteTravelMode.Driving: return 'car';
57
- case RouteTravelMode.Transit: return 'transit';
58
- case RouteTravelMode.Bicycling: return 'bike';
59
- default: return 'walk';
60
- }
61
- }
62
- render() {
63
- return (h("div", { key: '5d9148321941db7361dacfdf718c53a2da67db30', class: "directions" }, this.originName && this.destinationName ? this.renderWayPoints() : null, h("div", { key: 'bca5a290ac376323d54f7dabfcb6dad615e1a07c', class: "directions-details" }, this.totalTravelTime >= 0 || this.totalWalkingDistance >= 0 ?
64
- h("div", { class: "directions-details-numbers" }, this.totalTravelTime >= 0 ? h("div", null, h("mi-time", { seconds: this.totalTravelTime })) : null, this.totalWalkingDistance >= 0 ? h("div", { class: "directions-details-numbers-distance" }, h("mi-distance", { meters: this.totalWalkingDistance }), " ", this.translations.walking.toLowerCase()) : null) :
65
- null, h("a", { key: '5586c46b4ba42d150f34437ee8153239d9bfdf1f', href: "#", class: "directions-details-travel-mode-selector" }, this.getTravelModeString(), h("mi-icon", { key: 'ced88ceba183c370aa5e1e331596b0d5003d836c', "icon-name": this.getTravelModeIconName() })))));
66
- }
67
- /**
68
- * Render direction way points.
69
- *
70
- * @returns {JSX.Element}
71
- */
72
- renderWayPoints() {
73
- return (h("div", { class: "directions-way-points" }, h("span", null, this.translations.to, " ", this.destinationName), h("span", null, this.translations.from, " ", h("a", { href: "#" }, this.originName))));
74
- }
75
- };
76
- RouteInstructionsHeading.style = routeInstructionsHeadingCss();
77
-
78
- export { RouteInstructionsHeading as mi_route_instructions_heading };
@@ -1,86 +0,0 @@
1
- import { r as registerInstance, h, H as Host } from './index-BZQHyS7V.js';
2
- import { U as UnitSystem } from './unit-system.enum-BwPgAWqL.js';
3
-
4
- const routeInstructionsManeuverLegacyCss = () => `:host{display:flex;padding-top:12px;padding-bottom:12px;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"}.icon{width:48px;display:flex;justify-content:center}.icon mi-icon{width:24px;height:24px}.description{display:flex;flex-direction:column;flex:1}.description p{margin:0;padding-right:16px;font-size:0.875rem;word-break:break-all}.description__distance{display:flex;align-items:center}.description__distance mi-distance{font-size:0.75rem;padding-right:12px}.description__distance-border{flex:1;width:100%;height:0;border-bottom:1px solid #e5e7eb}`;
5
-
6
- const RouteInstructionsManeuverLegacy = class {
7
- constructor(hostRef) {
8
- registerInstance(this, hostRef);
9
- /**
10
- * Set imperial or metric as default unit system.
11
- * @type {UnitSystem} 'imperial' or 'metric'
12
- */
13
- this.unit = UnitSystem.Metric;
14
- }
15
- parseManeuverProp() {
16
- this.maneuverData = JSON.parse(this.maneuver);
17
- }
18
- parseTranslationsProp() {
19
- this.translationsData = JSON.parse(this.translations);
20
- }
21
- componentWillLoad() {
22
- this.parseManeuverProp();
23
- this.parseTranslationsProp();
24
- }
25
- /**
26
- * Get maneuver name.
27
- *
28
- * @returns {string}
29
- */
30
- getManeuverName(maneuver) {
31
- if (maneuver.includes('straight'))
32
- return 'straight';
33
- if (maneuver.includes('sharp right'))
34
- return 'sharp-right';
35
- if (maneuver.includes('sharp left'))
36
- return 'sharp-left';
37
- if (maneuver.includes('slight right'))
38
- return 'slight-right';
39
- if (maneuver.includes('slight left'))
40
- return 'slight-left';
41
- if (maneuver.includes('right'))
42
- return 'right';
43
- if (maneuver.includes('left'))
44
- return 'left';
45
- if (maneuver.includes('uturn'))
46
- return 'u-turn';
47
- if (maneuver.includes('depart'))
48
- return 'straight';
49
- }
50
- render() {
51
- return (this.maneuverData && this.translationsData ? this.renderManeuver() : null);
52
- }
53
- /**
54
- * Render step.
55
- *
56
- * @returns {JSX.Element}
57
- */
58
- renderManeuver() {
59
- const maneuverStrings = {
60
- 'straight': this.translationsData.continueStraightAhead, // 'Continue straight ahead',
61
- 'left': `${this.translationsData.goLeft} ${this.translationsData.andContinue}`, // 'Go left and continue',
62
- 'sharp-left': `${this.translationsData.goSharpLeft} ${this.translationsData.andContinue}`, // 'Go sharp left and continue',
63
- 'slight-left': `${this.translationsData.goSlightLeft} ${this.translationsData.andContinue}`, // 'Go slight left and continue',
64
- 'right': `${this.translationsData.goRight} ${this.translationsData.andContinue}`, // 'Go right and continue',
65
- 'sharp-right': `${this.translationsData.goSharpRight} ${this.translationsData.andContinue}`, // 'Go sharp right and continue',
66
- 'slight-right': `${this.translationsData.goSlightRight} ${this.translationsData.andContinue}`, // 'Go slight right and continue',
67
- 'u-turn': `${this.translationsData.turnAround} ${this.translationsData.andContinue}`, // 'Turn around and continue'
68
- };
69
- const maneuver = this.getManeuverName(this.maneuverData.maneuver.toLowerCase());
70
- const iconName = `arrow-${maneuver}`;
71
- // Check if the instructions property has a value otherwise fallback to maneuver property
72
- const translatedManeuver = this.maneuverData.instructions ? this.maneuverData.instructions : maneuverStrings[maneuver];
73
- return (h(Host, null, h("div", { class: "icon" }, maneuver ? h("mi-icon", { part: "maneuver-icon", "icon-name": iconName }) : null), h("div", { class: "description" }, h("p", { part: "maneuver-description" }, translatedManeuver), h("div", { class: "description__distance" }, h("mi-distance", { part: "maneuver-description-distance", meters: this.maneuverData.distance.value, unit: this.unit }), h("span", { part: "maneuver-description-distance-border", class: "description__distance-border" })))));
74
- }
75
- static get watchers() { return {
76
- "maneuver": [{
77
- "parseManeuverProp": 0
78
- }],
79
- "translations": [{
80
- "parseTranslationsProp": 0
81
- }]
82
- }; }
83
- };
84
- RouteInstructionsManeuverLegacy.style = routeInstructionsManeuverLegacyCss();
85
-
86
- export { RouteInstructionsManeuverLegacy as mi_route_instructions_maneuver_legacy };
@@ -1,86 +0,0 @@
1
- import { r as registerInstance, h, H as Host } from './index-BZQHyS7V.js';
2
- import { U as UnitSystem } from './unit-system.enum-BwPgAWqL.js';
3
-
4
- const routeInstructionsManeuverCss = () => `:host{display:grid;gap:24px;grid-auto-flow:column;align-items:center;grid-template-columns:24px 1fr;border-top:1px solid #e5e7eb;padding:16px}.icon{width:24px;height:24px}.description{font-size:16px;display:grid;gap:8px;height:-moz-fit-content;height:fit-content}.description__text{margin:0;font-size:16px;word-break:break-all}.description mi-distance{font-size:12px;color:#6b7280}`;
5
-
6
- const RouteInstructionsManeuver = class {
7
- constructor(hostRef) {
8
- registerInstance(this, hostRef);
9
- /**
10
- * Set imperial or metric as default unit system.
11
- * @type {UnitSystem} 'imperial' or 'metric'
12
- */
13
- this.unit = UnitSystem.Metric;
14
- }
15
- parseManeuverProp() {
16
- this.maneuverData = JSON.parse(this.maneuver);
17
- }
18
- parseTranslationsProp() {
19
- this.translationsData = JSON.parse(this.translations);
20
- }
21
- componentWillLoad() {
22
- this.parseManeuverProp();
23
- this.parseTranslationsProp();
24
- }
25
- /**
26
- * Get maneuver name.
27
- *
28
- * @returns {string}
29
- */
30
- getManeuverName(maneuver) {
31
- if (maneuver.includes('straight'))
32
- return 'straight';
33
- if (maneuver.includes('sharp right'))
34
- return 'sharp-right';
35
- if (maneuver.includes('sharp left'))
36
- return 'sharp-left';
37
- if (maneuver.includes('slight right'))
38
- return 'slight-right';
39
- if (maneuver.includes('slight left'))
40
- return 'slight-left';
41
- if (maneuver.includes('right'))
42
- return 'right';
43
- if (maneuver.includes('left'))
44
- return 'left';
45
- if (maneuver.includes('uturn'))
46
- return 'u-turn';
47
- if (maneuver.includes('depart'))
48
- return 'straight';
49
- }
50
- render() {
51
- return (this.maneuverData && this.translationsData ? this.renderManeuver() : null);
52
- }
53
- /**
54
- * Render step.
55
- *
56
- * @returns {JSX.Element}
57
- */
58
- renderManeuver() {
59
- const maneuverStrings = {
60
- 'straight': this.translationsData.continueStraightAhead, // 'Continue straight ahead',
61
- 'left': `${this.translationsData.goLeft} ${this.translationsData.andContinue}`, // 'Go left and continue',
62
- 'sharp-left': `${this.translationsData.goSharpLeft} ${this.translationsData.andContinue}`, // 'Go sharp left and continue',
63
- 'slight-left': `${this.translationsData.goSlightLeft} ${this.translationsData.andContinue}`, // 'Go slight left and continue',
64
- 'right': `${this.translationsData.goRight} ${this.translationsData.andContinue}`, // 'Go right and continue',
65
- 'sharp-right': `${this.translationsData.goSharpRight} ${this.translationsData.andContinue}`, // 'Go sharp right and continue',
66
- 'slight-right': `${this.translationsData.goSlightRight} ${this.translationsData.andContinue}`, // 'Go slight right and continue',
67
- 'u-turn': `${this.translationsData.turnAround} ${this.translationsData.andContinue}`, // 'Turn around and continue'
68
- };
69
- const maneuver = this.getManeuverName(this.maneuverData.maneuver.toLowerCase());
70
- const iconName = `arrow-${maneuver}`;
71
- // Check if the instructions property has a value otherwise fallback to maneuver property
72
- const translatedManeuver = this.maneuverData.instructions ? this.maneuverData.instructions : maneuverStrings[maneuver];
73
- return (h(Host, null, h("div", { class: "icon" }, maneuver ? h("mi-icon", { part: "maneuver-icon", "icon-name": iconName }) : null), h("div", { class: "description" }, h("div", { class: "description__text" }, translatedManeuver), h("mi-distance", { part: "maneuver-description-distance", meters: this.maneuverData.distance.value, unit: this.unit }))));
74
- }
75
- static get watchers() { return {
76
- "maneuver": [{
77
- "parseManeuverProp": 0
78
- }],
79
- "translations": [{
80
- "parseTranslationsProp": 0
81
- }]
82
- }; }
83
- };
84
- RouteInstructionsManeuver.style = routeInstructionsManeuverCss();
85
-
86
- export { RouteInstructionsManeuver as mi_route_instructions_maneuver };