@mapsindoors/map-template 1.66.2 → 1.66.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (48) hide show
  1. package/dist/_commonjsHelpers-ba3f0406-b20f75c1.mjs +30 -0
  2. package/dist/combo-box-item.entry-85094f35.mjs +22 -0
  3. package/dist/icon-b8d01d6f-6d4b7c40.mjs +33 -0
  4. package/dist/mapsindoors-react.es.js +7 -59824
  5. package/dist/mapsindoors-react.umd.js +560 -491
  6. package/dist/mapsindoors-webcomponent.es.js +51218 -39989
  7. package/dist/mapsindoors-webcomponent.umd.js +554 -480
  8. package/dist/mi-card_2.entry-817a0422.mjs +33 -0
  9. package/dist/mi-chip.entry-f7dbae24.mjs +26 -0
  10. package/dist/mi-column.entry-30d4c1d7.mjs +28 -0
  11. package/dist/mi-combo-box.entry-998279bc.mjs +270 -0
  12. package/dist/mi-data-table.entry-e0a9dd7a.mjs +231 -0
  13. package/dist/mi-distance_2.entry-e930707c.mjs +346 -0
  14. package/dist/mi-dropdown-item.entry-e624023f.mjs +22 -0
  15. package/dist/mi-dropdown.entry-8d4d8ee3.mjs +331 -0
  16. package/dist/mi-floor-selector.entry-329407f6.mjs +122 -0
  17. package/dist/mi-keyboard.entry-ceed8ed2.mjs +3048 -0
  18. package/dist/mi-list-item-category.entry-a33342c9.mjs +46 -0
  19. package/dist/mi-list-item-location.entry-e9b9527d.mjs +144 -0
  20. package/dist/mi-list.entry-d5bd6cae.mjs +49 -0
  21. package/dist/mi-location-booking.entry-63d82e20.mjs +4873 -0
  22. package/dist/mi-location-info.entry-43f0e6f3.mjs +39 -0
  23. package/dist/mi-map-googlemaps.entry-abe19e39.mjs +406 -0
  24. package/dist/mi-map-mapbox.entry-02d4ace9.mjs +308 -0
  25. package/dist/mi-metric-card.entry-85d97733.mjs +36 -0
  26. package/dist/mi-my-position.entry-223dd3e0.mjs +1406 -0
  27. package/dist/mi-notification.entry-7facb24f.mjs +91 -0
  28. package/dist/mi-route-instructions-heading.entry-e11004f5.mjs +82 -0
  29. package/dist/mi-route-instructions-maneuver-legacy.entry-e0a64029.mjs +83 -0
  30. package/dist/mi-route-instructions-maneuver.entry-98953d3e.mjs +83 -0
  31. package/dist/mi-route-instructions-step-legacy.entry-05ac87cf.mjs +209 -0
  32. package/dist/mi-route-instructions-step.entry-35ae490e.mjs +244 -0
  33. package/dist/mi-route-instructions.entry-fc97f09d.mjs +150 -0
  34. package/dist/mi-scroll-buttons.entry-9e523ef6.mjs +86 -0
  35. package/dist/mi-search.entry-8c1f6929.mjs +258 -0
  36. package/dist/mi-share-sms.entry-0689c0ac.mjs +63 -0
  37. package/dist/mi-step-switcher.entry-aa8f0707.mjs +34 -0
  38. package/dist/mi-tab-panel.entry-1ddc397b.mjs +29 -0
  39. package/dist/mi-tab.entry-a478df47.mjs +21 -0
  40. package/dist/mi-tabs.entry-7c445312.mjs +44 -0
  41. package/dist/mi-time.entry-df58a4f1.mjs +53 -0
  42. package/dist/mi-variables-9a6c8d4d-64044b44.mjs +16 -0
  43. package/dist/reactcomponent-fed5da4c.mjs +57763 -0
  44. package/dist/route-travel-mode.enum-7f4ce9c7-0da65b8e.mjs +16 -0
  45. package/dist/sort-order.enum-64ce8998-fb78d66a.mjs +326 -0
  46. package/dist/unit-system.enum-eaefb53e-5d1cf129.mjs +16 -0
  47. package/dist/utils-ae714467-4f4e3a56.mjs +45 -0
  48. package/package.json +1 -1
@@ -0,0 +1,46 @@
1
+ import { r as s, c as r, h as i, H as a } from "./reactcomponent-fed5da4c.mjs";
2
+ import { m as n } from "./icon-b8d01d6f-6d4b7c40.mjs";
3
+ import { b as c } from "./utils-ae714467-4f4e3a56.mjs";
4
+ import "react";
5
+ import "react-dom";
6
+ (function() {
7
+ try {
8
+ var t = typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}, e = new t.Error().stack;
9
+ e && (t._sentryDebugIds = t._sentryDebugIds || {}, t._sentryDebugIds[e] = "b87b1791-1725-49c9-b6ea-eb9fb9d1283b", t._sentryDebugIdIdentifier = "sentry-dbid-b87b1791-1725-49c9-b6ea-eb9fb9d1283b");
10
+ } catch {
11
+ }
12
+ })();
13
+ const l = "html{box-sizing:border-box}*,*:before,*:after{box-sizing:inherit}:host{color:#1c1917;transition:300ms ease;display:flex;align-items:center;cursor:pointer}:host img{-o-object-fit:cover;object-fit:cover}:host([orientation=horizontal]){width:100%;height:100%;float:left;flex-direction:column;justify-content:center}:host([orientation=horizontal]) img{width:48px;height:48px}:host([orientation=horizontal]) p{height:16px;overflow:visible;font-size:0.875rem;line-height:1rem;text-align:center}:host([orientation=vertical]){padding:16px;flex-direction:row;font-size:1rem;font-weight:500;line-height:1.25rem}:host([orientation=vertical]) img{width:24px;height:24px}:host([orientation=vertical]) p{margin:0;padding-left:16px}:host(:hover){background-color:#fcfcfc}", d = class {
14
+ constructor(t) {
15
+ s(this, t), this.categoryClicked = r(this, "categoryClicked", 7), this.listItemDidRender = r(this, "listItemDidRender", 7), this.category = void 0, this.orientation = "vertical";
16
+ }
17
+ componentDidRender() {
18
+ this.listItemDidRender.emit(), "objectFit" in document.documentElement.style || this.objectFitImage(this.image);
19
+ }
20
+ /**
21
+ * @description Emits the category object to event listeners.
22
+ * @private
23
+ * @param {*} category - Category object.
24
+ * @memberof ListItemCategory
25
+ */
26
+ categoryClickedHandler(t) {
27
+ this.categoryClicked.emit(t);
28
+ }
29
+ /**
30
+ * @description Set image as background image.
31
+ * @private
32
+ * @param {HTMLImageElement} image
33
+ */
34
+ objectFitImage(t) {
35
+ t.setAttribute("style", `background: no-repeat center center url("${this.category.iconUrl}"); background-size: cover;`), t.src = `data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='${t.width}' height='${t.height}'%3E%3C/svg%3E`;
36
+ }
37
+ render() {
38
+ const t = this.orientation.toUpperCase() === "VERTICAL" ? parseInt(n.icon.size.medium.value) : parseInt(n.icon.size["xx-large"].value), e = c(this.category.iconUrl, t);
39
+ return i(a, { onClick: () => this.categoryClickedHandler(this.category) }, i("img", { ref: (o) => this.image = o, src: e }), i("p", null, this.category.name));
40
+ }
41
+ };
42
+ d.style = l;
43
+ export {
44
+ d as mi_list_item_category
45
+ };
46
+ //# sourceMappingURL=mi-list-item-category.entry-a33342c9.mjs.map
@@ -0,0 +1,144 @@
1
+ import { r, c as s, h as o, H as d } from "./reactcomponent-fed5da4c.mjs";
2
+ import { m as c } from "./icon-b8d01d6f-6d4b7c40.mjs";
3
+ import { b as a } from "./utils-ae714467-4f4e3a56.mjs";
4
+ import "react";
5
+ import "react-dom";
6
+ (function() {
7
+ try {
8
+ var e = typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}, t = new e.Error().stack;
9
+ t && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[t] = "bad9f093-54c5-45b0-8a02-4253b6ad0adc", e._sentryDebugIdIdentifier = "sentry-dbid-bad9f093-54c5-45b0-8a02-4253b6ad0adc");
10
+ } catch {
11
+ }
12
+ })();
13
+ const l = 'html{box-sizing:border-box}*,*:before,*:after{box-sizing:inherit}:host{padding:16px;font-size:1rem;font-weight:500;line-height:1rem;transition:300ms ease;font-family:-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";border-radius:8px;background-color:#f9fafb;display:flex;flex-direction:row;align-items:center;cursor:pointer;gap:16px;border:1px solid #e5e7eb}:host(:hover),:host(.hovered){background-color:var(--tailwind-colors-gray-200);border:1px solid #d1d5db}.img-container{width:32px;height:32px;display:flex;justify-content:center;align-items:center}img{border-radius:8px;width:100%;height:100%;-o-object-fit:cover;object-fit:cover}.details{padding-right:16px;flex:1;display:grid;gap:4px}.details-title{margin:0;padding:0}.distance{font-weight:400}mi-location-info{color:#6b7280}', h = class {
14
+ constructor(e) {
15
+ r(this, e), this.locationClicked = s(this, "locationClicked", 7), this.listItemDidRender = s(this, "listItemDidRender", 7), this.iconDisplaySize = parseInt(c.icon.size.medium.value), this.location = void 0, this.showExternalId = !0, this.unit = void 0, this.icon = void 0, this.level = "Level", this.iconBadge = void 0, this.iconBadgeValue = void 0, this.iconURLToRender = void 0;
16
+ }
17
+ iconChanged() {
18
+ var e;
19
+ this.iconURLToRender = this.icon ? this.icon : (e = this.location) === null || e === void 0 ? void 0 : e.properties.imageURL, this.updateBadge();
20
+ }
21
+ iconBadgeChanged() {
22
+ this.updateBadge();
23
+ }
24
+ iconBadgeValueChanged() {
25
+ this.updateBadge();
26
+ }
27
+ /**
28
+ * @description Emits the location to event listeners.
29
+ * @param {*} location - Location object.
30
+ * @memberof List
31
+ */
32
+ locationClickedHandler(e) {
33
+ this.locationClicked.emit(e);
34
+ }
35
+ /**
36
+ * Called once just after the component is first connected to the DOM.
37
+ */
38
+ componentWillLoad() {
39
+ var e;
40
+ this.iconURLToRender = this.icon ? this.icon : (e = this.location) === null || e === void 0 ? void 0 : e.properties.imageURL, this.updateBadge();
41
+ }
42
+ /**
43
+ * Called after every render().
44
+ */
45
+ componentDidRender() {
46
+ this.location && (this.infoElement.location = this.location, this.listItemDidRender.emit(), this.imageElement && !("objectFit" in document.documentElement.style) && this.objectFitImage(this.imageElement));
47
+ }
48
+ /**
49
+ * Apply badge to location icon.
50
+ */
51
+ updateBadge() {
52
+ this.iconBadge && this.iconBadgeValue && this.iconURLToRender && this.applyBadgeToIcon();
53
+ }
54
+ /**
55
+ * @description Set image as background image.
56
+ * @param {HTMLImageElement} image
57
+ */
58
+ objectFitImage(e) {
59
+ e.setAttribute("style", `background: no-repeat center center url("${this.iconURLToRender}"); background-size: cover;`), e.src = `data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='${e.width}' height='${e.height}'%3E%3C/svg%3E`;
60
+ }
61
+ /**
62
+ * Apply badge to location icon.
63
+ * Will make the original icon appear the intended size even though the badge exceeds its bounds.
64
+ */
65
+ applyBadgeToIcon() {
66
+ let e;
67
+ this.iconURLToRender = this.icon ? this.icon : this.location.properties.imageURL;
68
+ const t = a(this.iconURLToRender, this.iconDisplaySize);
69
+ this.getImageFromUrl(t).then((i) => {
70
+ switch (e = i.width / 24, this.iconBadge.toLowerCase()) {
71
+ case "availability":
72
+ if (this.iconBadgeValue === "true")
73
+ return mapsindoors.BadgeRenderer.AvailableBadge.overlay(i);
74
+ if (this.iconBadgeValue === "false")
75
+ return mapsindoors.BadgeRenderer.UnavailableBadge.overlay(i);
76
+ break;
77
+ case "occupancy":
78
+ return mapsindoors.BadgeRenderer.TextBadge.overlay(i, {
79
+ text: this.iconBadgeValue.toString()
80
+ });
81
+ }
82
+ }).then((i) => {
83
+ if (i) {
84
+ this.iconURLToRender = i.src;
85
+ const n = (i.width - 24) / -2;
86
+ this.iconAttributes = {
87
+ style: {
88
+ transform: "translateX(" + n + "px)",
89
+ width: i.width / e + "px",
90
+ height: i.height / e + "px"
91
+ }
92
+ };
93
+ }
94
+ });
95
+ }
96
+ /**
97
+ * Create and return an Image from URL.
98
+ *
99
+ * @param {string} url
100
+ * @returns {Image}
101
+ */
102
+ async getImageFromUrl(e) {
103
+ return fetch(e).then((t) => t.blob()).then((t) => URL.createObjectURL(t)).then((t) => new Promise((i) => {
104
+ const n = new Image();
105
+ n.width = this.iconDisplaySize, n.height = this.iconDisplaySize, n.onload = () => i(n), n.onerror = () => i(null), n.src = t;
106
+ }));
107
+ }
108
+ /**
109
+ * Render location list-item.
110
+ *
111
+ * @description Render location list-item.
112
+ * @returns {JSX.Element}
113
+ */
114
+ render() {
115
+ return this.location && o(d, { role: "listitem", onClick: () => this.locationClickedHandler(this.location) }, this.iconURLToRender ? this.renderIcon() : null, o("div", { class: "details" }, o("p", { class: "details-title" }, this.location.properties.name), o("mi-location-info", { level: this.level, ref: (e) => this.infoElement = e, showExternalId: this.showExternalId })), this.location.properties.geodesicDistance && this.renderDistance());
116
+ }
117
+ /**
118
+ * @description Get JSX template for icon.
119
+ * @returns {JSX.Element}
120
+ */
121
+ renderIcon() {
122
+ const e = a(this.iconURLToRender, this.iconDisplaySize);
123
+ return o("div", { class: "img-container" }, o("img", Object.assign({}, this.iconAttributes, { ref: (t) => this.imageElement = t, src: e })));
124
+ }
125
+ /**
126
+ * @description Get JSX template for distance.
127
+ * @returns {JSX.Element}
128
+ */
129
+ renderDistance() {
130
+ return o("div", { class: "distance" }, o("mi-distance", { meters: this.location.properties.geodesicDistance, unit: this.unit }));
131
+ }
132
+ static get watchers() {
133
+ return {
134
+ icon: ["iconChanged"],
135
+ iconBadge: ["iconBadgeChanged"],
136
+ iconBadgeValue: ["iconBadgeValueChanged"]
137
+ };
138
+ }
139
+ };
140
+ h.style = l;
141
+ export {
142
+ h as mi_list_item_location
143
+ };
144
+ //# sourceMappingURL=mi-list-item-location.entry-e9b9527d.mjs.map
@@ -0,0 +1,49 @@
1
+ import { r as s, h as e } from "./reactcomponent-fed5da4c.mjs";
2
+ import "react";
3
+ import "react-dom";
4
+ (function() {
5
+ try {
6
+ var t = typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}, n = new t.Error().stack;
7
+ n && (t._sentryDebugIds = t._sentryDebugIds || {}, t._sentryDebugIds[n] = "9c308c64-1e0b-4579-9900-0b0b765918e6", t._sentryDebugIdIdentifier = "sentry-dbid-9c308c64-1e0b-4579-9900-0b0b765918e6");
8
+ } catch {
9
+ }
10
+ })();
11
+ const l = "html{box-sizing:border-box}*,*:before,*:after{box-sizing:inherit}:host{display:block;height:100%;width:100%}.container{height:100%;display:flex}.container .scroll-container{width:100%;overflow-y:auto}", o = class {
12
+ constructor(t) {
13
+ s(this, t), this.scrollButtonsEnabled = !1, this.scrollLength = 100;
14
+ }
15
+ componentDidLoad() {
16
+ this.addIntersectionObserver(), this.scrollButtonsEnabled && this.setScrollContainerElementRef();
17
+ }
18
+ /**
19
+ * @description Update state of scroll buttons when a "listItemDidRender" event is fired.
20
+ * @private
21
+ */
22
+ updateScrollButtonsState() {
23
+ this.scrollButtonsEnabled && this.miScrollButtonsElement.scrollContainerElementRef && this.miScrollButtonsElement.updateScrollButtonsState();
24
+ }
25
+ /**
26
+ * @description Set scrollContainerElementRef attribute on miScrollButtonsElement.
27
+ * @private
28
+ */
29
+ setScrollContainerElementRef() {
30
+ this.miScrollButtonsElement.scrollContainerElementRef = this.scrollContainerElement;
31
+ }
32
+ /**
33
+ * @description Add intersection observer and update scroll buttons state on intersection – workaround to avoid the element not having any dimensions before it's shown.
34
+ * @private
35
+ */
36
+ addIntersectionObserver() {
37
+ this.intersectionObserver = new IntersectionObserver((t) => {
38
+ t[0].intersectionRatio <= 0 || (this.scrollContainerElement.scrollHeight - this.scrollContainerElement.scrollTop === this.scrollContainerElement.clientHeight && this.updateScrollButtonsState(), this.intersectionObserver.disconnect());
39
+ }), this.intersectionObserver.observe(this.scrollContainerElement);
40
+ }
41
+ render() {
42
+ return e("div", { class: "container" }, e("div", { role: "list", class: "scroll-container", ref: (t) => this.scrollContainerElement = t }, e("slot", null)), this.scrollButtonsEnabled ? e("mi-scroll-buttons", { scrollLength: this.scrollLength, ref: (t) => this.miScrollButtonsElement = t }) : null);
43
+ }
44
+ };
45
+ o.style = l;
46
+ export {
47
+ o as mi_list
48
+ };
49
+ //# sourceMappingURL=mi-list.entry-d5bd6cae.mjs.map