@mapsindoors/map-template 1.93.2 → 1.94.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{GoogleMapsMap-982405ad.mjs → GoogleMapsMap-BqYRaFgc.mjs} +51 -62
- package/dist/MapboxMap-CUYrfLHY.mjs +34732 -0
- package/dist/_commonjsHelpers-ba3f0406.js +21 -0
- package/dist/combo-box-item.entry.js +15 -0
- package/dist/icon-b8d01d6f.js +24 -0
- package/dist/index-7e9696f3.js +1678 -0
- package/dist/index.js +1 -0
- package/dist/loader.js +18 -0
- package/dist/mapsindoors-react.es.js +3 -5
- package/dist/mapsindoors-react.umd.js +197 -582
- package/dist/mapsindoors-webcomponent.es.js +58512 -75790
- package/dist/mi-card_2.entry.js +28 -0
- package/dist/mi-chip.entry.js +22 -0
- package/dist/mi-column.entry.js +28 -0
- package/dist/mi-combo-box.entry.js +416 -0
- package/dist/mi-components.js +18 -0
- package/dist/mi-data-table.entry.js +302 -0
- package/dist/mi-distance_2.entry.js +67 -0
- package/dist/mi-dropdown-item.entry.js +15 -0
- package/dist/mi-dropdown.entry.js +610 -0
- package/dist/mi-floor-selector.entry.js +202 -0
- package/dist/mi-keyboard.entry.js +238 -0
- package/dist/mi-list-item-category.entry.js +48 -0
- package/dist/mi-list-item-location.entry.js +171 -0
- package/dist/mi-list.entry.js +56 -0
- package/dist/mi-location-booking.entry.js +5193 -0
- package/dist/mi-location-info.entry.js +63 -0
- package/dist/mi-map-googlemaps.entry.js +750 -0
- package/dist/mi-map-mapbox.entry.js +467 -0
- package/dist/mi-metric-card.entry.js +48 -0
- package/dist/mi-my-position.entry.js +986 -0
- package/dist/mi-notification.entry.js +127 -0
- package/dist/mi-route-instructions-heading.entry.js +73 -0
- package/dist/mi-route-instructions-maneuver-legacy.entry.js +82 -0
- package/dist/mi-route-instructions-maneuver.entry.js +82 -0
- package/dist/mi-route-instructions-step-legacy.entry.js +308 -0
- package/dist/mi-route-instructions-step.entry.js +321 -0
- package/dist/mi-route-instructions.entry.js +157 -0
- package/dist/mi-scroll-buttons.entry.js +112 -0
- package/dist/mi-search.entry.js +376 -0
- package/dist/mi-share-sms.entry.js +80 -0
- package/dist/mi-step-switcher.entry.js +31 -0
- package/dist/mi-tab-panel.entry.js +25 -0
- package/dist/mi-tab.entry.js +12 -0
- package/dist/mi-tabs.entry.js +47 -0
- package/dist/mi-time.entry.js +57 -0
- package/dist/mi-variables-9a6c8d4d.js +6 -0
- package/dist/polyfills/core-js.js +11 -0
- package/dist/polyfills/css-shim.js +1 -0
- package/dist/polyfills/dom.js +79 -0
- package/dist/polyfills/es5-html-element.js +1 -0
- package/dist/polyfills/index.js +34 -0
- package/dist/polyfills/system.js +6 -0
- package/dist/{reactcomponent-7fbbd9b2.mjs → reactcomponent-DTepe7hB.mjs} +14121 -14626
- package/dist/route-travel-mode.enum-7f4ce9c7.js +9 -0
- package/dist/sort-order.enum-64ce8998.js +552 -0
- package/dist/unit-system.enum-eaefb53e.js +7 -0
- package/dist/utils-ae714467.js +61 -0
- package/package.json +10 -6
- package/dist/MapboxMap-06ef82a3.mjs +0 -37815
- package/dist/_commonjsHelpers-ba3f0406-b96e6d6a.mjs +0 -22
- package/dist/combo-box-item.entry-d35f3d51.mjs +0 -15
- package/dist/icon-b8d01d6f-ddfa2c17.mjs +0 -25
- package/dist/mapsindoors-webcomponent.umd.js +0 -3245
- package/dist/mi-card_2.entry-fc772c35.mjs +0 -26
- package/dist/mi-chip.entry-81c742a1.mjs +0 -19
- package/dist/mi-column.entry-3a083282.mjs +0 -21
- package/dist/mi-combo-box.entry-cae6401a.mjs +0 -263
- package/dist/mi-data-table.entry-d4c3f445.mjs +0 -224
- package/dist/mi-distance_2.entry-a33ed69a.mjs +0 -339
- package/dist/mi-dropdown-item.entry-974d1e4f.mjs +0 -15
- package/dist/mi-dropdown.entry-5317db65.mjs +0 -349
- package/dist/mi-floor-selector.entry-185fbd8b.mjs +0 -115
- package/dist/mi-keyboard.entry-eaf4b9ef.mjs +0 -3103
- package/dist/mi-list-item-category.entry-9c95008c.mjs +0 -39
- package/dist/mi-list-item-location.entry-8b41e8f0.mjs +0 -137
- package/dist/mi-list.entry-1218d29d.mjs +0 -42
- package/dist/mi-location-booking.entry-270aaf5a.mjs +0 -4866
- package/dist/mi-location-info.entry-e4f7fd04.mjs +0 -32
- package/dist/mi-map-googlemaps.entry-81fa28d2.mjs +0 -467
- package/dist/mi-map-mapbox.entry-31821da3.mjs +0 -301
- package/dist/mi-metric-card.entry-40407f04.mjs +0 -29
- package/dist/mi-my-position.entry-bc48fe6e.mjs +0 -703
- package/dist/mi-notification.entry-9a2bc53b.mjs +0 -84
- package/dist/mi-route-instructions-heading.entry-e5b1ff04.mjs +0 -75
- package/dist/mi-route-instructions-maneuver-legacy.entry-2c3d73ab.mjs +0 -76
- package/dist/mi-route-instructions-maneuver.entry-c6f01024.mjs +0 -76
- package/dist/mi-route-instructions-step-legacy.entry-80bcf097.mjs +0 -202
- package/dist/mi-route-instructions-step.entry-db802e13.mjs +0 -231
- package/dist/mi-route-instructions.entry-62416e29.mjs +0 -143
- package/dist/mi-scroll-buttons.entry-92b62b21.mjs +0 -83
- package/dist/mi-search.entry-87f1e64a.mjs +0 -251
- package/dist/mi-share-sms.entry-b6725edb.mjs +0 -56
- package/dist/mi-step-switcher.entry-f8f6c040.mjs +0 -27
- package/dist/mi-tab-panel.entry-a89213c2.mjs +0 -22
- package/dist/mi-tab.entry-a2fb3f8c.mjs +0 -14
- package/dist/mi-tabs.entry-cd638ea7.mjs +0 -37
- package/dist/mi-time.entry-0b02870d.mjs +0 -46
- package/dist/mi-variables-9a6c8d4d-e06eec88.mjs +0 -8
- package/dist/route-travel-mode.enum-7f4ce9c7-a9c95a83.mjs +0 -8
- package/dist/sort-order.enum-64ce8998-b75ac596.mjs +0 -318
- package/dist/unit-system.enum-eaefb53e-0f424da4.mjs +0 -8
- package/dist/utils-ae714467-b07fc3be.mjs +0 -37
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
import { r as registerInstance, c as createEvent, h, H as Host } from './index-7e9696f3.js';
|
|
2
|
+
import { m as midtIcon } from './icon-b8d01d6f.js';
|
|
3
|
+
import { b as appendMapsIndoorsImageQueryParameters } from './utils-ae714467.js';
|
|
4
|
+
|
|
5
|
+
const listItemLocationCss = "html{box-sizing:border-box}*,*:before,*:after{box-sizing:inherit}:host{padding:1rem;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:1rem;border:1px solid #e5e7eb}:host(:hover),:host(.hovered){background-color:var(--tailwind-colors-gray-200);border:1px solid #d1d5db}.img-container{width:2rem;height:2rem;display:flex;justify-content:center;align-items:center;flex-shrink:0}img{border-radius:8px;width:100%;height:100%;-o-object-fit:cover;object-fit:cover}.details{padding-right:1rem;flex:1;min-width:0;display:grid;gap:0.25rem}.details-title{margin:0;padding:0}.distance{font-weight:400}mi-location-info{color:#6b7280}";
|
|
6
|
+
|
|
7
|
+
const ListItemLocation = class {
|
|
8
|
+
constructor(hostRef) {
|
|
9
|
+
registerInstance(this, hostRef);
|
|
10
|
+
this.locationClicked = createEvent(this, "locationClicked", 7);
|
|
11
|
+
this.listItemDidRender = createEvent(this, "listItemDidRender", 7);
|
|
12
|
+
this.iconDisplaySize = parseInt(midtIcon.icon.size.medium.value);
|
|
13
|
+
this.location = undefined;
|
|
14
|
+
this.showExternalId = true;
|
|
15
|
+
this.unit = undefined;
|
|
16
|
+
this.icon = undefined;
|
|
17
|
+
this.level = 'Level';
|
|
18
|
+
this.iconBadge = undefined;
|
|
19
|
+
this.iconBadgeValue = undefined;
|
|
20
|
+
this.iconURLToRender = undefined;
|
|
21
|
+
}
|
|
22
|
+
iconChanged() {
|
|
23
|
+
var _a;
|
|
24
|
+
this.iconURLToRender = this.icon ? this.icon : (_a = this.location) === null || _a === void 0 ? void 0 : _a.properties.imageURL;
|
|
25
|
+
this.updateBadge();
|
|
26
|
+
}
|
|
27
|
+
iconBadgeChanged() {
|
|
28
|
+
this.updateBadge();
|
|
29
|
+
}
|
|
30
|
+
iconBadgeValueChanged() {
|
|
31
|
+
this.updateBadge();
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* @description Emits the location to event listeners.
|
|
35
|
+
* @param {*} location - Location object.
|
|
36
|
+
* @memberof List
|
|
37
|
+
*/
|
|
38
|
+
locationClickedHandler(location) {
|
|
39
|
+
this.locationClicked.emit(location);
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Called once just after the component is first connected to the DOM.
|
|
43
|
+
*/
|
|
44
|
+
componentWillLoad() {
|
|
45
|
+
var _a;
|
|
46
|
+
this.iconURLToRender = this.icon ? this.icon : (_a = this.location) === null || _a === void 0 ? void 0 : _a.properties.imageURL;
|
|
47
|
+
this.updateBadge();
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Called after every render().
|
|
51
|
+
*/
|
|
52
|
+
componentDidRender() {
|
|
53
|
+
if (!this.location) {
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
this.infoElement.location = this.location;
|
|
57
|
+
this.listItemDidRender.emit();
|
|
58
|
+
// IE fallback for 'object-fit' css property
|
|
59
|
+
if (this.imageElement && 'objectFit' in document.documentElement.style === false) {
|
|
60
|
+
this.objectFitImage(this.imageElement);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Apply badge to location icon.
|
|
65
|
+
*/
|
|
66
|
+
updateBadge() {
|
|
67
|
+
if (this.iconBadge && this.iconBadgeValue && this.iconURLToRender) {
|
|
68
|
+
this.applyBadgeToIcon();
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* @description Set image as background image.
|
|
73
|
+
* @param {HTMLImageElement} image
|
|
74
|
+
*/
|
|
75
|
+
objectFitImage(image) {
|
|
76
|
+
image.setAttribute('style', `background: no-repeat center center url("${this.iconURLToRender}"); background-size: cover;`);
|
|
77
|
+
image.src = `data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='${image.width}' height='${image.height}'%3E%3C/svg%3E`;
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Apply badge to location icon.
|
|
81
|
+
* Will make the original icon appear the intended size even though the badge exceeds its bounds.
|
|
82
|
+
*/
|
|
83
|
+
applyBadgeToIcon() {
|
|
84
|
+
let originalIconScale;
|
|
85
|
+
this.iconURLToRender = this.icon ? this.icon : this.location.properties.imageURL;
|
|
86
|
+
const iconURL = appendMapsIndoorsImageQueryParameters(this.iconURLToRender, this.iconDisplaySize);
|
|
87
|
+
this.getImageFromUrl(iconURL).then(image => {
|
|
88
|
+
originalIconScale = image.width / 24;
|
|
89
|
+
switch (this.iconBadge.toLowerCase()) {
|
|
90
|
+
case 'availability':
|
|
91
|
+
if (this.iconBadgeValue === 'true') {
|
|
92
|
+
return mapsindoors.BadgeRenderer.AvailableBadge.overlay(image);
|
|
93
|
+
}
|
|
94
|
+
else if (this.iconBadgeValue === 'false') {
|
|
95
|
+
return mapsindoors.BadgeRenderer.UnavailableBadge.overlay(image);
|
|
96
|
+
}
|
|
97
|
+
break;
|
|
98
|
+
case 'occupancy':
|
|
99
|
+
return mapsindoors.BadgeRenderer.TextBadge.overlay(image, {
|
|
100
|
+
text: this.iconBadgeValue.toString()
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
}).then(badgedImage => {
|
|
104
|
+
if (badgedImage) {
|
|
105
|
+
this.iconURLToRender = badgedImage.src;
|
|
106
|
+
// Badged image must be moved so the original image aligns with other.
|
|
107
|
+
const translateIcon = (badgedImage.width - 24) / -2;
|
|
108
|
+
this.iconAttributes = {
|
|
109
|
+
style: {
|
|
110
|
+
transform: 'translateX(' + translateIcon + 'px)',
|
|
111
|
+
width: badgedImage.width / originalIconScale + 'px',
|
|
112
|
+
height: badgedImage.height / originalIconScale + 'px'
|
|
113
|
+
}
|
|
114
|
+
};
|
|
115
|
+
}
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* Create and return an Image from URL.
|
|
120
|
+
*
|
|
121
|
+
* @param {string} url
|
|
122
|
+
* @returns {Image}
|
|
123
|
+
*/
|
|
124
|
+
async getImageFromUrl(url) {
|
|
125
|
+
return fetch(url)
|
|
126
|
+
.then(res => res.blob())
|
|
127
|
+
.then(blob => URL.createObjectURL(blob))
|
|
128
|
+
.then(objUrl => {
|
|
129
|
+
return new Promise((resolve) => {
|
|
130
|
+
const image = new Image();
|
|
131
|
+
image.width = this.iconDisplaySize;
|
|
132
|
+
image.height = this.iconDisplaySize;
|
|
133
|
+
image.onload = () => resolve(image);
|
|
134
|
+
image.onerror = () => resolve(null);
|
|
135
|
+
image.src = objUrl;
|
|
136
|
+
});
|
|
137
|
+
});
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
140
|
+
* Render location list-item.
|
|
141
|
+
*
|
|
142
|
+
* @description Render location list-item.
|
|
143
|
+
* @returns {JSX.Element}
|
|
144
|
+
*/
|
|
145
|
+
render() {
|
|
146
|
+
return this.location && (h(Host, { role: "listitem", onClick: () => this.locationClickedHandler(this.location) }, this.iconURLToRender ? this.renderIcon() : null, h("div", { class: "details" }, h("p", { class: "details-title" }, this.location.properties.name), h("mi-location-info", { level: this.level, ref: (el) => this.infoElement = el, showExternalId: this.showExternalId })), this.location.properties.geodesicDistance && this.renderDistance()));
|
|
147
|
+
}
|
|
148
|
+
/**
|
|
149
|
+
* @description Get JSX template for icon.
|
|
150
|
+
* @returns {JSX.Element}
|
|
151
|
+
*/
|
|
152
|
+
renderIcon() {
|
|
153
|
+
const iconURL = appendMapsIndoorsImageQueryParameters(this.iconURLToRender, this.iconDisplaySize);
|
|
154
|
+
return (h("div", { class: "img-container" }, h("img", Object.assign({}, this.iconAttributes, { ref: (el) => this.imageElement = el, src: iconURL }))));
|
|
155
|
+
}
|
|
156
|
+
/**
|
|
157
|
+
* @description Get JSX template for distance.
|
|
158
|
+
* @returns {JSX.Element}
|
|
159
|
+
*/
|
|
160
|
+
renderDistance() {
|
|
161
|
+
return (h("div", { class: "distance" }, h("mi-distance", { meters: this.location.properties.geodesicDistance, unit: this.unit })));
|
|
162
|
+
}
|
|
163
|
+
static get watchers() { return {
|
|
164
|
+
"icon": ["iconChanged"],
|
|
165
|
+
"iconBadge": ["iconBadgeChanged"],
|
|
166
|
+
"iconBadgeValue": ["iconBadgeValueChanged"]
|
|
167
|
+
}; }
|
|
168
|
+
};
|
|
169
|
+
ListItemLocation.style = listItemLocationCss;
|
|
170
|
+
|
|
171
|
+
export { ListItemLocation as mi_list_item_location };
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { r as registerInstance, h } from './index-7e9696f3.js';
|
|
2
|
+
|
|
3
|
+
const listCss = "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}";
|
|
4
|
+
|
|
5
|
+
const List = class {
|
|
6
|
+
constructor(hostRef) {
|
|
7
|
+
registerInstance(this, hostRef);
|
|
8
|
+
this.scrollButtonsEnabled = false;
|
|
9
|
+
this.scrollLength = 100;
|
|
10
|
+
}
|
|
11
|
+
componentDidLoad() {
|
|
12
|
+
this.addIntersectionObserver();
|
|
13
|
+
if (this.scrollButtonsEnabled) {
|
|
14
|
+
this.setScrollContainerElementRef();
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* @description Update state of scroll buttons when a "listItemDidRender" event is fired.
|
|
19
|
+
* @private
|
|
20
|
+
*/
|
|
21
|
+
updateScrollButtonsState() {
|
|
22
|
+
if (this.scrollButtonsEnabled && this.miScrollButtonsElement.scrollContainerElementRef) {
|
|
23
|
+
this.miScrollButtonsElement.updateScrollButtonsState();
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* @description Set scrollContainerElementRef attribute on miScrollButtonsElement.
|
|
28
|
+
* @private
|
|
29
|
+
*/
|
|
30
|
+
setScrollContainerElementRef() {
|
|
31
|
+
this.miScrollButtonsElement.scrollContainerElementRef = this.scrollContainerElement;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* @description Add intersection observer and update scroll buttons state on intersection – workaround to avoid the element not having any dimensions before it's shown.
|
|
35
|
+
* @private
|
|
36
|
+
*/
|
|
37
|
+
addIntersectionObserver() {
|
|
38
|
+
this.intersectionObserver = new IntersectionObserver((entries) => {
|
|
39
|
+
if (entries[0].intersectionRatio <= 0) {
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
// Disable scroll buttons if container element doesn't have scroll
|
|
43
|
+
if (this.scrollContainerElement.scrollHeight - this.scrollContainerElement.scrollTop === this.scrollContainerElement.clientHeight) {
|
|
44
|
+
this.updateScrollButtonsState();
|
|
45
|
+
}
|
|
46
|
+
this.intersectionObserver.disconnect();
|
|
47
|
+
});
|
|
48
|
+
this.intersectionObserver.observe(this.scrollContainerElement);
|
|
49
|
+
}
|
|
50
|
+
render() {
|
|
51
|
+
return (h("div", { class: "container" }, h("div", { role: "list", class: "scroll-container", ref: (el) => this.scrollContainerElement = el }, h("slot", null)), this.scrollButtonsEnabled ? h("mi-scroll-buttons", { scrollLength: this.scrollLength, ref: (el) => this.miScrollButtonsElement = el }) : null));
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
List.style = listCss;
|
|
55
|
+
|
|
56
|
+
export { List as mi_list };
|