@mapsindoors/map-template 1.93.2 → 1.94.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{GoogleMapsMap-982405ad.mjs → GoogleMapsMap-BqYRaFgc.mjs} +51 -62
- package/dist/MapboxMap-CUYrfLHY.mjs +34732 -0
- package/dist/_commonjsHelpers-ba3f0406.js +21 -0
- package/dist/combo-box-item.entry.js +15 -0
- package/dist/icon-b8d01d6f.js +24 -0
- package/dist/index-7e9696f3.js +1678 -0
- package/dist/index.js +1 -0
- package/dist/loader.js +18 -0
- package/dist/mapsindoors-react.es.js +3 -5
- package/dist/mapsindoors-react.umd.js +197 -582
- package/dist/mapsindoors-webcomponent.es.js +58512 -75790
- package/dist/mi-card_2.entry.js +28 -0
- package/dist/mi-chip.entry.js +22 -0
- package/dist/mi-column.entry.js +28 -0
- package/dist/mi-combo-box.entry.js +416 -0
- package/dist/mi-components.js +18 -0
- package/dist/mi-data-table.entry.js +302 -0
- package/dist/mi-distance_2.entry.js +67 -0
- package/dist/mi-dropdown-item.entry.js +15 -0
- package/dist/mi-dropdown.entry.js +610 -0
- package/dist/mi-floor-selector.entry.js +202 -0
- package/dist/mi-keyboard.entry.js +238 -0
- package/dist/mi-list-item-category.entry.js +48 -0
- package/dist/mi-list-item-location.entry.js +171 -0
- package/dist/mi-list.entry.js +56 -0
- package/dist/mi-location-booking.entry.js +5193 -0
- package/dist/mi-location-info.entry.js +63 -0
- package/dist/mi-map-googlemaps.entry.js +750 -0
- package/dist/mi-map-mapbox.entry.js +467 -0
- package/dist/mi-metric-card.entry.js +48 -0
- package/dist/mi-my-position.entry.js +986 -0
- package/dist/mi-notification.entry.js +127 -0
- package/dist/mi-route-instructions-heading.entry.js +73 -0
- package/dist/mi-route-instructions-maneuver-legacy.entry.js +82 -0
- package/dist/mi-route-instructions-maneuver.entry.js +82 -0
- package/dist/mi-route-instructions-step-legacy.entry.js +308 -0
- package/dist/mi-route-instructions-step.entry.js +321 -0
- package/dist/mi-route-instructions.entry.js +157 -0
- package/dist/mi-scroll-buttons.entry.js +112 -0
- package/dist/mi-search.entry.js +376 -0
- package/dist/mi-share-sms.entry.js +80 -0
- package/dist/mi-step-switcher.entry.js +31 -0
- package/dist/mi-tab-panel.entry.js +25 -0
- package/dist/mi-tab.entry.js +12 -0
- package/dist/mi-tabs.entry.js +47 -0
- package/dist/mi-time.entry.js +57 -0
- package/dist/mi-variables-9a6c8d4d.js +6 -0
- package/dist/polyfills/core-js.js +11 -0
- package/dist/polyfills/css-shim.js +1 -0
- package/dist/polyfills/dom.js +79 -0
- package/dist/polyfills/es5-html-element.js +1 -0
- package/dist/polyfills/index.js +34 -0
- package/dist/polyfills/system.js +6 -0
- package/dist/{reactcomponent-7fbbd9b2.mjs → reactcomponent-DTepe7hB.mjs} +14121 -14626
- package/dist/route-travel-mode.enum-7f4ce9c7.js +9 -0
- package/dist/sort-order.enum-64ce8998.js +552 -0
- package/dist/unit-system.enum-eaefb53e.js +7 -0
- package/dist/utils-ae714467.js +61 -0
- package/package.json +10 -6
- package/dist/MapboxMap-06ef82a3.mjs +0 -37815
- package/dist/_commonjsHelpers-ba3f0406-b96e6d6a.mjs +0 -22
- package/dist/combo-box-item.entry-d35f3d51.mjs +0 -15
- package/dist/icon-b8d01d6f-ddfa2c17.mjs +0 -25
- package/dist/mapsindoors-webcomponent.umd.js +0 -3245
- package/dist/mi-card_2.entry-fc772c35.mjs +0 -26
- package/dist/mi-chip.entry-81c742a1.mjs +0 -19
- package/dist/mi-column.entry-3a083282.mjs +0 -21
- package/dist/mi-combo-box.entry-cae6401a.mjs +0 -263
- package/dist/mi-data-table.entry-d4c3f445.mjs +0 -224
- package/dist/mi-distance_2.entry-a33ed69a.mjs +0 -339
- package/dist/mi-dropdown-item.entry-974d1e4f.mjs +0 -15
- package/dist/mi-dropdown.entry-5317db65.mjs +0 -349
- package/dist/mi-floor-selector.entry-185fbd8b.mjs +0 -115
- package/dist/mi-keyboard.entry-eaf4b9ef.mjs +0 -3103
- package/dist/mi-list-item-category.entry-9c95008c.mjs +0 -39
- package/dist/mi-list-item-location.entry-8b41e8f0.mjs +0 -137
- package/dist/mi-list.entry-1218d29d.mjs +0 -42
- package/dist/mi-location-booking.entry-270aaf5a.mjs +0 -4866
- package/dist/mi-location-info.entry-e4f7fd04.mjs +0 -32
- package/dist/mi-map-googlemaps.entry-81fa28d2.mjs +0 -467
- package/dist/mi-map-mapbox.entry-31821da3.mjs +0 -301
- package/dist/mi-metric-card.entry-40407f04.mjs +0 -29
- package/dist/mi-my-position.entry-bc48fe6e.mjs +0 -703
- package/dist/mi-notification.entry-9a2bc53b.mjs +0 -84
- package/dist/mi-route-instructions-heading.entry-e5b1ff04.mjs +0 -75
- package/dist/mi-route-instructions-maneuver-legacy.entry-2c3d73ab.mjs +0 -76
- package/dist/mi-route-instructions-maneuver.entry-c6f01024.mjs +0 -76
- package/dist/mi-route-instructions-step-legacy.entry-80bcf097.mjs +0 -202
- package/dist/mi-route-instructions-step.entry-db802e13.mjs +0 -231
- package/dist/mi-route-instructions.entry-62416e29.mjs +0 -143
- package/dist/mi-scroll-buttons.entry-92b62b21.mjs +0 -83
- package/dist/mi-search.entry-87f1e64a.mjs +0 -251
- package/dist/mi-share-sms.entry-b6725edb.mjs +0 -56
- package/dist/mi-step-switcher.entry-f8f6c040.mjs +0 -27
- package/dist/mi-tab-panel.entry-a89213c2.mjs +0 -22
- package/dist/mi-tab.entry-a2fb3f8c.mjs +0 -14
- package/dist/mi-tabs.entry-cd638ea7.mjs +0 -37
- package/dist/mi-time.entry-0b02870d.mjs +0 -46
- package/dist/mi-variables-9a6c8d4d-e06eec88.mjs +0 -8
- package/dist/route-travel-mode.enum-7f4ce9c7-a9c95a83.mjs +0 -8
- package/dist/sort-order.enum-64ce8998-b75ac596.mjs +0 -318
- package/dist/unit-system.enum-eaefb53e-0f424da4.mjs +0 -8
- package/dist/utils-ae714467-b07fc3be.mjs +0 -37
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
import { r as registerInstance, f as forceUpdate, h, H as Host, g as getElement } from './index-7e9696f3.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
|
+
* List of currently displayed notifications.
|
|
29
|
+
*
|
|
30
|
+
* @type {NotificationMessage[]}
|
|
31
|
+
*/
|
|
32
|
+
this.notifications = [];
|
|
33
|
+
/**
|
|
34
|
+
* Used for setting a unique identifier for each notification.
|
|
35
|
+
*
|
|
36
|
+
* @type {number}
|
|
37
|
+
*/
|
|
38
|
+
this.notificationId = 0;
|
|
39
|
+
this.position = NotificationPosition.BOTTOM_RIGHT;
|
|
40
|
+
this.duration = 3;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Show a notification.
|
|
44
|
+
*
|
|
45
|
+
* @param {string} message - Message to display.
|
|
46
|
+
* @param {string} [type='none'] - Type of notification. Available types: 'info', 'warning', 'success', 'error' and 'none'.
|
|
47
|
+
* @param {boolean} [sticky=false] - Set message as sticky to prevent it from disappearing.
|
|
48
|
+
* @returns {Promise<void>}
|
|
49
|
+
*/
|
|
50
|
+
async push(message, type = 'none', sticky = false) {
|
|
51
|
+
if (typeof message !== 'string' || message.length < 1) {
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
54
|
+
// Check validity of type
|
|
55
|
+
const typeExist = Object.values(NotificationType)
|
|
56
|
+
.some((notificationType) => notificationType === type);
|
|
57
|
+
if (!typeExist) {
|
|
58
|
+
// eslint-disable-next-line no-console
|
|
59
|
+
console.error('Invalid notification type');
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
const notificationMessage = {
|
|
63
|
+
id: this.notificationId,
|
|
64
|
+
message: message,
|
|
65
|
+
sticky: sticky,
|
|
66
|
+
type: type,
|
|
67
|
+
};
|
|
68
|
+
if (sticky === false) {
|
|
69
|
+
notificationMessage.timer = window.setTimeout(() => this.dismiss(notificationMessage.id), (this.duration * 1000));
|
|
70
|
+
}
|
|
71
|
+
this.notificationId++;
|
|
72
|
+
this.notifications.push(notificationMessage);
|
|
73
|
+
forceUpdate(this.hostElement);
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Clear all notifications.
|
|
77
|
+
*
|
|
78
|
+
* @returns {Promise<void>}
|
|
79
|
+
*/
|
|
80
|
+
async clearAll() {
|
|
81
|
+
this.notifications = [];
|
|
82
|
+
forceUpdate(this.hostElement);
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Dismiss a single notification.
|
|
86
|
+
*
|
|
87
|
+
* @param {number} id
|
|
88
|
+
*/
|
|
89
|
+
dismiss(id) {
|
|
90
|
+
this.notifications = this.notifications.filter((notification) => notification.id !== id);
|
|
91
|
+
forceUpdate(this.hostElement);
|
|
92
|
+
}
|
|
93
|
+
render() {
|
|
94
|
+
return (h(Host, { class: this.position }, this.notifications.map((notification) => this.renderNotification(notification))));
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Get JSX for notification.
|
|
98
|
+
*
|
|
99
|
+
* @param {NotificationMessage} { id, message }
|
|
100
|
+
* @returns {JSX.Element}
|
|
101
|
+
*/
|
|
102
|
+
renderNotification({ id, message, type }) {
|
|
103
|
+
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" })))));
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* Get JSX for type-icon.
|
|
107
|
+
*
|
|
108
|
+
* @param {NotificationType} type
|
|
109
|
+
* @returns {JSX.Element}
|
|
110
|
+
*/
|
|
111
|
+
renderIcon(type) {
|
|
112
|
+
if (type === NotificationType.Error) {
|
|
113
|
+
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" }))));
|
|
114
|
+
}
|
|
115
|
+
else if (type === NotificationType.Success) {
|
|
116
|
+
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" }))));
|
|
117
|
+
}
|
|
118
|
+
else if (type === NotificationType.Warning) {
|
|
119
|
+
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" }))));
|
|
120
|
+
}
|
|
121
|
+
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" }))));
|
|
122
|
+
}
|
|
123
|
+
get hostElement() { return getElement(this); }
|
|
124
|
+
};
|
|
125
|
+
Notification.style = notificationCss;
|
|
126
|
+
|
|
127
|
+
export { Notification as mi_notification };
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { r as registerInstance, h } from './index-7e9696f3.js';
|
|
2
|
+
import { R as RouteTravelMode } from './route-travel-mode.enum-7f4ce9c7.js';
|
|
3
|
+
import { U as UnitSystem } from './unit-system.enum-eaefb53e.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
|
+
this.originName = undefined;
|
|
11
|
+
this.destinationName = undefined;
|
|
12
|
+
this.totalTravelTime = undefined;
|
|
13
|
+
this.totalWalkingDistance = undefined;
|
|
14
|
+
this.travelMode = RouteTravelMode.Walking;
|
|
15
|
+
this.unit = UnitSystem.Metric;
|
|
16
|
+
this.translations = {
|
|
17
|
+
from: 'From',
|
|
18
|
+
to: 'To',
|
|
19
|
+
avoidStairs: 'Avoid stairs',
|
|
20
|
+
walk: 'Walk',
|
|
21
|
+
walking: 'Walking',
|
|
22
|
+
bike: 'Bike',
|
|
23
|
+
bicycling: 'Bicycling',
|
|
24
|
+
transit: 'Transit',
|
|
25
|
+
car: 'Car',
|
|
26
|
+
driving: 'Driving'
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Get travel mode as a string. Eg. "Walking", "Driving", "Transit", "Bicycling".
|
|
31
|
+
*
|
|
32
|
+
* @returns {string}
|
|
33
|
+
*/
|
|
34
|
+
getTravelModeString() {
|
|
35
|
+
switch (this.travelMode) {
|
|
36
|
+
case RouteTravelMode.Walking: return this.translations.walk;
|
|
37
|
+
case RouteTravelMode.Driving: return this.translations.car;
|
|
38
|
+
case RouteTravelMode.Transit: return this.translations.transit;
|
|
39
|
+
case RouteTravelMode.Bicycling: return this.translations.bike;
|
|
40
|
+
default: return this.translations.walk;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Get icon name for travel mode.
|
|
45
|
+
*
|
|
46
|
+
* @returns {string}
|
|
47
|
+
*/
|
|
48
|
+
getTravelModeIconName() {
|
|
49
|
+
switch (this.travelMode) {
|
|
50
|
+
case RouteTravelMode.Walking: return 'walk';
|
|
51
|
+
case RouteTravelMode.Driving: return 'car';
|
|
52
|
+
case RouteTravelMode.Transit: return 'transit';
|
|
53
|
+
case RouteTravelMode.Bicycling: return 'bike';
|
|
54
|
+
default: return 'walk';
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
render() {
|
|
58
|
+
return (h("div", { class: "directions" }, this.originName && this.destinationName ? this.renderWayPoints() : null, h("div", { class: "directions-details" }, this.totalTravelTime >= 0 || this.totalWalkingDistance >= 0 ?
|
|
59
|
+
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) :
|
|
60
|
+
null, h("a", { href: "#", class: "directions-details-travel-mode-selector" }, this.getTravelModeString(), h("mi-icon", { "icon-name": this.getTravelModeIconName() })))));
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Render direction way points.
|
|
64
|
+
*
|
|
65
|
+
* @returns {JSX.Element}
|
|
66
|
+
*/
|
|
67
|
+
renderWayPoints() {
|
|
68
|
+
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))));
|
|
69
|
+
}
|
|
70
|
+
};
|
|
71
|
+
RouteInstructionsHeading.style = routeInstructionsHeadingCss;
|
|
72
|
+
|
|
73
|
+
export { RouteInstructionsHeading as mi_route_instructions_heading };
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { r as registerInstance, h, H as Host } from './index-7e9696f3.js';
|
|
2
|
+
import { U as UnitSystem } from './unit-system.enum-eaefb53e.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
|
+
this.maneuver = undefined;
|
|
10
|
+
this.maneuverData = undefined;
|
|
11
|
+
this.translations = undefined;
|
|
12
|
+
this.translationsData = undefined;
|
|
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,
|
|
61
|
+
'left': `${this.translationsData.goLeft} ${this.translationsData.andContinue}`,
|
|
62
|
+
'sharp-left': `${this.translationsData.goSharpLeft} ${this.translationsData.andContinue}`,
|
|
63
|
+
'slight-left': `${this.translationsData.goSlightLeft} ${this.translationsData.andContinue}`,
|
|
64
|
+
'right': `${this.translationsData.goRight} ${this.translationsData.andContinue}`,
|
|
65
|
+
'sharp-right': `${this.translationsData.goSharpRight} ${this.translationsData.andContinue}`,
|
|
66
|
+
'slight-right': `${this.translationsData.goSlightRight} ${this.translationsData.andContinue}`,
|
|
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": ["parseManeuverProp"],
|
|
77
|
+
"translations": ["parseTranslationsProp"]
|
|
78
|
+
}; }
|
|
79
|
+
};
|
|
80
|
+
RouteInstructionsManeuverLegacy.style = routeInstructionsManeuverLegacyCss;
|
|
81
|
+
|
|
82
|
+
export { RouteInstructionsManeuverLegacy as mi_route_instructions_maneuver_legacy };
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { r as registerInstance, h, H as Host } from './index-7e9696f3.js';
|
|
2
|
+
import { U as UnitSystem } from './unit-system.enum-eaefb53e.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
|
+
this.maneuver = undefined;
|
|
10
|
+
this.maneuverData = undefined;
|
|
11
|
+
this.translations = undefined;
|
|
12
|
+
this.translationsData = undefined;
|
|
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,
|
|
61
|
+
'left': `${this.translationsData.goLeft} ${this.translationsData.andContinue}`,
|
|
62
|
+
'sharp-left': `${this.translationsData.goSharpLeft} ${this.translationsData.andContinue}`,
|
|
63
|
+
'slight-left': `${this.translationsData.goSlightLeft} ${this.translationsData.andContinue}`,
|
|
64
|
+
'right': `${this.translationsData.goRight} ${this.translationsData.andContinue}`,
|
|
65
|
+
'sharp-right': `${this.translationsData.goSharpRight} ${this.translationsData.andContinue}`,
|
|
66
|
+
'slight-right': `${this.translationsData.goSlightRight} ${this.translationsData.andContinue}`,
|
|
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": ["parseManeuverProp"],
|
|
77
|
+
"translations": ["parseTranslationsProp"]
|
|
78
|
+
}; }
|
|
79
|
+
};
|
|
80
|
+
RouteInstructionsManeuver.style = routeInstructionsManeuverCss;
|
|
81
|
+
|
|
82
|
+
export { RouteInstructionsManeuver as mi_route_instructions_maneuver };
|