@mapsindoors/map-template 1.16.0 → 1.17.1

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 (78) hide show
  1. package/README.md +4 -4
  2. package/dist/{combo-box-item.entry-48605f24.mjs → combo-box-item.entry-3bdf398c.mjs} +1 -1
  3. package/dist/mapsindoors-react.es.js +2 -2
  4. package/dist/mapsindoors-react.umd.js +58 -58
  5. package/dist/mapsindoors-webcomponent.es.js +49608 -3
  6. package/dist/mapsindoors-webcomponent.umd.js +82 -82
  7. package/dist/{mi-card_2.entry-c2d6e4cb.mjs → mi-card_2.entry-40da4c22.mjs} +1 -1
  8. package/dist/{mi-chip.entry-220d7527.mjs → mi-chip.entry-8361080b.mjs} +1 -1
  9. package/dist/{mi-column.entry-07e53d71.mjs → mi-column.entry-1a4d1bd7.mjs} +1 -1
  10. package/dist/{mi-combo-box.entry-4633c7be.mjs → mi-combo-box.entry-3512ddbe.mjs} +1 -1
  11. package/dist/{mi-data-table.entry-07472817.mjs → mi-data-table.entry-3220f2be.mjs} +1 -1
  12. package/dist/{mi-distance_2.entry-e986eb84.mjs → mi-distance_2.entry-dcbb24c5.mjs} +1 -1
  13. package/dist/{mi-dropdown-item.entry-b9ca8157.mjs → mi-dropdown-item.entry-280ba4ce.mjs} +1 -1
  14. package/dist/{mi-dropdown.entry-08e0244a.mjs → mi-dropdown.entry-6c8f21d6.mjs} +1 -1
  15. package/dist/{mi-floor-selector.entry-b5ab3ede.mjs → mi-floor-selector.entry-5305d533.mjs} +5 -3
  16. package/dist/{mi-keyboard.entry-3ab79e44.mjs → mi-keyboard.entry-fcd58e0d.mjs} +1 -1
  17. package/dist/{mi-list-item-category.entry-99c79322.mjs → mi-list-item-category.entry-01d06afa.mjs} +1 -1
  18. package/dist/{mi-list-item-location.entry-e4973248.mjs → mi-list-item-location.entry-71cad82b.mjs} +9 -9
  19. package/dist/{mi-list.entry-c3fa0533.mjs → mi-list.entry-6b662039.mjs} +1 -1
  20. package/dist/{mi-location-booking.entry-e9fb4056.mjs → mi-location-booking.entry-3ede4961.mjs} +1 -1
  21. package/dist/{mi-location-info.entry-281b75cd.mjs → mi-location-info.entry-bc94c6aa.mjs} +1 -1
  22. package/dist/{mi-map-googlemaps.entry-2cc3d7bd.mjs → mi-map-googlemaps.entry-92d13571.mjs} +1 -1
  23. package/dist/{mi-map-mapbox.entry-c19c1c01.mjs → mi-map-mapbox.entry-793e7606.mjs} +1 -1
  24. package/dist/{mi-metric-card.entry-0333ee8a.mjs → mi-metric-card.entry-517557b8.mjs} +1 -1
  25. package/dist/{mi-my-position.entry-25e1230b.mjs → mi-my-position.entry-f10f3919.mjs} +1 -1
  26. package/dist/{mi-notification.entry-eb6fb735.mjs → mi-notification.entry-cc765c3c.mjs} +1 -1
  27. package/dist/{mi-route-instructions-heading.entry-bf1207a4.mjs → mi-route-instructions-heading.entry-4d3417ae.mjs} +1 -1
  28. package/dist/{mi-route-instructions-maneuver-legacy.entry-176db576.mjs → mi-route-instructions-maneuver-legacy.entry-ff7e6758.mjs} +1 -1
  29. package/dist/{mi-route-instructions-maneuver.entry-b34bfa44.mjs → mi-route-instructions-maneuver.entry-5d1bf1ef.mjs} +1 -1
  30. package/dist/{mi-route-instructions-step-legacy.entry-e4e2120f.mjs → mi-route-instructions-step-legacy.entry-9c75f214.mjs} +1 -1
  31. package/dist/{mi-route-instructions-step.entry-f780f5aa.mjs → mi-route-instructions-step.entry-b5588bd5.mjs} +1 -1
  32. package/dist/{mi-route-instructions.entry-b29c7a01.mjs → mi-route-instructions.entry-71ff4605.mjs} +1 -1
  33. package/dist/{mi-scroll-buttons.entry-8f20f782.mjs → mi-scroll-buttons.entry-312b45dd.mjs} +1 -1
  34. package/dist/{mi-search.entry-c699085d.mjs → mi-search.entry-a7b3ccc6.mjs} +1 -1
  35. package/dist/{mi-share-sms.entry-1e719dbf.mjs → mi-share-sms.entry-89c98479.mjs} +1 -1
  36. package/dist/{mi-step-switcher.entry-929d9c22.mjs → mi-step-switcher.entry-a5889eaf.mjs} +1 -1
  37. package/dist/{mi-tab-panel.entry-d60faca8.mjs → mi-tab-panel.entry-065b3497.mjs} +1 -1
  38. package/dist/{mi-tab.entry-be23d7c0.mjs → mi-tab.entry-44ba1f0f.mjs} +1 -1
  39. package/dist/{mi-tabs.entry-8c7a7879.mjs → mi-tabs.entry-9b0f103f.mjs} +1 -1
  40. package/dist/{mi-time.entry-646cf512.mjs → mi-time.entry-591fe0bd.mjs} +1 -1
  41. package/dist/{reactcomponent-f1212b63.mjs → reactcomponent-2fa842c6.mjs} +11114 -10904
  42. package/package.json +4 -1
  43. package/dist/combo-box-item.entry-f9f13752.mjs +0 -12
  44. package/dist/mi-card_2.entry-1a72c651.mjs +0 -23
  45. package/dist/mi-chip.entry-f647e52f.mjs +0 -16
  46. package/dist/mi-column.entry-4ffe12c8.mjs +0 -18
  47. package/dist/mi-combo-box.entry-e13b79dd.mjs +0 -260
  48. package/dist/mi-data-table.entry-69d09420.mjs +0 -213
  49. package/dist/mi-distance_2.entry-4c4448a4.mjs +0 -54
  50. package/dist/mi-dropdown-item.entry-c2a28628.mjs +0 -12
  51. package/dist/mi-dropdown.entry-1a63efa5.mjs +0 -296
  52. package/dist/mi-floor-selector.entry-688f9b1a.mjs +0 -110
  53. package/dist/mi-keyboard.entry-4dd75752.mjs +0 -2960
  54. package/dist/mi-list-item-category.entry-fa0d749e.mjs +0 -36
  55. package/dist/mi-list-item-location.entry-8ce424e5.mjs +0 -134
  56. package/dist/mi-list.entry-79bbeb09.mjs +0 -39
  57. package/dist/mi-location-booking.entry-3ea227d8.mjs +0 -4863
  58. package/dist/mi-location-info.entry-da932325.mjs +0 -29
  59. package/dist/mi-map-googlemaps.entry-ed869826.mjs +0 -396
  60. package/dist/mi-map-mapbox.entry-64063ac6.mjs +0 -298
  61. package/dist/mi-metric-card.entry-c7e0ead2.mjs +0 -26
  62. package/dist/mi-my-position.entry-39daf02a.mjs +0 -1396
  63. package/dist/mi-notification.entry-ebcbc0cd.mjs +0 -81
  64. package/dist/mi-route-instructions-heading.entry-343f11db.mjs +0 -72
  65. package/dist/mi-route-instructions-maneuver-legacy.entry-85fdbc9b.mjs +0 -73
  66. package/dist/mi-route-instructions-maneuver.entry-e9c4bf8d.mjs +0 -73
  67. package/dist/mi-route-instructions-step-legacy.entry-0f55fb47.mjs +0 -199
  68. package/dist/mi-route-instructions-step.entry-5f4cd9de.mjs +0 -234
  69. package/dist/mi-route-instructions.entry-ece4fa37.mjs +0 -140
  70. package/dist/mi-scroll-buttons.entry-9f426250.mjs +0 -46
  71. package/dist/mi-search.entry-81d35326.mjs +0 -240
  72. package/dist/mi-share-sms.entry-994a87b1.mjs +0 -53
  73. package/dist/mi-step-switcher.entry-b53eb2bc.mjs +0 -24
  74. package/dist/mi-tab-panel.entry-464dc246.mjs +0 -19
  75. package/dist/mi-tab.entry-4da5bba3.mjs +0 -11
  76. package/dist/mi-tabs.entry-cbe62a06.mjs +0 -34
  77. package/dist/mi-time.entry-7b94fad6.mjs +0 -43
  78. package/dist/webcomponent-e45720b9.mjs +0 -36539
@@ -1,81 +0,0 @@
1
- import { r as c, f as r, h as i, H as f, g as d } from "./webcomponent-e45720b9.mjs";
2
- var l;
3
- (function(t) {
4
- t.TOP_LEFT = "top-left", t.TOP_CENTER = "top-center", t.TOP_RIGHT = "top-right", t.BOTTOM_CENTER = "bottom-center", t.BOTTOM_LEFT = "bottom-left", t.BOTTOM_RIGHT = "bottom-right";
5
- })(l || (l = {}));
6
- var n;
7
- (function(t) {
8
- t.Error = "error", t.Info = "info", t.Success = "success", t.Warning = "warning", t.None = "none";
9
- })(n || (n = {}));
10
- const h = ':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}', g = class {
11
- constructor(t) {
12
- c(this, t), this.notifications = [], this.notificationId = 0, this.position = l.BOTTOM_RIGHT, this.duration = 3;
13
- }
14
- /**
15
- * Show a notification.
16
- *
17
- * @param {string} message - Message to display.
18
- * @param {string} [type='none'] - Type of notification. Available types: 'info', 'warning', 'success', 'error' and 'none'.
19
- * @param {boolean} [sticky=false] - Set message as sticky to prevent it from disappearing.
20
- * @returns {Promise<void>}
21
- */
22
- async push(t, e = "none", o = !1) {
23
- if (typeof t != "string" || t.length < 1)
24
- return;
25
- if (!Object.values(n).some((a) => a === e)) {
26
- console.error("Invalid notification type");
27
- return;
28
- }
29
- const s = {
30
- id: this.notificationId,
31
- message: t,
32
- sticky: o,
33
- type: e
34
- };
35
- o === !1 && (s.timer = window.setTimeout(() => this.dismiss(s.id), this.duration * 1e3)), this.notificationId++, this.notifications.push(s), r(this.hostElement);
36
- }
37
- /**
38
- * Clear all notifications.
39
- *
40
- * @returns {Promise<void>}
41
- */
42
- async clearAll() {
43
- this.notifications = [], r(this.hostElement);
44
- }
45
- /**
46
- * Dismiss a single notification.
47
- *
48
- * @param {number} id
49
- */
50
- dismiss(t) {
51
- this.notifications = this.notifications.filter((e) => e.id !== t), r(this.hostElement);
52
- }
53
- render() {
54
- return i(f, { class: this.position }, this.notifications.map((t) => this.renderNotification(t)));
55
- }
56
- /**
57
- * Get JSX for notification.
58
- *
59
- * @param {NotificationMessage} { id, message }
60
- * @returns {JSX.Element}
61
- */
62
- renderNotification({ id: t, message: e, type: o }) {
63
- return i("div", { class: "notification", role: "alert" }, o && o !== "none" ? this.renderIcon(o) : null, i("p", { class: "label" }, e), i("button", { type: "button", "aria-label": "Dismiss notification", class: "btn", onClick: () => this.dismiss(t) }, i("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" }, i("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" }))));
64
- }
65
- /**
66
- * Get JSX for type-icon.
67
- *
68
- * @param {NotificationType} type
69
- * @returns {JSX.Element}
70
- */
71
- renderIcon(t) {
72
- return t === n.Error ? i("div", { class: "icon icon-type--error" }, i("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" }, i("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" }))) : t === n.Success ? i("div", { class: "icon icon-type--success" }, i("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" }, i("path", { d: "M5.99997 11.17L1.82997 7L0.409973 8.41L5.99997 14L18 2L16.59 0.59L5.99997 11.17Z", fill: "#FCFCFC" }))) : t === n.Warning ? i("div", { class: "icon icon-type--warning" }, i("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" }, i("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M22 19L11 0L0 19H22ZM10 16V14H12V16H10ZM10 12H12V8H10V12Z", fill: "#FCFCFC" }))) : i("div", { class: "icon icon-type--info" }, i("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" }, i("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" })));
73
- }
74
- get hostElement() {
75
- return d(this);
76
- }
77
- };
78
- g.style = h;
79
- export {
80
- g as mi_notification
81
- };
@@ -1,72 +0,0 @@
1
- import { r as s, h as i } from "./webcomponent-e45720b9.mjs";
2
- import { R as t } from "./route-travel-mode.enum-7f4ce9c7-a9c95a83.mjs";
3
- import { U as n } from "./unit-system.enum-eaefb53e-0f424da4.mjs";
4
- const a = '.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}', r = class {
5
- constructor(e) {
6
- s(this, e), this.originName = void 0, this.destinationName = void 0, this.totalTravelTime = void 0, this.totalWalkingDistance = void 0, this.travelMode = t.Walking, this.unit = n.Metric, this.translations = {
7
- from: "From",
8
- to: "To",
9
- avoidStairs: "Avoid stairs",
10
- walk: "Walk",
11
- walking: "Walking",
12
- bike: "Bike",
13
- bicycling: "Bicycling",
14
- transit: "Transit",
15
- car: "Car",
16
- driving: "Driving"
17
- };
18
- }
19
- /**
20
- * Get travel mode as a string. Eg. "Walking", "Driving", "Transit", "Bicycling".
21
- *
22
- * @returns {string}
23
- */
24
- getTravelModeString() {
25
- switch (this.travelMode) {
26
- case t.Walking:
27
- return this.translations.walk;
28
- case t.Driving:
29
- return this.translations.car;
30
- case t.Transit:
31
- return this.translations.transit;
32
- case t.Bicycling:
33
- return this.translations.bike;
34
- default:
35
- return this.translations.walk;
36
- }
37
- }
38
- /**
39
- * Get icon name for travel mode.
40
- *
41
- * @returns {string}
42
- */
43
- getTravelModeIconName() {
44
- switch (this.travelMode) {
45
- case t.Walking:
46
- return "walk";
47
- case t.Driving:
48
- return "car";
49
- case t.Transit:
50
- return "transit";
51
- case t.Bicycling:
52
- return "bike";
53
- default:
54
- return "walk";
55
- }
56
- }
57
- render() {
58
- return i("div", { class: "directions" }, this.originName && this.destinationName ? this.renderWayPoints() : null, i("div", { class: "directions-details" }, this.totalTravelTime >= 0 || this.totalWalkingDistance >= 0 ? i("div", { class: "directions-details-numbers" }, this.totalTravelTime >= 0 ? i("div", null, i("mi-time", { seconds: this.totalTravelTime })) : null, this.totalWalkingDistance >= 0 ? i("div", { class: "directions-details-numbers-distance" }, i("mi-distance", { meters: this.totalWalkingDistance }), " ", this.translations.walking.toLowerCase()) : null) : null, i("a", { href: "#", class: "directions-details-travel-mode-selector" }, this.getTravelModeString(), i("mi-icon", { "icon-name": this.getTravelModeIconName() }))));
59
- }
60
- /**
61
- * Render direction way points.
62
- *
63
- * @returns {JSX.Element}
64
- */
65
- renderWayPoints() {
66
- return i("div", { class: "directions-way-points" }, i("span", null, this.translations.to, " ", this.destinationName), i("span", null, this.translations.from, " ", i("a", { href: "#" }, this.originName)));
67
- }
68
- };
69
- r.style = a;
70
- export {
71
- r as mi_route_instructions_heading
72
- };
@@ -1,73 +0,0 @@
1
- import { r as s, h as i, H as r } from "./webcomponent-e45720b9.mjs";
2
- import { U as o } from "./unit-system.enum-eaefb53e-0f424da4.mjs";
3
- const l = ':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}', h = class {
4
- constructor(t) {
5
- s(this, t), this.maneuver = void 0, this.maneuverData = void 0, this.translations = void 0, this.translationsData = void 0, this.unit = o.Metric;
6
- }
7
- parseManeuverProp() {
8
- this.maneuverData = JSON.parse(this.maneuver);
9
- }
10
- parseTranslationsProp() {
11
- this.translationsData = JSON.parse(this.translations);
12
- }
13
- componentWillLoad() {
14
- this.parseManeuverProp(), this.parseTranslationsProp();
15
- }
16
- /**
17
- * Get maneuver name.
18
- *
19
- * @returns {string}
20
- */
21
- getManeuverName(t) {
22
- if (t.includes("straight"))
23
- return "straight";
24
- if (t.includes("sharp right"))
25
- return "sharp-right";
26
- if (t.includes("sharp left"))
27
- return "sharp-left";
28
- if (t.includes("slight right"))
29
- return "slight-right";
30
- if (t.includes("slight left"))
31
- return "slight-left";
32
- if (t.includes("right"))
33
- return "right";
34
- if (t.includes("left"))
35
- return "left";
36
- if (t.includes("uturn"))
37
- return "u-turn";
38
- if (t.includes("depart"))
39
- return "straight";
40
- }
41
- render() {
42
- return this.maneuverData && this.translationsData ? this.renderManeuver() : null;
43
- }
44
- /**
45
- * Render step.
46
- *
47
- * @returns {JSX.Element}
48
- */
49
- renderManeuver() {
50
- const t = {
51
- straight: this.translationsData.continueStraightAhead,
52
- left: `${this.translationsData.goLeft} ${this.translationsData.andContinue}`,
53
- "sharp-left": `${this.translationsData.goSharpLeft} ${this.translationsData.andContinue}`,
54
- "slight-left": `${this.translationsData.goSlightLeft} ${this.translationsData.andContinue}`,
55
- right: `${this.translationsData.goRight} ${this.translationsData.andContinue}`,
56
- "sharp-right": `${this.translationsData.goSharpRight} ${this.translationsData.andContinue}`,
57
- "slight-right": `${this.translationsData.goSlightRight} ${this.translationsData.andContinue}`,
58
- "u-turn": `${this.translationsData.turnAround} ${this.translationsData.andContinue}`
59
- // 'Turn around and continue'
60
- }, a = this.getManeuverName(this.maneuverData.maneuver.toLowerCase()), n = `arrow-${a}`, e = this.maneuverData.instructions ? this.maneuverData.instructions : t[a];
61
- return i(r, null, i("div", { class: "icon" }, a ? i("mi-icon", { part: "maneuver-icon", "icon-name": n }) : null), i("div", { class: "description" }, i("p", { part: "maneuver-description" }, e), i("div", { class: "description__distance" }, i("mi-distance", { part: "maneuver-description-distance", meters: this.maneuverData.distance.value, unit: this.unit }), i("span", { part: "maneuver-description-distance-border", class: "description__distance-border" }))));
62
- }
63
- static get watchers() {
64
- return {
65
- maneuver: ["parseManeuverProp"],
66
- translations: ["parseTranslationsProp"]
67
- };
68
- }
69
- };
70
- h.style = l;
71
- export {
72
- h as mi_route_instructions_maneuver_legacy
73
- };
@@ -1,73 +0,0 @@
1
- import { r, h as n, H as e } from "./webcomponent-e45720b9.mjs";
2
- import { U as o } from "./unit-system.enum-eaefb53e-0f424da4.mjs";
3
- const h = ":host{display:grid;gap:24px;grid-auto-flow:column;align-items:center;grid-template-columns:24px 1fr}.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}", u = class {
4
- constructor(t) {
5
- r(this, t), this.maneuver = void 0, this.maneuverData = void 0, this.translations = void 0, this.translationsData = void 0, this.unit = o.Metric;
6
- }
7
- parseManeuverProp() {
8
- this.maneuverData = JSON.parse(this.maneuver);
9
- }
10
- parseTranslationsProp() {
11
- this.translationsData = JSON.parse(this.translations);
12
- }
13
- componentWillLoad() {
14
- this.parseManeuverProp(), this.parseTranslationsProp();
15
- }
16
- /**
17
- * Get maneuver name.
18
- *
19
- * @returns {string}
20
- */
21
- getManeuverName(t) {
22
- if (t.includes("straight"))
23
- return "straight";
24
- if (t.includes("sharp right"))
25
- return "sharp-right";
26
- if (t.includes("sharp left"))
27
- return "sharp-left";
28
- if (t.includes("slight right"))
29
- return "slight-right";
30
- if (t.includes("slight left"))
31
- return "slight-left";
32
- if (t.includes("right"))
33
- return "right";
34
- if (t.includes("left"))
35
- return "left";
36
- if (t.includes("uturn"))
37
- return "u-turn";
38
- if (t.includes("depart"))
39
- return "straight";
40
- }
41
- render() {
42
- return this.maneuverData && this.translationsData ? this.renderManeuver() : null;
43
- }
44
- /**
45
- * Render step.
46
- *
47
- * @returns {JSX.Element}
48
- */
49
- renderManeuver() {
50
- const t = {
51
- straight: this.translationsData.continueStraightAhead,
52
- left: `${this.translationsData.goLeft} ${this.translationsData.andContinue}`,
53
- "sharp-left": `${this.translationsData.goSharpLeft} ${this.translationsData.andContinue}`,
54
- "slight-left": `${this.translationsData.goSlightLeft} ${this.translationsData.andContinue}`,
55
- right: `${this.translationsData.goRight} ${this.translationsData.andContinue}`,
56
- "sharp-right": `${this.translationsData.goSharpRight} ${this.translationsData.andContinue}`,
57
- "slight-right": `${this.translationsData.goSlightRight} ${this.translationsData.andContinue}`,
58
- "u-turn": `${this.translationsData.turnAround} ${this.translationsData.andContinue}`
59
- // 'Turn around and continue'
60
- }, a = this.getManeuverName(this.maneuverData.maneuver.toLowerCase()), i = `arrow-${a}`, s = this.maneuverData.instructions ? this.maneuverData.instructions : t[a];
61
- return n(e, null, n("div", { class: "icon" }, a ? n("mi-icon", { part: "maneuver-icon", "icon-name": i }) : null), n("div", { class: "description" }, n("div", { class: "description__text" }, s), n("mi-distance", { part: "maneuver-description-distance", meters: this.maneuverData.distance.value, unit: this.unit })));
62
- }
63
- static get watchers() {
64
- return {
65
- maneuver: ["parseManeuverProp"],
66
- translations: ["parseTranslationsProp"]
67
- };
68
- }
69
- };
70
- u.style = h;
71
- export {
72
- u as mi_route_instructions_maneuver
73
- };
@@ -1,199 +0,0 @@
1
- import { r as n, c as r, h as e } from "./webcomponent-e45720b9.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-legacy", {
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
- };