@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.
Files changed (103) hide show
  1. package/dist/{GoogleMapsMap-982405ad.mjs → GoogleMapsMap-BqYRaFgc.mjs} +51 -62
  2. package/dist/MapboxMap-CUYrfLHY.mjs +34732 -0
  3. package/dist/_commonjsHelpers-ba3f0406.js +21 -0
  4. package/dist/combo-box-item.entry.js +15 -0
  5. package/dist/icon-b8d01d6f.js +24 -0
  6. package/dist/index-7e9696f3.js +1678 -0
  7. package/dist/index.js +1 -0
  8. package/dist/loader.js +18 -0
  9. package/dist/mapsindoors-react.es.js +3 -5
  10. package/dist/mapsindoors-react.umd.js +197 -582
  11. package/dist/mapsindoors-webcomponent.es.js +58512 -75790
  12. package/dist/mi-card_2.entry.js +28 -0
  13. package/dist/mi-chip.entry.js +22 -0
  14. package/dist/mi-column.entry.js +28 -0
  15. package/dist/mi-combo-box.entry.js +416 -0
  16. package/dist/mi-components.js +18 -0
  17. package/dist/mi-data-table.entry.js +302 -0
  18. package/dist/mi-distance_2.entry.js +67 -0
  19. package/dist/mi-dropdown-item.entry.js +15 -0
  20. package/dist/mi-dropdown.entry.js +610 -0
  21. package/dist/mi-floor-selector.entry.js +202 -0
  22. package/dist/mi-keyboard.entry.js +238 -0
  23. package/dist/mi-list-item-category.entry.js +48 -0
  24. package/dist/mi-list-item-location.entry.js +171 -0
  25. package/dist/mi-list.entry.js +56 -0
  26. package/dist/mi-location-booking.entry.js +5193 -0
  27. package/dist/mi-location-info.entry.js +63 -0
  28. package/dist/mi-map-googlemaps.entry.js +750 -0
  29. package/dist/mi-map-mapbox.entry.js +467 -0
  30. package/dist/mi-metric-card.entry.js +48 -0
  31. package/dist/mi-my-position.entry.js +986 -0
  32. package/dist/mi-notification.entry.js +127 -0
  33. package/dist/mi-route-instructions-heading.entry.js +73 -0
  34. package/dist/mi-route-instructions-maneuver-legacy.entry.js +82 -0
  35. package/dist/mi-route-instructions-maneuver.entry.js +82 -0
  36. package/dist/mi-route-instructions-step-legacy.entry.js +308 -0
  37. package/dist/mi-route-instructions-step.entry.js +321 -0
  38. package/dist/mi-route-instructions.entry.js +157 -0
  39. package/dist/mi-scroll-buttons.entry.js +112 -0
  40. package/dist/mi-search.entry.js +376 -0
  41. package/dist/mi-share-sms.entry.js +80 -0
  42. package/dist/mi-step-switcher.entry.js +31 -0
  43. package/dist/mi-tab-panel.entry.js +25 -0
  44. package/dist/mi-tab.entry.js +12 -0
  45. package/dist/mi-tabs.entry.js +47 -0
  46. package/dist/mi-time.entry.js +57 -0
  47. package/dist/mi-variables-9a6c8d4d.js +6 -0
  48. package/dist/polyfills/core-js.js +11 -0
  49. package/dist/polyfills/css-shim.js +1 -0
  50. package/dist/polyfills/dom.js +79 -0
  51. package/dist/polyfills/es5-html-element.js +1 -0
  52. package/dist/polyfills/index.js +34 -0
  53. package/dist/polyfills/system.js +6 -0
  54. package/dist/{reactcomponent-7fbbd9b2.mjs → reactcomponent-DTepe7hB.mjs} +14121 -14626
  55. package/dist/route-travel-mode.enum-7f4ce9c7.js +9 -0
  56. package/dist/sort-order.enum-64ce8998.js +552 -0
  57. package/dist/unit-system.enum-eaefb53e.js +7 -0
  58. package/dist/utils-ae714467.js +61 -0
  59. package/package.json +10 -6
  60. package/dist/MapboxMap-06ef82a3.mjs +0 -37815
  61. package/dist/_commonjsHelpers-ba3f0406-b96e6d6a.mjs +0 -22
  62. package/dist/combo-box-item.entry-d35f3d51.mjs +0 -15
  63. package/dist/icon-b8d01d6f-ddfa2c17.mjs +0 -25
  64. package/dist/mapsindoors-webcomponent.umd.js +0 -3245
  65. package/dist/mi-card_2.entry-fc772c35.mjs +0 -26
  66. package/dist/mi-chip.entry-81c742a1.mjs +0 -19
  67. package/dist/mi-column.entry-3a083282.mjs +0 -21
  68. package/dist/mi-combo-box.entry-cae6401a.mjs +0 -263
  69. package/dist/mi-data-table.entry-d4c3f445.mjs +0 -224
  70. package/dist/mi-distance_2.entry-a33ed69a.mjs +0 -339
  71. package/dist/mi-dropdown-item.entry-974d1e4f.mjs +0 -15
  72. package/dist/mi-dropdown.entry-5317db65.mjs +0 -349
  73. package/dist/mi-floor-selector.entry-185fbd8b.mjs +0 -115
  74. package/dist/mi-keyboard.entry-eaf4b9ef.mjs +0 -3103
  75. package/dist/mi-list-item-category.entry-9c95008c.mjs +0 -39
  76. package/dist/mi-list-item-location.entry-8b41e8f0.mjs +0 -137
  77. package/dist/mi-list.entry-1218d29d.mjs +0 -42
  78. package/dist/mi-location-booking.entry-270aaf5a.mjs +0 -4866
  79. package/dist/mi-location-info.entry-e4f7fd04.mjs +0 -32
  80. package/dist/mi-map-googlemaps.entry-81fa28d2.mjs +0 -467
  81. package/dist/mi-map-mapbox.entry-31821da3.mjs +0 -301
  82. package/dist/mi-metric-card.entry-40407f04.mjs +0 -29
  83. package/dist/mi-my-position.entry-bc48fe6e.mjs +0 -703
  84. package/dist/mi-notification.entry-9a2bc53b.mjs +0 -84
  85. package/dist/mi-route-instructions-heading.entry-e5b1ff04.mjs +0 -75
  86. package/dist/mi-route-instructions-maneuver-legacy.entry-2c3d73ab.mjs +0 -76
  87. package/dist/mi-route-instructions-maneuver.entry-c6f01024.mjs +0 -76
  88. package/dist/mi-route-instructions-step-legacy.entry-80bcf097.mjs +0 -202
  89. package/dist/mi-route-instructions-step.entry-db802e13.mjs +0 -231
  90. package/dist/mi-route-instructions.entry-62416e29.mjs +0 -143
  91. package/dist/mi-scroll-buttons.entry-92b62b21.mjs +0 -83
  92. package/dist/mi-search.entry-87f1e64a.mjs +0 -251
  93. package/dist/mi-share-sms.entry-b6725edb.mjs +0 -56
  94. package/dist/mi-step-switcher.entry-f8f6c040.mjs +0 -27
  95. package/dist/mi-tab-panel.entry-a89213c2.mjs +0 -22
  96. package/dist/mi-tab.entry-a2fb3f8c.mjs +0 -14
  97. package/dist/mi-tabs.entry-cd638ea7.mjs +0 -37
  98. package/dist/mi-time.entry-0b02870d.mjs +0 -46
  99. package/dist/mi-variables-9a6c8d4d-e06eec88.mjs +0 -8
  100. package/dist/route-travel-mode.enum-7f4ce9c7-a9c95a83.mjs +0 -8
  101. package/dist/sort-order.enum-64ce8998-b75ac596.mjs +0 -318
  102. package/dist/unit-system.enum-eaefb53e-0f424da4.mjs +0 -8
  103. package/dist/utils-ae714467-b07fc3be.mjs +0 -37
@@ -1,84 +0,0 @@
1
- import { r as c, f as r, h as i, H as f, g as d } from "./reactcomponent-7fbbd9b2.mjs";
2
- import "react";
3
- import "react-dom";
4
- var l;
5
- (function(t) {
6
- 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";
7
- })(l || (l = {}));
8
- var n;
9
- (function(t) {
10
- t.Error = "error", t.Info = "info", t.Success = "success", t.Warning = "warning", t.None = "none";
11
- })(n || (n = {}));
12
- 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}', p = class {
13
- constructor(t) {
14
- c(this, t), this.notifications = [], this.notificationId = 0, this.position = l.BOTTOM_RIGHT, this.duration = 3;
15
- }
16
- /**
17
- * Show a notification.
18
- *
19
- * @param {string} message - Message to display.
20
- * @param {string} [type='none'] - Type of notification. Available types: 'info', 'warning', 'success', 'error' and 'none'.
21
- * @param {boolean} [sticky=false] - Set message as sticky to prevent it from disappearing.
22
- * @returns {Promise<void>}
23
- */
24
- async push(t, e = "none", o = !1) {
25
- if (typeof t != "string" || t.length < 1)
26
- return;
27
- if (!Object.values(n).some((a) => a === e)) {
28
- console.error("Invalid notification type");
29
- return;
30
- }
31
- const s = {
32
- id: this.notificationId,
33
- message: t,
34
- sticky: o,
35
- type: e
36
- };
37
- o === !1 && (s.timer = window.setTimeout(() => this.dismiss(s.id), this.duration * 1e3)), this.notificationId++, this.notifications.push(s), r(this.hostElement);
38
- }
39
- /**
40
- * Clear all notifications.
41
- *
42
- * @returns {Promise<void>}
43
- */
44
- async clearAll() {
45
- this.notifications = [], r(this.hostElement);
46
- }
47
- /**
48
- * Dismiss a single notification.
49
- *
50
- * @param {number} id
51
- */
52
- dismiss(t) {
53
- this.notifications = this.notifications.filter((e) => e.id !== t), r(this.hostElement);
54
- }
55
- render() {
56
- return i(f, { class: this.position }, this.notifications.map((t) => this.renderNotification(t)));
57
- }
58
- /**
59
- * Get JSX for notification.
60
- *
61
- * @param {NotificationMessage} { id, message }
62
- * @returns {JSX.Element}
63
- */
64
- renderNotification({ id: t, message: e, type: o }) {
65
- 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" }))));
66
- }
67
- /**
68
- * Get JSX for type-icon.
69
- *
70
- * @param {NotificationType} type
71
- * @returns {JSX.Element}
72
- */
73
- renderIcon(t) {
74
- 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" })));
75
- }
76
- get hostElement() {
77
- return d(this);
78
- }
79
- };
80
- p.style = h;
81
- export {
82
- p as mi_notification
83
- };
84
- //# sourceMappingURL=mi-notification.entry-9a2bc53b.mjs.map
@@ -1,75 +0,0 @@
1
- import { r as s, h as i } from "./reactcomponent-7fbbd9b2.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
- import "react";
5
- import "react-dom";
6
- 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 {
7
- constructor(e) {
8
- 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 = {
9
- from: "From",
10
- to: "To",
11
- avoidStairs: "Avoid stairs",
12
- walk: "Walk",
13
- walking: "Walking",
14
- bike: "Bike",
15
- bicycling: "Bicycling",
16
- transit: "Transit",
17
- car: "Car",
18
- driving: "Driving"
19
- };
20
- }
21
- /**
22
- * Get travel mode as a string. Eg. "Walking", "Driving", "Transit", "Bicycling".
23
- *
24
- * @returns {string}
25
- */
26
- getTravelModeString() {
27
- switch (this.travelMode) {
28
- case t.Walking:
29
- return this.translations.walk;
30
- case t.Driving:
31
- return this.translations.car;
32
- case t.Transit:
33
- return this.translations.transit;
34
- case t.Bicycling:
35
- return this.translations.bike;
36
- default:
37
- return this.translations.walk;
38
- }
39
- }
40
- /**
41
- * Get icon name for travel mode.
42
- *
43
- * @returns {string}
44
- */
45
- getTravelModeIconName() {
46
- switch (this.travelMode) {
47
- case t.Walking:
48
- return "walk";
49
- case t.Driving:
50
- return "car";
51
- case t.Transit:
52
- return "transit";
53
- case t.Bicycling:
54
- return "bike";
55
- default:
56
- return "walk";
57
- }
58
- }
59
- render() {
60
- 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() }))));
61
- }
62
- /**
63
- * Render direction way points.
64
- *
65
- * @returns {JSX.Element}
66
- */
67
- renderWayPoints() {
68
- 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)));
69
- }
70
- };
71
- r.style = a;
72
- export {
73
- r as mi_route_instructions_heading
74
- };
75
- //# sourceMappingURL=mi-route-instructions-heading.entry-e5b1ff04.mjs.map
@@ -1,76 +0,0 @@
1
- import { r as s, h as i, H as r } from "./reactcomponent-7fbbd9b2.mjs";
2
- import { U as o } from "./unit-system.enum-eaefb53e-0f424da4.mjs";
3
- import "react";
4
- import "react-dom";
5
- 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 {
6
- constructor(t) {
7
- s(this, t), this.maneuver = void 0, this.maneuverData = void 0, this.translations = void 0, this.translationsData = void 0, this.unit = o.Metric;
8
- }
9
- parseManeuverProp() {
10
- this.maneuverData = JSON.parse(this.maneuver);
11
- }
12
- parseTranslationsProp() {
13
- this.translationsData = JSON.parse(this.translations);
14
- }
15
- componentWillLoad() {
16
- this.parseManeuverProp(), this.parseTranslationsProp();
17
- }
18
- /**
19
- * Get maneuver name.
20
- *
21
- * @returns {string}
22
- */
23
- getManeuverName(t) {
24
- if (t.includes("straight"))
25
- return "straight";
26
- if (t.includes("sharp right"))
27
- return "sharp-right";
28
- if (t.includes("sharp left"))
29
- return "sharp-left";
30
- if (t.includes("slight right"))
31
- return "slight-right";
32
- if (t.includes("slight left"))
33
- return "slight-left";
34
- if (t.includes("right"))
35
- return "right";
36
- if (t.includes("left"))
37
- return "left";
38
- if (t.includes("uturn"))
39
- return "u-turn";
40
- if (t.includes("depart"))
41
- return "straight";
42
- }
43
- render() {
44
- return this.maneuverData && this.translationsData ? this.renderManeuver() : null;
45
- }
46
- /**
47
- * Render step.
48
- *
49
- * @returns {JSX.Element}
50
- */
51
- renderManeuver() {
52
- const t = {
53
- straight: this.translationsData.continueStraightAhead,
54
- left: `${this.translationsData.goLeft} ${this.translationsData.andContinue}`,
55
- "sharp-left": `${this.translationsData.goSharpLeft} ${this.translationsData.andContinue}`,
56
- "slight-left": `${this.translationsData.goSlightLeft} ${this.translationsData.andContinue}`,
57
- right: `${this.translationsData.goRight} ${this.translationsData.andContinue}`,
58
- "sharp-right": `${this.translationsData.goSharpRight} ${this.translationsData.andContinue}`,
59
- "slight-right": `${this.translationsData.goSlightRight} ${this.translationsData.andContinue}`,
60
- "u-turn": `${this.translationsData.turnAround} ${this.translationsData.andContinue}`
61
- // 'Turn around and continue'
62
- }, a = this.getManeuverName(this.maneuverData.maneuver.toLowerCase()), n = `arrow-${a}`, e = this.maneuverData.instructions ? this.maneuverData.instructions : t[a];
63
- 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" }))));
64
- }
65
- static get watchers() {
66
- return {
67
- maneuver: ["parseManeuverProp"],
68
- translations: ["parseTranslationsProp"]
69
- };
70
- }
71
- };
72
- h.style = l;
73
- export {
74
- h as mi_route_instructions_maneuver_legacy
75
- };
76
- //# sourceMappingURL=mi-route-instructions-maneuver-legacy.entry-2c3d73ab.mjs.map
@@ -1,76 +0,0 @@
1
- import { r, h as n, H as e } from "./reactcomponent-7fbbd9b2.mjs";
2
- import { U as o } from "./unit-system.enum-eaefb53e-0f424da4.mjs";
3
- import "react";
4
- import "react-dom";
5
- const h = ":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}", u = class {
6
- constructor(t) {
7
- r(this, t), this.maneuver = void 0, this.maneuverData = void 0, this.translations = void 0, this.translationsData = void 0, this.unit = o.Metric;
8
- }
9
- parseManeuverProp() {
10
- this.maneuverData = JSON.parse(this.maneuver);
11
- }
12
- parseTranslationsProp() {
13
- this.translationsData = JSON.parse(this.translations);
14
- }
15
- componentWillLoad() {
16
- this.parseManeuverProp(), this.parseTranslationsProp();
17
- }
18
- /**
19
- * Get maneuver name.
20
- *
21
- * @returns {string}
22
- */
23
- getManeuverName(t) {
24
- if (t.includes("straight"))
25
- return "straight";
26
- if (t.includes("sharp right"))
27
- return "sharp-right";
28
- if (t.includes("sharp left"))
29
- return "sharp-left";
30
- if (t.includes("slight right"))
31
- return "slight-right";
32
- if (t.includes("slight left"))
33
- return "slight-left";
34
- if (t.includes("right"))
35
- return "right";
36
- if (t.includes("left"))
37
- return "left";
38
- if (t.includes("uturn"))
39
- return "u-turn";
40
- if (t.includes("depart"))
41
- return "straight";
42
- }
43
- render() {
44
- return this.maneuverData && this.translationsData ? this.renderManeuver() : null;
45
- }
46
- /**
47
- * Render step.
48
- *
49
- * @returns {JSX.Element}
50
- */
51
- renderManeuver() {
52
- const t = {
53
- straight: this.translationsData.continueStraightAhead,
54
- left: `${this.translationsData.goLeft} ${this.translationsData.andContinue}`,
55
- "sharp-left": `${this.translationsData.goSharpLeft} ${this.translationsData.andContinue}`,
56
- "slight-left": `${this.translationsData.goSlightLeft} ${this.translationsData.andContinue}`,
57
- right: `${this.translationsData.goRight} ${this.translationsData.andContinue}`,
58
- "sharp-right": `${this.translationsData.goSharpRight} ${this.translationsData.andContinue}`,
59
- "slight-right": `${this.translationsData.goSlightRight} ${this.translationsData.andContinue}`,
60
- "u-turn": `${this.translationsData.turnAround} ${this.translationsData.andContinue}`
61
- // 'Turn around and continue'
62
- }, a = this.getManeuverName(this.maneuverData.maneuver.toLowerCase()), i = `arrow-${a}`, s = this.maneuverData.instructions ? this.maneuverData.instructions : t[a];
63
- 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 })));
64
- }
65
- static get watchers() {
66
- return {
67
- maneuver: ["parseManeuverProp"],
68
- translations: ["parseTranslationsProp"]
69
- };
70
- }
71
- };
72
- u.style = h;
73
- export {
74
- u as mi_route_instructions_maneuver
75
- };
76
- //# sourceMappingURL=mi-route-instructions-maneuver.entry-c6f01024.mjs.map
@@ -1,202 +0,0 @@
1
- import { r as n, c as r, h as e } from "./reactcomponent-7fbbd9b2.mjs";
2
- import { U as o } from "./unit-system.enum-eaefb53e-0f424da4.mjs";
3
- import { c as l } from "./utils-ae714467-b07fc3be.mjs";
4
- import "react";
5
- import "react-dom";
6
- const p = ':host{display:block;font-family:Figtree, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Fira Sans", "Droid Sans", "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"}.step{display:grid;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 {
7
- constructor(t) {
8
- 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;
9
- }
10
- parseStepProp() {
11
- this.step && (this.stepData = JSON.parse(this.step));
12
- }
13
- parseTranslationsProp() {
14
- this.translations && (this.translationsData = JSON.parse(this.translations));
15
- }
16
- componentWillLoad() {
17
- this.parseStepProp(), this.parseTranslationsProp();
18
- }
19
- /**
20
- * Render if there is step data.
21
- */
22
- render() {
23
- return this.stepData && this.translationsData ? this.renderStep() : null;
24
- }
25
- /**
26
- * Emits stepClicked event (if click target is not related to an action)
27
- * @param event Event
28
- */
29
- stepClickHandler(t) {
30
- if (Array.from(t.target.classList).includes("icon-toggle"))
31
- return;
32
- let s = null;
33
- t.target.dataset.maneuverIndex !== void 0 && (s = parseInt(t.target.dataset.maneuverIndex)), this.stepClicked.emit({ maneuverIndex: s });
34
- }
35
- /**
36
- * Render step part depending on travel mode.
37
- *
38
- * @returns {JSX.Element}
39
- */
40
- renderStep() {
41
- switch (this.stepData.travel_mode.toUpperCase()) {
42
- case "DRIVING":
43
- return this.renderDrivingStep();
44
- case "WALKING":
45
- return this.renderWalkingStep();
46
- case "BICYCLING":
47
- return this.renderBicyclingStep();
48
- case "TRANSIT":
49
- return this.renderTransitStep();
50
- default:
51
- return e("div", null, "Unknown travel mode: ", this.stepData.travel_mode);
52
- }
53
- }
54
- /**
55
- * Render the travel mode indicator and dotted/solid line.
56
- *
57
- * @returns {JSX.Element}
58
- */
59
- renderTravelMode() {
60
- if (this.isInternetExplorer)
61
- return null;
62
- let t;
63
- switch (this.stepData.travel_mode.toUpperCase()) {
64
- case "DRIVING":
65
- t = "car";
66
- break;
67
- case "WALKING":
68
- t = "walk";
69
- break;
70
- case "BICYCLING":
71
- t = "bike";
72
- break;
73
- case "TRANSIT":
74
- t = this.getTransitVehicleIconName();
75
- break;
76
- }
77
- return e("span", { part: "step-travel-mode", class: `step__travel-mode step__travel-mode--${this.stepData.travel_mode.toUpperCase() === "TRANSIT" ? "solid" : "dotted"}` }, e("span", { class: "step__travel-mode-icon" }, e("mi-icon", { part: "step-travel-mode-icon", "icon-name": t })));
78
- }
79
- /**
80
- * Get icon name for transit vehicle.
81
- *
82
- * @returns {string}
83
- */
84
- getTransitVehicleIconName() {
85
- var t, s;
86
- const i = (s = (t = this.stepData.transit_information) === null || t === void 0 ? void 0 : t.line.vehicle) === null || s === void 0 ? void 0 : s.type.toLowerCase();
87
- return i && ["boat", "bus", "railway", "train", "subway"].some((a) => a === i) ? i : "transit";
88
- }
89
- /**
90
- * Toggles visibility of sub steps (steps in steps)
91
- */
92
- toggleSubsteps() {
93
- this.substepsAreOpen = !this.substepsAreOpen;
94
- }
95
- /**
96
- * Render substeps if they should be visible.
97
- *
98
- * @returns {JSX.Element}
99
- */
100
- renderSubsteps() {
101
- return this.substepsAreOpen === !0 ? e("div", { class: "step__substeps" }, this.stepData.steps.map((t, s) => e("mi-route-instructions-maneuver-legacy", {
102
- "data-maneuver-index": s,
103
- maneuver: JSON.stringify(t),
104
- translations: this.translations,
105
- unit: this.unit,
106
- // @ts-ignore
107
- exportparts: `
108
- maneuver-icon,
109
- maneuver-description,
110
- maneuver-description-distance,
111
- maneuver-description-distance-border`
112
- }))) : null;
113
- }
114
- /**
115
- * Render the toggle button for the sub step expander.
116
- *
117
- * @returns {JSX.Element}
118
- */
119
- renderToggleButton() {
120
- return this.stepData.steps.length <= 0 || this.hideIndoorSubsteps === !0 && this.stepData.route_context.toLowerCase() === "insidebuilding" ? null : e("span", { class: `step__toggle ${this.substepsAreOpen ? "step__toggle--open" : ""}`, onClick: () => this.toggleSubsteps() }, this.isInternetExplorer ? "▼" : e("mi-icon", { part: "step-toggle", "icon-name": "toggle" }));
121
- }
122
- /**
123
- * Render time and distance part.
124
- *
125
- * @returns {JSX.Element}
126
- */
127
- renderTimeAndDistance() {
128
- 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));
129
- }
130
- /**
131
- * Render a driving step.
132
- *
133
- * @returns {JSX.Element}
134
- */
135
- renderDrivingStep() {
136
- return e("div", { class: "step", onClick: (t) => this.stepClickHandler(t) }, this.isInternetExplorer ? null : e("span", { class: "step__action-icon step__action-icon--circled" }, e("mi-icon", { "icon-name": "car" })), e("h3", { part: "step-heading", class: "step__heading" }, this.getStepHeading()), this.renderTravelMode(), e("div", { part: "step-description", class: "step__description" }, this.translationsData.drive, e("br", null), this.renderTimeAndDistance()), this.renderToggleButton(), this.renderSubsteps());
137
- }
138
- /**
139
- * Get display heading.
140
- *
141
- * @returns {string}
142
- */
143
- getStepHeading() {
144
- var t;
145
- const s = {
146
- driving: this.translationsData.drive,
147
- walking: this.translationsData.walk,
148
- bicycling: this.translationsData.bike
149
- };
150
- return !((t = this.stepData.steps[0]) === null || t === void 0) && t.instructions ? this.stepData.steps[0].instructions : s[this.stepData.travel_mode.toLowerCase()];
151
- }
152
- /**
153
- * Render a walking step.
154
- *
155
- *
156
- * @returns {JSX.Element}
157
- */
158
- renderWalkingStep() {
159
- let t, s;
160
- return this.stepData.parking === !0 ? (t = `${this.translationsData.park} ${this.stepData.label ? ` ${this.translationsData.at} ` + this.stepData.label : ""}`, s = "park") : this.stepData.highway && this.stepData.highway.toUpperCase() === "STEPS" ? (t = `${this.translationsData.takeStaircaseToLevel} ${this.stepData.end_location.floor_name}`, s = "stairs") : this.stepData.highway && this.stepData.highway.toUpperCase() === "LADDER" ? (t = `${this.translationsData.takeLadderToLevel} ${this.stepData.end_location.floor_name}`, s = "ladder") : this.stepData.highway && this.stepData.highway.toUpperCase() === "ESCALATOR" ? (t = `${this.translationsData.takeEscalatorToLevel} ${this.stepData.end_location.floor_name}`, s = "escalator") : this.stepData.highway && this.stepData.highway.toUpperCase() === "WHEELCHAIRRAMP" ? (t = `${this.translationsData.takeWheelchairRampToLevel} ${this.stepData.end_location.floor_name}`, s = "wheelchair-ramp") : this.stepData.highway && this.stepData.highway.toUpperCase() === "WHEELCHAIRLIFT" ? (t = `${this.translationsData.takeWheelchairLiftToLevel} ${this.stepData.end_location.floor_name}`, s = "wheelchair-lift") : this.stepData.highway && this.stepData.highway.toUpperCase() === "ELEVATOR" ? (t = `${this.translationsData.takeElevatorToLevel} ${this.stepData.end_location.floor_name}`, s = "elevator") : this.fromRouteContext === "InsideBuilding" && this.stepData.route_context === "Outside" ? (t = this.addStepContextNameToHeading(this.translationsData.exit, this.stepData.start_context), s = "exit") : this.fromRouteContext === "InsideBuilding" && this.stepData.route_context === "InsideBuilding" ? (t = this.getStepHeading(), s = "walk") : this.fromRouteContext === "Outside" && this.stepData.route_context === "Outside" && this.fromTravelMode.toUpperCase() === "TRANSIT" ? (t = this.fromTransitStop, s = "transit-stop") : this.fromRouteContext === "Outside" && this.stepData.route_context === "Outside" ? (t = this.getStepHeading(), s = "walk") : this.fromRouteContext === "Outside" && this.stepData.route_context === "InsideBuilding" ? (t = this.addStepContextNameToHeading(this.translationsData.enter, this.stepData.end_context), s = "enter") : (t = this.fromRouteContext, s = "circle"), e("div", { class: "step", onClick: (i) => this.stepClickHandler(i) }, 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());
161
- }
162
- /**
163
- * Add building or venue name to the step heading
164
- * @param {string} heading
165
- * @param {StepContext} stepContext
166
- * @returns
167
- */
168
- addStepContextNameToHeading(t, s) {
169
- return s && (s.building ? t += ` ${s.building.buildingInfo.name} ${this.translationsData.building}` : s.venue && (t += ` ${s.venue.venueInfo.name} ${this.translationsData.venue}`)), t;
170
- }
171
- /**
172
- * Render a bicycling step.
173
- *
174
- * @returns {JSX.Element}
175
- */
176
- renderBicyclingStep() {
177
- return e("div", { class: "step", onClick: (t) => this.stepClickHandler(t) }, this.isInternetExplorer ? null : e("span", { class: "step__action-icon step__action-icon--circled" }, e("mi-icon", { "icon-name": "bike" })), e("h3", { part: "step-heading", class: "step__heading" }, this.getStepHeading()), this.renderTravelMode(), e("div", { part: "step-description", class: "step__description" }, this.translationsData.bike, e("br", null), this.renderTimeAndDistance()), this.renderToggleButton(), this.renderSubsteps());
178
- }
179
- /**
180
- * Render a transit step.
181
- *
182
- * @returns {JSX.Element}
183
- */
184
- renderTransitStep() {
185
- var t, s;
186
- return e("div", { class: "step", onClick: (i) => this.stepClickHandler(i) }, this.isInternetExplorer ? null : e("span", { class: "step__action-icon step__action-icon--circled" }, e("mi-icon", { "icon-name": "transit-stop" })), e("h3", { part: "step-heading", class: "step__heading" }, this.stepData.instructions), this.renderTravelMode(), e("div", { part: "step-description", class: "step__description" }, this.stepData.transit_information.line.short_name ? e("span", { class: "step__short-name", style: {
187
- backgroundColor: !((t = this.stepData.transit_information.line) === null || t === void 0) && t.color ? this.stepData.transit_information.line.color : null,
188
- color: !((s = this.stepData.transit_information.line) === null || s === void 0) && s.text_color ? this.stepData.transit_information.line.text_color : null
189
- } }, this.stepData.transit_information.line.short_name) : null, this.stepData.transit_information.headsign ? this.stepData.transit_information.headsign : null, e("br", null), e("span", { part: "step-info", class: "step__distance-duration" }, e("mi-time", { seconds: this.stepData.duration.value, translations: `{"days":"${this.translationsData.days}","hours":"${this.translationsData.hours}","minutes":"${this.translationsData.minutes}"}` }), " · ", this.stepData.transit_information.num_stops ? this.stepData.transit_information.num_stops : null, " ", this.translationsData.stops ? this.translationsData.stops : null)), this.renderToggleButton(), this.renderSubsteps());
190
- }
191
- static get watchers() {
192
- return {
193
- step: ["parseStepProp"],
194
- translations: ["parseTranslationsProp"]
195
- };
196
- }
197
- };
198
- d.style = p;
199
- export {
200
- d as mi_route_instructions_step_legacy
201
- };
202
- //# sourceMappingURL=mi-route-instructions-step-legacy.entry-80bcf097.mjs.map