@mapsindoors/map-template 1.0.0-rc.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.
- package/README.md +123 -0
- package/dist/_commonjsHelpers-ba3f0406-b96e6d6a.mjs +21 -0
- package/dist/combo-box-item.entry-92232c29.mjs +12 -0
- package/dist/combo-box-item.entry-f244c01a.mjs +14 -0
- package/dist/icon-b8d01d6f-ddfa2c17.mjs +24 -0
- package/dist/mapsindoors-react.es.js +7 -0
- package/dist/mapsindoors-react.umd.js +1391 -0
- package/dist/mapsindoors-webcomponent.es.js +5 -0
- package/dist/mapsindoors-webcomponent.umd.js +1385 -0
- package/dist/mi-card_2.entry-508f65b2.mjs +23 -0
- package/dist/mi-card_2.entry-d24478d0.mjs +25 -0
- package/dist/mi-chip.entry-74b3118c.mjs +15 -0
- package/dist/mi-chip.entry-8bfee95c.mjs +13 -0
- package/dist/mi-column.entry-f66623b9.mjs +20 -0
- package/dist/mi-column.entry-f901d5d1.mjs +18 -0
- package/dist/mi-combo-box.entry-0e6d9797.mjs +262 -0
- package/dist/mi-combo-box.entry-69a04955.mjs +260 -0
- package/dist/mi-data-table.entry-6cae08b0.mjs +215 -0
- package/dist/mi-data-table.entry-7fe09cbe.mjs +213 -0
- package/dist/mi-distance_2.entry-dca308c3.mjs +54 -0
- package/dist/mi-distance_2.entry-dffb2e64.mjs +56 -0
- package/dist/mi-dropdown-item.entry-508c6605.mjs +12 -0
- package/dist/mi-dropdown-item.entry-b6aa9d36.mjs +14 -0
- package/dist/mi-dropdown.entry-43258637.mjs +296 -0
- package/dist/mi-dropdown.entry-e1325610.mjs +298 -0
- package/dist/mi-keyboard.entry-60e47fb9.mjs +2962 -0
- package/dist/mi-keyboard.entry-c97c80e8.mjs +2960 -0
- package/dist/mi-list-item-category.entry-b0f61751.mjs +38 -0
- package/dist/mi-list-item-category.entry-bcac342a.mjs +36 -0
- package/dist/mi-list-item-location.entry-15ec9c7e.mjs +125 -0
- package/dist/mi-list-item-location.entry-ee56967a.mjs +127 -0
- package/dist/mi-list.entry-656130ea.mjs +41 -0
- package/dist/mi-list.entry-c8f1f377.mjs +39 -0
- package/dist/mi-location-booking.entry-a5b9b331.mjs +4863 -0
- package/dist/mi-location-booking.entry-ea841d6e.mjs +4865 -0
- package/dist/mi-location-info.entry-89b37774.mjs +22 -0
- package/dist/mi-location-info.entry-fe2c6c32.mjs +24 -0
- package/dist/mi-map-googlemaps.entry-6cb264de.mjs +398 -0
- package/dist/mi-map-googlemaps.entry-8877f16d.mjs +396 -0
- package/dist/mi-map-mapbox.entry-7a41963d.mjs +298 -0
- package/dist/mi-map-mapbox.entry-928da21a.mjs +300 -0
- package/dist/mi-metric-card.entry-51daca25.mjs +28 -0
- package/dist/mi-metric-card.entry-95dbb9f1.mjs +26 -0
- package/dist/mi-notification.entry-29b28ba8.mjs +81 -0
- package/dist/mi-notification.entry-f7677761.mjs +83 -0
- package/dist/mi-route-instructions-heading.entry-79c22cdd.mjs +72 -0
- package/dist/mi-route-instructions-heading.entry-a4c7f18f.mjs +74 -0
- package/dist/mi-route-instructions-maneuver_2.entry-383704ad.mjs +115 -0
- package/dist/mi-route-instructions-maneuver_2.entry-80c51e6a.mjs +113 -0
- package/dist/mi-route-instructions-step-legacy.entry-785cb60b.mjs +199 -0
- package/dist/mi-route-instructions-step-legacy.entry-eff068ed.mjs +201 -0
- package/dist/mi-route-instructions-step.entry-272e3c84.mjs +199 -0
- package/dist/mi-route-instructions-step.entry-95f5dc43.mjs +201 -0
- package/dist/mi-route-instructions.entry-0628d220.mjs +139 -0
- package/dist/mi-route-instructions.entry-1b4fb352.mjs +141 -0
- package/dist/mi-scroll-buttons.entry-274b003f.mjs +48 -0
- package/dist/mi-scroll-buttons.entry-6132935b.mjs +46 -0
- package/dist/mi-search.entry-994c0189.mjs +206 -0
- package/dist/mi-search.entry-d0e582d1.mjs +208 -0
- package/dist/mi-share-sms.entry-ae15cf77.mjs +53 -0
- package/dist/mi-share-sms.entry-ced7f275.mjs +55 -0
- package/dist/mi-step-switcher.entry-812a5096.mjs +24 -0
- package/dist/mi-step-switcher.entry-c9e28e79.mjs +26 -0
- package/dist/mi-tab-panel.entry-63c34f28.mjs +19 -0
- package/dist/mi-tab-panel.entry-bde9bd39.mjs +21 -0
- package/dist/mi-tab.entry-1767468e.mjs +13 -0
- package/dist/mi-tab.entry-b5ac50ac.mjs +11 -0
- package/dist/mi-tabs.entry-1b8327bf.mjs +34 -0
- package/dist/mi-tabs.entry-bd190e21.mjs +36 -0
- package/dist/mi-variables-9a6c8d4d-e06eec88.mjs +7 -0
- package/dist/reactcomponent-2f9f051f.mjs +27190 -0
- package/dist/route-travel-mode.enum-7f4ce9c7-a9c95a83.mjs +7 -0
- package/dist/sort-order.enum-64ce8998-b75ac596.mjs +317 -0
- package/dist/unit-system.enum-eaefb53e-0f424da4.mjs +7 -0
- package/dist/utils-ae714467-b07fc3be.mjs +36 -0
- package/dist/webcomponent-a10be1e6.mjs +31969 -0
- package/package.json +53 -0
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
import { r as v, c as m, h as d, H as M } from "./webcomponent-a10be1e6.mjs";
|
|
2
|
+
import { c as f, g as D } from "./_commonjsHelpers-ba3f0406-b96e6d6a.mjs";
|
|
3
|
+
var g = f(function(e, t) {
|
|
4
|
+
Object.defineProperty(t, "__esModule", {
|
|
5
|
+
value: !0
|
|
6
|
+
}), t.default = o, t.debounce = u;
|
|
7
|
+
var n = 500;
|
|
8
|
+
t.DEFAULT_DEBOUNCE_DURATION = n;
|
|
9
|
+
function o(i) {
|
|
10
|
+
return function(s, a, l) {
|
|
11
|
+
return {
|
|
12
|
+
configurable: !0,
|
|
13
|
+
enumerable: l.enumerable,
|
|
14
|
+
get: function() {
|
|
15
|
+
return Object.defineProperty(this, a, {
|
|
16
|
+
configurable: !0,
|
|
17
|
+
enumerable: l.enumerable,
|
|
18
|
+
value: u(l.value, i)
|
|
19
|
+
}), this[a];
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
function u(i) {
|
|
25
|
+
var r = arguments.length <= 1 || arguments[1] === void 0 ? n : arguments[1], s = void 0;
|
|
26
|
+
function a() {
|
|
27
|
+
for (var l = this, c = arguments.length, h = Array(c), p = 0; p < c; p++)
|
|
28
|
+
h[p] = arguments[p];
|
|
29
|
+
a.clear(), s = setTimeout(function() {
|
|
30
|
+
s = null, i.apply(l, h);
|
|
31
|
+
}, r);
|
|
32
|
+
}
|
|
33
|
+
return a.clear = function() {
|
|
34
|
+
s && (clearTimeout(s), s = null);
|
|
35
|
+
}, a;
|
|
36
|
+
}
|
|
37
|
+
}), I = f(function(e, t) {
|
|
38
|
+
Object.defineProperty(t, "__esModule", {
|
|
39
|
+
value: !0
|
|
40
|
+
});
|
|
41
|
+
function n(r, s) {
|
|
42
|
+
var a = s({}, r);
|
|
43
|
+
return delete a.default, a;
|
|
44
|
+
}
|
|
45
|
+
function o(r, s) {
|
|
46
|
+
for (var a = Object.getOwnPropertyNames(s), l = 0; l < a.length; l++) {
|
|
47
|
+
var c = a[l], h = Object.getOwnPropertyDescriptor(s, c);
|
|
48
|
+
h && h.configurable && r[c] === void 0 && Object.defineProperty(r, c, h);
|
|
49
|
+
}
|
|
50
|
+
return r;
|
|
51
|
+
}
|
|
52
|
+
function u(r) {
|
|
53
|
+
return r && r.__esModule ? r : { default: r };
|
|
54
|
+
}
|
|
55
|
+
var i = u(g);
|
|
56
|
+
t.default = i.default, o(t, n(g, o));
|
|
57
|
+
});
|
|
58
|
+
const E = /* @__PURE__ */ D(I), A = 'mi-search{display:block;position:relative;}mi-search input[type=search]{border-radius:8px;background-color:#ffffff;padding-left:40px;height:48px;font-size:1rem;padding-right:40px;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";-webkit-appearance:none;-moz-appearance:none;appearance:none;width:100%;position:relative;background-image:url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTgiIGhlaWdodD0iMTgiIHZpZXdCb3g9IjAgMCAxOCAxOCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xMS43MSAxMUgxMi41TDE3LjQ5IDE2TDE2IDE3LjQ5TDExIDEyLjVWMTEuNzFMMTAuNzMgMTEuNDNDOS41OSAxMi40MSA4LjExIDEzIDYuNSAxM0MyLjkxIDEzIDAgMTAuMDkgMCA2LjVDMCAyLjkxIDIuOTEgMCA2LjUgMEMxMC4wOSAwIDEzIDIuOTEgMTMgNi41QzEzIDguMTEgMTIuNDEgOS41OSAxMS40MyAxMC43M0wxMS43MSAxMVpNMiA2LjVDMiA4Ljk5IDQuMDEgMTEgNi41IDExQzguOTkgMTEgMTEgOC45OSAxMSA2LjVDMTEgNC4wMSA4Ljk5IDIgNi41IDJDNC4wMSAyIDIgNC4wMSAyIDYuNVoiIGZpbGw9IiM4RDk4QUEiLz4KPC9zdmc+Cg==");background-repeat:no-repeat;background-position:16px center;border-color:#E6E6E6;color:var(--tailwind-colors-neutral-500);border:1px solid var(--tailwind-colors-gray-200)}mi-search input[type=search]:focus{border-color:#3b82f6;box-shadow:0 0 0 2px #cfe0fc;}mi-search input[type=search][disabled]{pointer-events:none}mi-search input::-webkit-search-cancel-button{-webkit-appearance:none}mi-search input::-ms-clear{display:none}mi-search input::-moz-search-clear-button{-moz-appearance:none}mi-search button{position:absolute;right:14px;top:50%;transform:translateY(-50%);width:20px;height:20px;background-color:#6b7280;border-radius:50%;padding:0;border-width:0;display:flex;align-items:center;justify-content:center}mi-search button:focus{outline:0}mi-search button svg{fill:white;width:10px;height:10px}';
|
|
59
|
+
var y = function(e, t, n, o) {
|
|
60
|
+
var u = arguments.length, i = u < 3 ? t : o === null ? o = Object.getOwnPropertyDescriptor(t, n) : o, r;
|
|
61
|
+
if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
|
|
62
|
+
i = Reflect.decorate(e, t, n, o);
|
|
63
|
+
else
|
|
64
|
+
for (var s = e.length - 1; s >= 0; s--)
|
|
65
|
+
(r = e[s]) && (i = (u < 3 ? r(i) : u > 3 ? r(t, n, i) : r(t, n)) || i);
|
|
66
|
+
return u > 3 && i && Object.defineProperty(t, n, i), i;
|
|
67
|
+
};
|
|
68
|
+
const b = class {
|
|
69
|
+
constructor(e) {
|
|
70
|
+
v(this, e), this.results = m(this, "results", 7), this.cleared = m(this, "cleared", 7), this.componentRendered = m(this, "componentRendered", 7), this.shortInput = m(this, "shortInput", 7), this.preventSearch = !1, this.placeholder = "", this.idAttribute = "", this.dataAttributes = {}, this.mapsindoors = !1, this.google = !1, this.miFields = "name,description,aliases,categories,externalId", this.miTake = void 0, this.miSkip = void 0, this.miOrder = void 0, this.miCategories = void 0, this.miNear = void 0, this.miVenue = void 0, this.gmCountryCode = void 0, this.value = void 0, this.disabled = !1;
|
|
71
|
+
}
|
|
72
|
+
valueChange(e) {
|
|
73
|
+
!e || !this.inputElement || e !== this.inputElement.value && (this.inputElement.value = e, this.preventSearch || this.inputChanged());
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Clear the input field.
|
|
77
|
+
*/
|
|
78
|
+
async clear() {
|
|
79
|
+
this.inputElement.value = "", this.value = "", this.lastRequested = null, this.cleared.emit();
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Programmatically trigger the search.
|
|
83
|
+
*/
|
|
84
|
+
triggerSearch() {
|
|
85
|
+
const e = this.inputElement.value;
|
|
86
|
+
this.search(e);
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Sets text to be shown in the search field.
|
|
90
|
+
* Setting it will not perform a search.
|
|
91
|
+
*/
|
|
92
|
+
setDisplayText(e) {
|
|
93
|
+
this.preventSearch = !0, this.value = e, this.preventSearch = !1;
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Set focus on the input field.
|
|
97
|
+
* The preventScroll boolean is passed as true to prevent the browser
|
|
98
|
+
* from scrolling the document to bring the newly-focused element into view.
|
|
99
|
+
*/
|
|
100
|
+
focusInput() {
|
|
101
|
+
this.inputElement.focus({ preventScroll: !0 });
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Perform the search.
|
|
105
|
+
*/
|
|
106
|
+
search(e) {
|
|
107
|
+
Promise.all([
|
|
108
|
+
this.makeMapsIndoorsQuery(e),
|
|
109
|
+
this.makeGooglePlacesQuery(e)
|
|
110
|
+
]).then((t) => {
|
|
111
|
+
this.lastRequested = e, this.pushResults(t[0].concat(t[1]));
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* Handles incoming input change event, eg. input field value has changed.
|
|
116
|
+
* The function is debounced 500ms to avoid firing too many requests while typing.
|
|
117
|
+
*/
|
|
118
|
+
inputChanged() {
|
|
119
|
+
const e = this.inputElement.value;
|
|
120
|
+
if (this.value = e, !this.preventSearch) {
|
|
121
|
+
if (e.length < 2) {
|
|
122
|
+
this.lastRequested = null, e.length === 1 ? this.shortInput.emit() : this.clear();
|
|
123
|
+
return;
|
|
124
|
+
}
|
|
125
|
+
e.length > 1 && e !== this.lastRequested && this.search(e);
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* Push the results via the results event.
|
|
130
|
+
* @param object[] Locations
|
|
131
|
+
*/
|
|
132
|
+
pushResults(e) {
|
|
133
|
+
this.results.emit(e);
|
|
134
|
+
}
|
|
135
|
+
/**
|
|
136
|
+
* Make MapsIndoors locations request based on given search query.
|
|
137
|
+
* @param {string} query
|
|
138
|
+
* @return {Promise<any[]>}
|
|
139
|
+
*/
|
|
140
|
+
makeMapsIndoorsQuery(e) {
|
|
141
|
+
if (!this.mapsindoors)
|
|
142
|
+
return Promise.resolve([]);
|
|
143
|
+
let t;
|
|
144
|
+
if (this.miNear && (t = this.miNear, /^(-?\d+(\.\d+)?),\s*(-?\d+(\.\d+)?)$/.test(this.miNear))) {
|
|
145
|
+
const n = this.miNear.split(",");
|
|
146
|
+
t = { lat: parseFloat(n[0]), lng: parseFloat(n[1]) };
|
|
147
|
+
}
|
|
148
|
+
return mapsindoors.services.LocationsService.getLocations({
|
|
149
|
+
q: e.trim(),
|
|
150
|
+
fields: this.miFields,
|
|
151
|
+
take: this.miTake,
|
|
152
|
+
skip: this.miSkip,
|
|
153
|
+
orderBy: this.miOrder,
|
|
154
|
+
near: t,
|
|
155
|
+
venue: this.miVenue,
|
|
156
|
+
categories: this.miCategories
|
|
157
|
+
});
|
|
158
|
+
}
|
|
159
|
+
/**
|
|
160
|
+
* Make Google Places autocomplete suggestion request.
|
|
161
|
+
* @param {string} query
|
|
162
|
+
* @return {Promise<any>}
|
|
163
|
+
*/
|
|
164
|
+
makeGooglePlacesQuery(e) {
|
|
165
|
+
return this.google ? this.googleAutocompleteService || (this.googleAutocompleteService = new google.maps.places.AutocompleteService()) : this.googleAutocompleteService = null, this.googleAutocompleteService ? new Promise((t) => {
|
|
166
|
+
const n = {
|
|
167
|
+
input: e
|
|
168
|
+
};
|
|
169
|
+
this.gmCountryCode && (n.componentRestrictions = { country: this.gmCountryCode }), this.googleAutocompleteService.getPlacePredictions(n, (o) => {
|
|
170
|
+
const u = (o || []).map((i) => ({
|
|
171
|
+
id: i.place_id,
|
|
172
|
+
type: "Feature",
|
|
173
|
+
properties: {
|
|
174
|
+
type: "google_places",
|
|
175
|
+
placeId: i.place_id,
|
|
176
|
+
name: i.structured_formatting.main_text,
|
|
177
|
+
subtitle: i.structured_formatting.secondary_text || "",
|
|
178
|
+
floor: 0
|
|
179
|
+
}
|
|
180
|
+
}));
|
|
181
|
+
t(u);
|
|
182
|
+
});
|
|
183
|
+
}) : Promise.resolve([]);
|
|
184
|
+
}
|
|
185
|
+
componentDidRender() {
|
|
186
|
+
if (this.dataAttributes)
|
|
187
|
+
for (const e in this.dataAttributes)
|
|
188
|
+
this.inputElement.setAttribute(e, this.dataAttributes[e]);
|
|
189
|
+
this.componentRendered.emit();
|
|
190
|
+
}
|
|
191
|
+
render() {
|
|
192
|
+
return d(M, null, d("input", { disabled: this.disabled, id: this.idAttribute ? this.idAttribute : null, type: "search", ref: (e) => this.inputElement = e, onInput: () => this.inputChanged(), placeholder: this.placeholder, autocomplete: "off" }), d("button", { type: "button", onClick: () => this.clear(), "aria-label": "Clear" }, d("svg", { width: "14", height: "14", viewBox: "0 0 14 14", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, d("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" }))));
|
|
193
|
+
}
|
|
194
|
+
static get watchers() {
|
|
195
|
+
return {
|
|
196
|
+
value: ["valueChange"]
|
|
197
|
+
};
|
|
198
|
+
}
|
|
199
|
+
};
|
|
200
|
+
y([
|
|
201
|
+
E(500)
|
|
202
|
+
], b.prototype, "inputChanged", null);
|
|
203
|
+
b.style = A;
|
|
204
|
+
export {
|
|
205
|
+
b as mi_search
|
|
206
|
+
};
|
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
import { r as v, c as m, h as d, H as M } from "./reactcomponent-2f9f051f.mjs";
|
|
2
|
+
import { c as f, g as D } from "./_commonjsHelpers-ba3f0406-b96e6d6a.mjs";
|
|
3
|
+
import "react";
|
|
4
|
+
import "react-dom";
|
|
5
|
+
var g = f(function(e, t) {
|
|
6
|
+
Object.defineProperty(t, "__esModule", {
|
|
7
|
+
value: !0
|
|
8
|
+
}), t.default = o, t.debounce = u;
|
|
9
|
+
var n = 500;
|
|
10
|
+
t.DEFAULT_DEBOUNCE_DURATION = n;
|
|
11
|
+
function o(i) {
|
|
12
|
+
return function(s, a, l) {
|
|
13
|
+
return {
|
|
14
|
+
configurable: !0,
|
|
15
|
+
enumerable: l.enumerable,
|
|
16
|
+
get: function() {
|
|
17
|
+
return Object.defineProperty(this, a, {
|
|
18
|
+
configurable: !0,
|
|
19
|
+
enumerable: l.enumerable,
|
|
20
|
+
value: u(l.value, i)
|
|
21
|
+
}), this[a];
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
function u(i) {
|
|
27
|
+
var r = arguments.length <= 1 || arguments[1] === void 0 ? n : arguments[1], s = void 0;
|
|
28
|
+
function a() {
|
|
29
|
+
for (var l = this, c = arguments.length, h = Array(c), p = 0; p < c; p++)
|
|
30
|
+
h[p] = arguments[p];
|
|
31
|
+
a.clear(), s = setTimeout(function() {
|
|
32
|
+
s = null, i.apply(l, h);
|
|
33
|
+
}, r);
|
|
34
|
+
}
|
|
35
|
+
return a.clear = function() {
|
|
36
|
+
s && (clearTimeout(s), s = null);
|
|
37
|
+
}, a;
|
|
38
|
+
}
|
|
39
|
+
}), I = f(function(e, t) {
|
|
40
|
+
Object.defineProperty(t, "__esModule", {
|
|
41
|
+
value: !0
|
|
42
|
+
});
|
|
43
|
+
function n(r, s) {
|
|
44
|
+
var a = s({}, r);
|
|
45
|
+
return delete a.default, a;
|
|
46
|
+
}
|
|
47
|
+
function o(r, s) {
|
|
48
|
+
for (var a = Object.getOwnPropertyNames(s), l = 0; l < a.length; l++) {
|
|
49
|
+
var c = a[l], h = Object.getOwnPropertyDescriptor(s, c);
|
|
50
|
+
h && h.configurable && r[c] === void 0 && Object.defineProperty(r, c, h);
|
|
51
|
+
}
|
|
52
|
+
return r;
|
|
53
|
+
}
|
|
54
|
+
function u(r) {
|
|
55
|
+
return r && r.__esModule ? r : { default: r };
|
|
56
|
+
}
|
|
57
|
+
var i = u(g);
|
|
58
|
+
t.default = i.default, o(t, n(g, o));
|
|
59
|
+
});
|
|
60
|
+
const E = /* @__PURE__ */ D(I), A = 'mi-search{display:block;position:relative;}mi-search input[type=search]{border-radius:8px;background-color:#ffffff;padding-left:40px;height:48px;font-size:1rem;padding-right:40px;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";-webkit-appearance:none;-moz-appearance:none;appearance:none;width:100%;position:relative;background-image:url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTgiIGhlaWdodD0iMTgiIHZpZXdCb3g9IjAgMCAxOCAxOCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xMS43MSAxMUgxMi41TDE3LjQ5IDE2TDE2IDE3LjQ5TDExIDEyLjVWMTEuNzFMMTAuNzMgMTEuNDNDOS41OSAxMi40MSA4LjExIDEzIDYuNSAxM0MyLjkxIDEzIDAgMTAuMDkgMCA2LjVDMCAyLjkxIDIuOTEgMCA2LjUgMEMxMC4wOSAwIDEzIDIuOTEgMTMgNi41QzEzIDguMTEgMTIuNDEgOS41OSAxMS40MyAxMC43M0wxMS43MSAxMVpNMiA2LjVDMiA4Ljk5IDQuMDEgMTEgNi41IDExQzguOTkgMTEgMTEgOC45OSAxMSA2LjVDMTEgNC4wMSA4Ljk5IDIgNi41IDJDNC4wMSAyIDIgNC4wMSAyIDYuNVoiIGZpbGw9IiM4RDk4QUEiLz4KPC9zdmc+Cg==");background-repeat:no-repeat;background-position:16px center;border-color:#E6E6E6;color:var(--tailwind-colors-neutral-500);border:1px solid var(--tailwind-colors-gray-200)}mi-search input[type=search]:focus{border-color:#3b82f6;box-shadow:0 0 0 2px #cfe0fc;}mi-search input[type=search][disabled]{pointer-events:none}mi-search input::-webkit-search-cancel-button{-webkit-appearance:none}mi-search input::-ms-clear{display:none}mi-search input::-moz-search-clear-button{-moz-appearance:none}mi-search button{position:absolute;right:14px;top:50%;transform:translateY(-50%);width:20px;height:20px;background-color:#6b7280;border-radius:50%;padding:0;border-width:0;display:flex;align-items:center;justify-content:center}mi-search button:focus{outline:0}mi-search button svg{fill:white;width:10px;height:10px}';
|
|
61
|
+
var y = function(e, t, n, o) {
|
|
62
|
+
var u = arguments.length, i = u < 3 ? t : o === null ? o = Object.getOwnPropertyDescriptor(t, n) : o, r;
|
|
63
|
+
if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
|
|
64
|
+
i = Reflect.decorate(e, t, n, o);
|
|
65
|
+
else
|
|
66
|
+
for (var s = e.length - 1; s >= 0; s--)
|
|
67
|
+
(r = e[s]) && (i = (u < 3 ? r(i) : u > 3 ? r(t, n, i) : r(t, n)) || i);
|
|
68
|
+
return u > 3 && i && Object.defineProperty(t, n, i), i;
|
|
69
|
+
};
|
|
70
|
+
const b = class {
|
|
71
|
+
constructor(e) {
|
|
72
|
+
v(this, e), this.results = m(this, "results", 7), this.cleared = m(this, "cleared", 7), this.componentRendered = m(this, "componentRendered", 7), this.shortInput = m(this, "shortInput", 7), this.preventSearch = !1, this.placeholder = "", this.idAttribute = "", this.dataAttributes = {}, this.mapsindoors = !1, this.google = !1, this.miFields = "name,description,aliases,categories,externalId", this.miTake = void 0, this.miSkip = void 0, this.miOrder = void 0, this.miCategories = void 0, this.miNear = void 0, this.miVenue = void 0, this.gmCountryCode = void 0, this.value = void 0, this.disabled = !1;
|
|
73
|
+
}
|
|
74
|
+
valueChange(e) {
|
|
75
|
+
!e || !this.inputElement || e !== this.inputElement.value && (this.inputElement.value = e, this.preventSearch || this.inputChanged());
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Clear the input field.
|
|
79
|
+
*/
|
|
80
|
+
async clear() {
|
|
81
|
+
this.inputElement.value = "", this.value = "", this.lastRequested = null, this.cleared.emit();
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Programmatically trigger the search.
|
|
85
|
+
*/
|
|
86
|
+
triggerSearch() {
|
|
87
|
+
const e = this.inputElement.value;
|
|
88
|
+
this.search(e);
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Sets text to be shown in the search field.
|
|
92
|
+
* Setting it will not perform a search.
|
|
93
|
+
*/
|
|
94
|
+
setDisplayText(e) {
|
|
95
|
+
this.preventSearch = !0, this.value = e, this.preventSearch = !1;
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Set focus on the input field.
|
|
99
|
+
* The preventScroll boolean is passed as true to prevent the browser
|
|
100
|
+
* from scrolling the document to bring the newly-focused element into view.
|
|
101
|
+
*/
|
|
102
|
+
focusInput() {
|
|
103
|
+
this.inputElement.focus({ preventScroll: !0 });
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* Perform the search.
|
|
107
|
+
*/
|
|
108
|
+
search(e) {
|
|
109
|
+
Promise.all([
|
|
110
|
+
this.makeMapsIndoorsQuery(e),
|
|
111
|
+
this.makeGooglePlacesQuery(e)
|
|
112
|
+
]).then((t) => {
|
|
113
|
+
this.lastRequested = e, this.pushResults(t[0].concat(t[1]));
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* Handles incoming input change event, eg. input field value has changed.
|
|
118
|
+
* The function is debounced 500ms to avoid firing too many requests while typing.
|
|
119
|
+
*/
|
|
120
|
+
inputChanged() {
|
|
121
|
+
const e = this.inputElement.value;
|
|
122
|
+
if (this.value = e, !this.preventSearch) {
|
|
123
|
+
if (e.length < 2) {
|
|
124
|
+
this.lastRequested = null, e.length === 1 ? this.shortInput.emit() : this.clear();
|
|
125
|
+
return;
|
|
126
|
+
}
|
|
127
|
+
e.length > 1 && e !== this.lastRequested && this.search(e);
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* Push the results via the results event.
|
|
132
|
+
* @param object[] Locations
|
|
133
|
+
*/
|
|
134
|
+
pushResults(e) {
|
|
135
|
+
this.results.emit(e);
|
|
136
|
+
}
|
|
137
|
+
/**
|
|
138
|
+
* Make MapsIndoors locations request based on given search query.
|
|
139
|
+
* @param {string} query
|
|
140
|
+
* @return {Promise<any[]>}
|
|
141
|
+
*/
|
|
142
|
+
makeMapsIndoorsQuery(e) {
|
|
143
|
+
if (!this.mapsindoors)
|
|
144
|
+
return Promise.resolve([]);
|
|
145
|
+
let t;
|
|
146
|
+
if (this.miNear && (t = this.miNear, /^(-?\d+(\.\d+)?),\s*(-?\d+(\.\d+)?)$/.test(this.miNear))) {
|
|
147
|
+
const n = this.miNear.split(",");
|
|
148
|
+
t = { lat: parseFloat(n[0]), lng: parseFloat(n[1]) };
|
|
149
|
+
}
|
|
150
|
+
return mapsindoors.services.LocationsService.getLocations({
|
|
151
|
+
q: e.trim(),
|
|
152
|
+
fields: this.miFields,
|
|
153
|
+
take: this.miTake,
|
|
154
|
+
skip: this.miSkip,
|
|
155
|
+
orderBy: this.miOrder,
|
|
156
|
+
near: t,
|
|
157
|
+
venue: this.miVenue,
|
|
158
|
+
categories: this.miCategories
|
|
159
|
+
});
|
|
160
|
+
}
|
|
161
|
+
/**
|
|
162
|
+
* Make Google Places autocomplete suggestion request.
|
|
163
|
+
* @param {string} query
|
|
164
|
+
* @return {Promise<any>}
|
|
165
|
+
*/
|
|
166
|
+
makeGooglePlacesQuery(e) {
|
|
167
|
+
return this.google ? this.googleAutocompleteService || (this.googleAutocompleteService = new google.maps.places.AutocompleteService()) : this.googleAutocompleteService = null, this.googleAutocompleteService ? new Promise((t) => {
|
|
168
|
+
const n = {
|
|
169
|
+
input: e
|
|
170
|
+
};
|
|
171
|
+
this.gmCountryCode && (n.componentRestrictions = { country: this.gmCountryCode }), this.googleAutocompleteService.getPlacePredictions(n, (o) => {
|
|
172
|
+
const u = (o || []).map((i) => ({
|
|
173
|
+
id: i.place_id,
|
|
174
|
+
type: "Feature",
|
|
175
|
+
properties: {
|
|
176
|
+
type: "google_places",
|
|
177
|
+
placeId: i.place_id,
|
|
178
|
+
name: i.structured_formatting.main_text,
|
|
179
|
+
subtitle: i.structured_formatting.secondary_text || "",
|
|
180
|
+
floor: 0
|
|
181
|
+
}
|
|
182
|
+
}));
|
|
183
|
+
t(u);
|
|
184
|
+
});
|
|
185
|
+
}) : Promise.resolve([]);
|
|
186
|
+
}
|
|
187
|
+
componentDidRender() {
|
|
188
|
+
if (this.dataAttributes)
|
|
189
|
+
for (const e in this.dataAttributes)
|
|
190
|
+
this.inputElement.setAttribute(e, this.dataAttributes[e]);
|
|
191
|
+
this.componentRendered.emit();
|
|
192
|
+
}
|
|
193
|
+
render() {
|
|
194
|
+
return d(M, null, d("input", { disabled: this.disabled, id: this.idAttribute ? this.idAttribute : null, type: "search", ref: (e) => this.inputElement = e, onInput: () => this.inputChanged(), placeholder: this.placeholder, autocomplete: "off" }), d("button", { type: "button", onClick: () => this.clear(), "aria-label": "Clear" }, d("svg", { width: "14", height: "14", viewBox: "0 0 14 14", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, d("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" }))));
|
|
195
|
+
}
|
|
196
|
+
static get watchers() {
|
|
197
|
+
return {
|
|
198
|
+
value: ["valueChange"]
|
|
199
|
+
};
|
|
200
|
+
}
|
|
201
|
+
};
|
|
202
|
+
y([
|
|
203
|
+
E(500)
|
|
204
|
+
], b.prototype, "inputChanged", null);
|
|
205
|
+
b.style = A;
|
|
206
|
+
export {
|
|
207
|
+
b as mi_search
|
|
208
|
+
};
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { r as a, c as i, h as e } from "./webcomponent-a10be1e6.mjs";
|
|
2
|
+
const d = 'a.mi-button{cursor:default}.mi-button{border-radius:4px;border-width:1px;border-style:solid;font-family:Inter, -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";font-size:1rem;font-weight:500;padding-left:16px;padding-right:16px;padding-top:12px;padding-bottom:12px;display:inline-flex;align-items:center}.mi-button:disabled{opacity:0.48;cursor:not-allowed}.mi-button object{filter:invert(9%) sepia(13%) saturate(692%) hue-rotate(185deg) brightness(98%) contrast(91%);width:16px;height:16px}.mi-button--small{padding-left:12px;padding-right:12px;padding-top:8px;padding-bottom:8px;font-size:0.875rem;height:32px}.mi-button--small object{width:16px;height:16px}.mi-button--large{padding-left:16px;padding-right:16px;font-size:1.25rem}.mi-button--large object{width:20px;height:20px}.mi-button--full-width{width:100%;justify-content:center}.mi-button--icon-left{padding-left:12px}.mi-button--icon-left object{margin-right:8px}.mi-button--icon-right{padding-right:12px}.mi-button--icon-right object{margin-left:8px}.mi-button--icon-both{padding-top:12px;padding-bottom:12px}.mi-button--icon-both object:first-of-type{margin-right:8px}.mi-button--icon-both object:last-of-type{margin-left:8px}.mi-button--base{background:linear-gradient(#f5f7fa, #ebeff5);color:#1e2025;border-color:#c8d0e0}.mi-button--base:not(:disabled):hover{background:linear-gradient(#ebeff5, #dee3ed);border-color:#aeb9cb}.mi-button--base:not(:disabled):active{background:linear-gradient(#dee3ed, #ebeff5)}.mi-button--primary{color:#ffffff;border-color:#20693e;background:linear-gradient(#3ba064, #2a844e)}.mi-button--primary object{filter:invert(100%) sepia(93%) saturate(0%) hue-rotate(201deg) brightness(106%) contrast(106%)}.mi-button--primary:not(:disabled):hover{background:linear-gradient(#2a844e, #20693e)}.mi-button--primary:not(:disabled):active{background:linear-gradient(#20693e, #2a844e)}.mi-button--delete{background:linear-gradient(#f55151, #de1b1b);color:#ffffff;border-color:#ba0d0d}.mi-button--delete object{filter:invert(100%) sepia(93%) saturate(0%) hue-rotate(201deg) brightness(106%) contrast(106%)}.mi-button--delete:not(:disabled):hover{background:linear-gradient(#de1b1b, #ba0d0d)}.mi-button--delete:not(:disabled):active{background:linear-gradient(#ba0d0d, #de1b1b)}.mi-button--outline{color:#3071d9;border-color:#3071d9;background-color:transparent}.mi-button--outline object{filter:invert(38%) sepia(97%) saturate(742%) hue-rotate(188deg) brightness(86%) contrast(97%)}.mi-button--outline:not(:disabled):hover{color:#1d5bbf;border-color:#1d5bbf;background-color:#eef4fc}.mi-button--outline:not(:disabled):active{color:#1d5bbf;border-color:#1d5bbf;background-color:#cfe0fc}.mi-button--link{color:#3071d9;border-style:none;background-color:transparent;cursor:pointer}.mi-button--link object{filter:invert(38%) sepia(97%) saturate(742%) hue-rotate(188deg) brightness(86%) contrast(97%)}.mi-button--link:not(:disabled):hover{color:#1d5bbf;border-color:#1d5bbf;background-color:#eef4fc}.mi-button--link:disabled:hover{cursor:not-allowed}.mi-button--link:not(:disabled):active{color:#1d5bbf;border-color:#1d5bbf;background-color:#cfe0fc}.width-none{width:0}.width-xxx-small{width:2px}.width-xx-small{width:4px}.width-x-small{width:8px}.width-small{width:12px}.width-medium{width:16px}.width-large{width:24px}.width-x-large{width:32px}.width-xx-large{width:40px}.width-xxx-large{width:48px}.width-xxxx-large{width:64px}.min-width-none{min-width:0}.min-width-xxx-small{min-width:2px}.min-width-xx-small{min-width:4px}.min-width-x-small{min-width:8px}.min-width-small{min-width:12px}.min-width-medium{min-width:16px}.min-width-large{min-width:24px}.min-width-x-large{min-width:32px}.min-width-xx-large{min-width:40px}.min-width-xxx-large{min-width:48px}.min-width-xxxx-large{min-width:64px}.max-width-none{max-width:0}.max-width-xxx-small{max-width:2px}.max-width-xx-small{max-width:4px}.max-width-x-small{max-width:8px}.max-width-small{max-width:12px}.max-width-medium{max-width:16px}.max-width-large{max-width:24px}.max-width-x-large{max-width:32px}.max-width-xx-large{max-width:40px}.max-width-xxx-large{max-width:48px}.max-width-xxxx-large{max-width:64px}.height-none{height:0}.height-xxx-small{height:2px}.height-xx-small{height:4px}.height-x-small{height:8px}.height-small{height:12px}.height-medium{height:16px}.height-large{height:24px}.height-x-large{height:32px}.height-xx-large{height:40px}.height-xxx-large{height:48px}.height-xxxx-large{height:64px}.min-height-none{min-height:0}.min-height-xxx-small{min-height:2px}.min-height-xx-small{min-height:4px}.min-height-x-small{min-height:8px}.min-height-small{min-height:12px}.min-height-medium{min-height:16px}.min-height-large{min-height:24px}.min-height-x-large{min-height:32px}.min-height-xx-large{min-height:40px}.min-height-xxx-large{min-height:48px}.min-height-xxxx-large{min-height:64px}.max-height-none{max-height:0}.max-height-xxx-small{max-height:2px}.max-height-xx-small{max-height:4px}.max-height-x-small{max-height:8px}.max-height-small{max-height:12px}.max-height-medium{max-height:16px}.max-height-large{max-height:24px}.max-height-x-large{max-height:32px}.max-height-xx-large{max-height:40px}.max-height-xxx-large{max-height:48px}.max-height-xxxx-large{max-height:64px}.debug *{outline:1px solid gold}.flex{display:flex;flex:1}.inline-flex{display:inline-flex}.items-center{align-items:center}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.display-block{display:block}.display-inline-block{display:inline-block}.display-inline{display:inline}.display-none{display:none}.text-decoration-none{text-decoration:none}.text-right{text-align:right}.text-left{text-align:left}.text-center{text-align:center}.margin-auto{margin-left:auto;margin-right:auto}form .inputs{margin:0 auto;width:80%;padding-top:32px;padding-bottom:32px;position:relative;display:flex;flex-direction:row;align-items:center}form .inputs span.plus-sign{position:absolute;left:16px;display:block;font-size:1rem;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";color:#1c1917;top:50%;transform:translateY(-50%)}form .inputs input{padding-left:12px;padding-right:12px;background-color:#ffffff;border-style:solid;border-width:1px;border-radius:8px;height:48px;font-size:1.25rem;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";color:#1c1917;box-sizing:border-box}form .inputs input:focus{border-color:#3b82f6;box-shadow:0 0 0 2px #dbeafe}form .inputs input.country-code{width:15%;min-width:88px;margin-right:16px;padding-left:32px}form .inputs input.phone-number{width:85%}form button{margin-top:32px;margin-bottom:24px}', l = class {
|
|
3
|
+
constructor(t) {
|
|
4
|
+
a(this, t), this.successfullySent = i(this, "successfullySent", 7), this.unsuccessfullySent = i(this, "unsuccessfullySent", 7), this.submitFormHandler = (n) => {
|
|
5
|
+
n.preventDefault();
|
|
6
|
+
const o = !!(this.venueId && this.originLocationId && this.destinationLocationId);
|
|
7
|
+
if (!this.formElement.checkValidity() || !o) {
|
|
8
|
+
this.countryCodeInputElement.validity.valid || this.countryCodeInputElement.focus(), this.phoneNumberInputElement.validity.valid || this.phoneNumberInputElement.focus();
|
|
9
|
+
return;
|
|
10
|
+
}
|
|
11
|
+
mapsindoors.services.ShareService.directionsToPhone(this.venueId, this.originLocationId, this.destinationLocationId, this.countryCodeInputElement.value, this.phoneNumberInputElement.value).then(() => this.successfullySent.emit()).catch((r) => this.unsuccessfullySent.emit(r));
|
|
12
|
+
}, this.venueId = void 0, this.originLocationId = void 0, this.destinationLocationId = void 0, this.countryCode = "1", this.phoneNumberInputPlaceholder = "Enter phone number", this.submitButtonLabel = "Send SMS";
|
|
13
|
+
}
|
|
14
|
+
componentDidRender() {
|
|
15
|
+
this.countryCodeInputElement.value = this.countryCode;
|
|
16
|
+
}
|
|
17
|
+
componentDidLoad() {
|
|
18
|
+
this.addIntersectionObserver();
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Observe the input field for phone number and focus it on intersection.
|
|
22
|
+
*/
|
|
23
|
+
addIntersectionObserver() {
|
|
24
|
+
this.intersectionObserver = new IntersectionObserver((t) => {
|
|
25
|
+
t[0].intersectionRatio <= 0 || (this.phoneNumberInputElement.focus(), this.intersectionObserver.disconnect());
|
|
26
|
+
}), this.intersectionObserver.observe(this.phoneNumberInputElement);
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Set input attribute on mi-keyboard component.
|
|
30
|
+
*
|
|
31
|
+
* @param {FocusEvent} event
|
|
32
|
+
*/
|
|
33
|
+
setKeyboardInputElement(t) {
|
|
34
|
+
this.miKeyboardElement.inputElement = t.target;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Update form validity.
|
|
38
|
+
*/
|
|
39
|
+
updateFormValidity() {
|
|
40
|
+
if (!this.formElement.checkValidity()) {
|
|
41
|
+
this.submitButtonElement.disabled = !0;
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
this.submitButtonElement.disabled = !1;
|
|
45
|
+
}
|
|
46
|
+
render() {
|
|
47
|
+
return e("form", { onSubmit: this.submitFormHandler, ref: (t) => this.formElement = t }, e("div", { class: "inputs" }, e("span", { class: "plus-sign" }, "+"), e("input", { id: "country-code", class: "country-code", pattern: "[0-9]{1,3}", required: !0, autocomplete: "off", type: "text", placeholder: this.countryCode, ref: (t) => this.countryCodeInputElement = t, onInput: () => this.updateFormValidity(), onFocus: (t) => this.setKeyboardInputElement(t) }), e("input", { id: "phone-number", class: "phone-number", pattern: "[0-9]{6,10}", required: !0, autocomplete: "off", type: "text", placeholder: this.phoneNumberInputPlaceholder, ref: (t) => this.phoneNumberInputElement = t, onInput: () => this.updateFormValidity(), onFocus: (t) => this.setKeyboardInputElement(t) })), e("mi-keyboard", { layout: "numeric", ref: (t) => this.miKeyboardElement = t }), e("div", { class: "flex justify-center" }, e("button", { type: "submit", disabled: !0, class: "mi-button mi-button--primary", ref: (t) => this.submitButtonElement = t }, this.submitButtonLabel)));
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
l.style = d;
|
|
51
|
+
export {
|
|
52
|
+
l as mi_share_sms
|
|
53
|
+
};
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { r as a, c as i, h as e } from "./reactcomponent-2f9f051f.mjs";
|
|
2
|
+
import "react";
|
|
3
|
+
import "react-dom";
|
|
4
|
+
const d = 'a.mi-button{cursor:default}.mi-button{border-radius:4px;border-width:1px;border-style:solid;font-family:Inter, -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";font-size:1rem;font-weight:500;padding-left:16px;padding-right:16px;padding-top:12px;padding-bottom:12px;display:inline-flex;align-items:center}.mi-button:disabled{opacity:0.48;cursor:not-allowed}.mi-button object{filter:invert(9%) sepia(13%) saturate(692%) hue-rotate(185deg) brightness(98%) contrast(91%);width:16px;height:16px}.mi-button--small{padding-left:12px;padding-right:12px;padding-top:8px;padding-bottom:8px;font-size:0.875rem;height:32px}.mi-button--small object{width:16px;height:16px}.mi-button--large{padding-left:16px;padding-right:16px;font-size:1.25rem}.mi-button--large object{width:20px;height:20px}.mi-button--full-width{width:100%;justify-content:center}.mi-button--icon-left{padding-left:12px}.mi-button--icon-left object{margin-right:8px}.mi-button--icon-right{padding-right:12px}.mi-button--icon-right object{margin-left:8px}.mi-button--icon-both{padding-top:12px;padding-bottom:12px}.mi-button--icon-both object:first-of-type{margin-right:8px}.mi-button--icon-both object:last-of-type{margin-left:8px}.mi-button--base{background:linear-gradient(#f5f7fa, #ebeff5);color:#1e2025;border-color:#c8d0e0}.mi-button--base:not(:disabled):hover{background:linear-gradient(#ebeff5, #dee3ed);border-color:#aeb9cb}.mi-button--base:not(:disabled):active{background:linear-gradient(#dee3ed, #ebeff5)}.mi-button--primary{color:#ffffff;border-color:#20693e;background:linear-gradient(#3ba064, #2a844e)}.mi-button--primary object{filter:invert(100%) sepia(93%) saturate(0%) hue-rotate(201deg) brightness(106%) contrast(106%)}.mi-button--primary:not(:disabled):hover{background:linear-gradient(#2a844e, #20693e)}.mi-button--primary:not(:disabled):active{background:linear-gradient(#20693e, #2a844e)}.mi-button--delete{background:linear-gradient(#f55151, #de1b1b);color:#ffffff;border-color:#ba0d0d}.mi-button--delete object{filter:invert(100%) sepia(93%) saturate(0%) hue-rotate(201deg) brightness(106%) contrast(106%)}.mi-button--delete:not(:disabled):hover{background:linear-gradient(#de1b1b, #ba0d0d)}.mi-button--delete:not(:disabled):active{background:linear-gradient(#ba0d0d, #de1b1b)}.mi-button--outline{color:#3071d9;border-color:#3071d9;background-color:transparent}.mi-button--outline object{filter:invert(38%) sepia(97%) saturate(742%) hue-rotate(188deg) brightness(86%) contrast(97%)}.mi-button--outline:not(:disabled):hover{color:#1d5bbf;border-color:#1d5bbf;background-color:#eef4fc}.mi-button--outline:not(:disabled):active{color:#1d5bbf;border-color:#1d5bbf;background-color:#cfe0fc}.mi-button--link{color:#3071d9;border-style:none;background-color:transparent;cursor:pointer}.mi-button--link object{filter:invert(38%) sepia(97%) saturate(742%) hue-rotate(188deg) brightness(86%) contrast(97%)}.mi-button--link:not(:disabled):hover{color:#1d5bbf;border-color:#1d5bbf;background-color:#eef4fc}.mi-button--link:disabled:hover{cursor:not-allowed}.mi-button--link:not(:disabled):active{color:#1d5bbf;border-color:#1d5bbf;background-color:#cfe0fc}.width-none{width:0}.width-xxx-small{width:2px}.width-xx-small{width:4px}.width-x-small{width:8px}.width-small{width:12px}.width-medium{width:16px}.width-large{width:24px}.width-x-large{width:32px}.width-xx-large{width:40px}.width-xxx-large{width:48px}.width-xxxx-large{width:64px}.min-width-none{min-width:0}.min-width-xxx-small{min-width:2px}.min-width-xx-small{min-width:4px}.min-width-x-small{min-width:8px}.min-width-small{min-width:12px}.min-width-medium{min-width:16px}.min-width-large{min-width:24px}.min-width-x-large{min-width:32px}.min-width-xx-large{min-width:40px}.min-width-xxx-large{min-width:48px}.min-width-xxxx-large{min-width:64px}.max-width-none{max-width:0}.max-width-xxx-small{max-width:2px}.max-width-xx-small{max-width:4px}.max-width-x-small{max-width:8px}.max-width-small{max-width:12px}.max-width-medium{max-width:16px}.max-width-large{max-width:24px}.max-width-x-large{max-width:32px}.max-width-xx-large{max-width:40px}.max-width-xxx-large{max-width:48px}.max-width-xxxx-large{max-width:64px}.height-none{height:0}.height-xxx-small{height:2px}.height-xx-small{height:4px}.height-x-small{height:8px}.height-small{height:12px}.height-medium{height:16px}.height-large{height:24px}.height-x-large{height:32px}.height-xx-large{height:40px}.height-xxx-large{height:48px}.height-xxxx-large{height:64px}.min-height-none{min-height:0}.min-height-xxx-small{min-height:2px}.min-height-xx-small{min-height:4px}.min-height-x-small{min-height:8px}.min-height-small{min-height:12px}.min-height-medium{min-height:16px}.min-height-large{min-height:24px}.min-height-x-large{min-height:32px}.min-height-xx-large{min-height:40px}.min-height-xxx-large{min-height:48px}.min-height-xxxx-large{min-height:64px}.max-height-none{max-height:0}.max-height-xxx-small{max-height:2px}.max-height-xx-small{max-height:4px}.max-height-x-small{max-height:8px}.max-height-small{max-height:12px}.max-height-medium{max-height:16px}.max-height-large{max-height:24px}.max-height-x-large{max-height:32px}.max-height-xx-large{max-height:40px}.max-height-xxx-large{max-height:48px}.max-height-xxxx-large{max-height:64px}.debug *{outline:1px solid gold}.flex{display:flex;flex:1}.inline-flex{display:inline-flex}.items-center{align-items:center}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.display-block{display:block}.display-inline-block{display:inline-block}.display-inline{display:inline}.display-none{display:none}.text-decoration-none{text-decoration:none}.text-right{text-align:right}.text-left{text-align:left}.text-center{text-align:center}.margin-auto{margin-left:auto;margin-right:auto}form .inputs{margin:0 auto;width:80%;padding-top:32px;padding-bottom:32px;position:relative;display:flex;flex-direction:row;align-items:center}form .inputs span.plus-sign{position:absolute;left:16px;display:block;font-size:1rem;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";color:#1c1917;top:50%;transform:translateY(-50%)}form .inputs input{padding-left:12px;padding-right:12px;background-color:#ffffff;border-style:solid;border-width:1px;border-radius:8px;height:48px;font-size:1.25rem;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";color:#1c1917;box-sizing:border-box}form .inputs input:focus{border-color:#3b82f6;box-shadow:0 0 0 2px #dbeafe}form .inputs input.country-code{width:15%;min-width:88px;margin-right:16px;padding-left:32px}form .inputs input.phone-number{width:85%}form button{margin-top:32px;margin-bottom:24px}', l = class {
|
|
5
|
+
constructor(t) {
|
|
6
|
+
a(this, t), this.successfullySent = i(this, "successfullySent", 7), this.unsuccessfullySent = i(this, "unsuccessfullySent", 7), this.submitFormHandler = (n) => {
|
|
7
|
+
n.preventDefault();
|
|
8
|
+
const o = !!(this.venueId && this.originLocationId && this.destinationLocationId);
|
|
9
|
+
if (!this.formElement.checkValidity() || !o) {
|
|
10
|
+
this.countryCodeInputElement.validity.valid || this.countryCodeInputElement.focus(), this.phoneNumberInputElement.validity.valid || this.phoneNumberInputElement.focus();
|
|
11
|
+
return;
|
|
12
|
+
}
|
|
13
|
+
mapsindoors.services.ShareService.directionsToPhone(this.venueId, this.originLocationId, this.destinationLocationId, this.countryCodeInputElement.value, this.phoneNumberInputElement.value).then(() => this.successfullySent.emit()).catch((r) => this.unsuccessfullySent.emit(r));
|
|
14
|
+
}, this.venueId = void 0, this.originLocationId = void 0, this.destinationLocationId = void 0, this.countryCode = "1", this.phoneNumberInputPlaceholder = "Enter phone number", this.submitButtonLabel = "Send SMS";
|
|
15
|
+
}
|
|
16
|
+
componentDidRender() {
|
|
17
|
+
this.countryCodeInputElement.value = this.countryCode;
|
|
18
|
+
}
|
|
19
|
+
componentDidLoad() {
|
|
20
|
+
this.addIntersectionObserver();
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Observe the input field for phone number and focus it on intersection.
|
|
24
|
+
*/
|
|
25
|
+
addIntersectionObserver() {
|
|
26
|
+
this.intersectionObserver = new IntersectionObserver((t) => {
|
|
27
|
+
t[0].intersectionRatio <= 0 || (this.phoneNumberInputElement.focus(), this.intersectionObserver.disconnect());
|
|
28
|
+
}), this.intersectionObserver.observe(this.phoneNumberInputElement);
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Set input attribute on mi-keyboard component.
|
|
32
|
+
*
|
|
33
|
+
* @param {FocusEvent} event
|
|
34
|
+
*/
|
|
35
|
+
setKeyboardInputElement(t) {
|
|
36
|
+
this.miKeyboardElement.inputElement = t.target;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Update form validity.
|
|
40
|
+
*/
|
|
41
|
+
updateFormValidity() {
|
|
42
|
+
if (!this.formElement.checkValidity()) {
|
|
43
|
+
this.submitButtonElement.disabled = !0;
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
this.submitButtonElement.disabled = !1;
|
|
47
|
+
}
|
|
48
|
+
render() {
|
|
49
|
+
return e("form", { onSubmit: this.submitFormHandler, ref: (t) => this.formElement = t }, e("div", { class: "inputs" }, e("span", { class: "plus-sign" }, "+"), e("input", { id: "country-code", class: "country-code", pattern: "[0-9]{1,3}", required: !0, autocomplete: "off", type: "text", placeholder: this.countryCode, ref: (t) => this.countryCodeInputElement = t, onInput: () => this.updateFormValidity(), onFocus: (t) => this.setKeyboardInputElement(t) }), e("input", { id: "phone-number", class: "phone-number", pattern: "[0-9]{6,10}", required: !0, autocomplete: "off", type: "text", placeholder: this.phoneNumberInputPlaceholder, ref: (t) => this.phoneNumberInputElement = t, onInput: () => this.updateFormValidity(), onFocus: (t) => this.setKeyboardInputElement(t) })), e("mi-keyboard", { layout: "numeric", ref: (t) => this.miKeyboardElement = t }), e("div", { class: "flex justify-center" }, e("button", { type: "submit", disabled: !0, class: "mi-button mi-button--primary", ref: (t) => this.submitButtonElement = t }, this.submitButtonLabel)));
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
l.style = d;
|
|
53
|
+
export {
|
|
54
|
+
l as mi_share_sms
|
|
55
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { r as n, c as d, h as t, H as p } from "./webcomponent-a10be1e6.mjs";
|
|
2
|
+
const h = ":host{display:flex}button{padding:16px;background-color:transparent;border:none}button:disabled svg{fill:#d1d5db}button svg{fill:#1f2937}div.steps{padding-top:12px;padding-bottom:12px;padding-left:4px;padding-right:4px;display:flex;flex-grow:1;flex-direction:column;vertical-align:center;justify-content:center}div.steps p{margin:0;padding-bottom:8px;color:#1c1917;font-size:1rem;font-weight:500;line-height:1.25rem;text-align:center}div.steps__dots{display:flex;justify-content:center}div.steps__dots span{width:8px;height:8px;margin-right:8px;float:left;background-color:#d1d5db;border-radius:50%}div.steps__dots span.active{background-color:#1f2937}div.steps__dots span:last-child{margin-right:0px}", o = class {
|
|
3
|
+
constructor(e) {
|
|
4
|
+
n(this, e), this.stepIndexChanged = d(this, "stepIndexChanged", 7), this.heading = void 0, this.steps = [], this.stepIndex = 0;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Set step index and emit stepIndexChanged event.
|
|
8
|
+
*
|
|
9
|
+
* @param {number} index
|
|
10
|
+
*/
|
|
11
|
+
setStepIndex(e) {
|
|
12
|
+
this.stepIndex = e, this.stepIndexChanged.emit(this.stepIndex);
|
|
13
|
+
}
|
|
14
|
+
render() {
|
|
15
|
+
return t(p, null, t("button", { type: "button", disabled: this.steps.length === 0 || this.stepIndex === 0, onClick: () => this.setStepIndex(this.stepIndex - 1) }, t("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", width: "24px", height: "24px" }, t("path", { d: "M0 0h24v24H0V0z", fill: "none" }), t("path", { d: "M15.41 16.59L10.83 12l4.58-4.59L14 6l-6 6 6 6 1.41-1.41z" }))), t("div", { class: "steps" }, this.heading ? t("p", { part: "heading" }, this.heading) : null, t("div", { class: "steps__dots" }, this.steps.map((e, i) => {
|
|
16
|
+
const s = this.stepIndex === i;
|
|
17
|
+
return t("span", { part: s ? "active-dot" : "dot", class: { active: s } });
|
|
18
|
+
}))), t("button", { type: "button", disabled: this.steps.length === 0 || this.stepIndex === this.steps.length - 1, onClick: () => this.setStepIndex(this.stepIndex + 1) }, t("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", width: "24px", height: "24px" }, t("path", { d: "M0 0h24v24H0V0z", fill: "none" }), t("path", { d: "M8.59 16.59L13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z" }))));
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
o.style = h;
|
|
22
|
+
export {
|
|
23
|
+
o as mi_step_switcher
|
|
24
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { r as n, c as d, h as t, H as p } from "./reactcomponent-2f9f051f.mjs";
|
|
2
|
+
import "react";
|
|
3
|
+
import "react-dom";
|
|
4
|
+
const h = ":host{display:flex}button{padding:16px;background-color:transparent;border:none}button:disabled svg{fill:#d1d5db}button svg{fill:#1f2937}div.steps{padding-top:12px;padding-bottom:12px;padding-left:4px;padding-right:4px;display:flex;flex-grow:1;flex-direction:column;vertical-align:center;justify-content:center}div.steps p{margin:0;padding-bottom:8px;color:#1c1917;font-size:1rem;font-weight:500;line-height:1.25rem;text-align:center}div.steps__dots{display:flex;justify-content:center}div.steps__dots span{width:8px;height:8px;margin-right:8px;float:left;background-color:#d1d5db;border-radius:50%}div.steps__dots span.active{background-color:#1f2937}div.steps__dots span:last-child{margin-right:0px}", o = class {
|
|
5
|
+
constructor(e) {
|
|
6
|
+
n(this, e), this.stepIndexChanged = d(this, "stepIndexChanged", 7), this.heading = void 0, this.steps = [], this.stepIndex = 0;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Set step index and emit stepIndexChanged event.
|
|
10
|
+
*
|
|
11
|
+
* @param {number} index
|
|
12
|
+
*/
|
|
13
|
+
setStepIndex(e) {
|
|
14
|
+
this.stepIndex = e, this.stepIndexChanged.emit(this.stepIndex);
|
|
15
|
+
}
|
|
16
|
+
render() {
|
|
17
|
+
return t(p, null, t("button", { type: "button", disabled: this.steps.length === 0 || this.stepIndex === 0, onClick: () => this.setStepIndex(this.stepIndex - 1) }, t("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", width: "24px", height: "24px" }, t("path", { d: "M0 0h24v24H0V0z", fill: "none" }), t("path", { d: "M15.41 16.59L10.83 12l4.58-4.59L14 6l-6 6 6 6 1.41-1.41z" }))), t("div", { class: "steps" }, this.heading ? t("p", { part: "heading" }, this.heading) : null, t("div", { class: "steps__dots" }, this.steps.map((e, i) => {
|
|
18
|
+
const s = this.stepIndex === i;
|
|
19
|
+
return t("span", { part: s ? "active-dot" : "dot", class: { active: s } });
|
|
20
|
+
}))), t("button", { type: "button", disabled: this.steps.length === 0 || this.stepIndex === this.steps.length - 1, onClick: () => this.setStepIndex(this.stepIndex + 1) }, t("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", width: "24px", height: "24px" }, t("path", { d: "M0 0h24v24H0V0z", fill: "none" }), t("path", { d: "M8.59 16.59L13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z" }))));
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
o.style = h;
|
|
24
|
+
export {
|
|
25
|
+
o as mi_step_switcher
|
|
26
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { r as i, h as s } from "./webcomponent-a10be1e6.mjs";
|
|
2
|
+
const t = 'div{display:none}div.active{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";flex-shrink:0;flex-grow:1;display:block}', a = class {
|
|
3
|
+
constructor(e) {
|
|
4
|
+
i(this, e), this.isActive = !1;
|
|
5
|
+
}
|
|
6
|
+
async active(e) {
|
|
7
|
+
return e !== void 0 && (this.isActive = !!e), this.isActive;
|
|
8
|
+
}
|
|
9
|
+
render() {
|
|
10
|
+
const e = {
|
|
11
|
+
active: this.isActive
|
|
12
|
+
};
|
|
13
|
+
return s("div", { class: e }, s("slot", null));
|
|
14
|
+
}
|
|
15
|
+
};
|
|
16
|
+
a.style = t;
|
|
17
|
+
export {
|
|
18
|
+
a as mi_tab_panel
|
|
19
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { r as i, h as s } from "./reactcomponent-2f9f051f.mjs";
|
|
2
|
+
import "react";
|
|
3
|
+
import "react-dom";
|
|
4
|
+
const t = 'div{display:none}div.active{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";flex-shrink:0;flex-grow:1;display:block}', a = class {
|
|
5
|
+
constructor(e) {
|
|
6
|
+
i(this, e), this.isActive = !1;
|
|
7
|
+
}
|
|
8
|
+
async active(e) {
|
|
9
|
+
return e !== void 0 && (this.isActive = !!e), this.isActive;
|
|
10
|
+
}
|
|
11
|
+
render() {
|
|
12
|
+
const e = {
|
|
13
|
+
active: this.isActive
|
|
14
|
+
};
|
|
15
|
+
return s("div", { class: e }, s("slot", null));
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
a.style = t;
|
|
19
|
+
export {
|
|
20
|
+
a as mi_tab_panel
|
|
21
|
+
};
|