@mapsindoors/map-template 1.95.1 → 1.95.2

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 (66) hide show
  1. package/dist/{GoogleMapsMap-C5n6Bgtp.mjs → GoogleMapsMap-Dkn60-_e.mjs} +2 -2
  2. package/dist/{MapboxMap-UCqzt1AC.mjs → MapboxMap-B1oo7IUm.mjs} +2 -2
  3. package/dist/_commonjsHelpers-B85MJLTf.js +5 -0
  4. package/dist/app-globals-DQuL1Twl.js +3 -0
  5. package/dist/combo-box-item.entry.js +8 -10
  6. package/dist/icon-DT_sDkmK.js +11 -0
  7. package/dist/index-BZQHyS7V.js +1701 -0
  8. package/dist/loader.js +7 -14
  9. package/dist/mapsindoors-react.es.js +1 -1
  10. package/dist/mapsindoors-react.umd.js +175 -175
  11. package/dist/mapsindoors-webcomponent.es.js +2916 -2904
  12. package/dist/mi-card_2.entry.js +23 -18
  13. package/dist/mi-chip.entry.js +25 -16
  14. package/dist/mi-column.entry.js +47 -23
  15. package/dist/mi-combo-box.entry.js +412 -379
  16. package/dist/mi-components.js +15 -12
  17. package/dist/mi-data-table.entry.js +298 -278
  18. package/dist/mi-distance_2.entry.js +58 -56
  19. package/dist/mi-dropdown-item.entry.js +8 -10
  20. package/dist/mi-dropdown.entry.js +525 -481
  21. package/dist/mi-floor-selector.entry.js +183 -180
  22. package/dist/mi-keyboard.entry.js +207 -186
  23. package/dist/mi-list-item-category.entry.js +44 -41
  24. package/dist/mi-list-item-location.entry.js +168 -162
  25. package/dist/mi-list.entry.js +56 -48
  26. package/dist/mi-location-booking.entry.js +320 -295
  27. package/dist/mi-location-info.entry.js +61 -53
  28. package/dist/mi-map-googlemaps.entry.js +369 -324
  29. package/dist/mi-map-mapbox.entry.js +502 -439
  30. package/dist/mi-metric-card.entry.js +50 -37
  31. package/dist/mi-my-position.entry.js +2341 -874
  32. package/dist/mi-notification.entry.js +112 -102
  33. package/dist/mi-route-instructions-heading.entry.js +70 -65
  34. package/dist/mi-route-instructions-maneuver-legacy.entry.js +80 -76
  35. package/dist/mi-route-instructions-maneuver.entry.js +80 -76
  36. package/dist/mi-route-instructions-step-legacy.entry.js +296 -282
  37. package/dist/mi-route-instructions-step.entry.js +313 -292
  38. package/dist/mi-route-instructions.entry.js +167 -150
  39. package/dist/mi-scroll-buttons.entry.js +104 -98
  40. package/dist/mi-search.entry.js +366 -325
  41. package/dist/mi-share-sms.entry.js +82 -70
  42. package/dist/mi-step-switcher.entry.js +34 -25
  43. package/dist/mi-tab-panel.entry.js +18 -18
  44. package/dist/mi-tab.entry.js +5 -7
  45. package/dist/mi-tabs.entry.js +42 -40
  46. package/dist/mi-time.entry.js +49 -49
  47. package/dist/mi-variables-CDNvnTkH.js +5 -0
  48. package/dist/{reactcomponent-DQsjxRIN.mjs → reactcomponent-2Oa1vSiK.mjs} +8996 -8660
  49. package/dist/route-travel-mode.enum-BvqP1fpw.js +9 -0
  50. package/dist/sort-order.enum-jsLAbYWg.js +566 -0
  51. package/dist/{unit-system.enum-eaefb53e.js → unit-system.enum-BwPgAWqL.js} +2 -2
  52. package/dist/utils-DNHzysQ6.js +61 -0
  53. package/package.json +1 -1
  54. package/dist/_commonjsHelpers-ba3f0406.js +0 -21
  55. package/dist/icon-b8d01d6f.js +0 -24
  56. package/dist/index-7e9696f3.js +0 -1678
  57. package/dist/mi-variables-9a6c8d4d.js +0 -6
  58. package/dist/polyfills/core-js.js +0 -11
  59. package/dist/polyfills/css-shim.js +0 -1
  60. package/dist/polyfills/dom.js +0 -79
  61. package/dist/polyfills/es5-html-element.js +0 -1
  62. package/dist/polyfills/index.js +0 -34
  63. package/dist/polyfills/system.js +0 -6
  64. package/dist/route-travel-mode.enum-7f4ce9c7.js +0 -9
  65. package/dist/sort-order.enum-64ce8998.js +0 -552
  66. package/dist/utils-ae714467.js +0 -61
@@ -1,80 +1,92 @@
1
- import { r as registerInstance, c as createEvent, h } from './index-7e9696f3.js';
1
+ import { r as registerInstance, c as createEvent, h } from './index-BZQHyS7V.js';
2
2
 
3
- const shareSmsCss = "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}";
3
+ const shareSmsCss = () => `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}`;
4
4
 
5
5
  const ShareSms = class {
6
- constructor(hostRef) {
7
- registerInstance(this, hostRef);
8
- this.successfullySent = createEvent(this, "successfullySent", 7);
9
- this.unsuccessfullySent = createEvent(this, "unsuccessfullySent", 7);
6
+ constructor(hostRef) {
7
+ registerInstance(this, hostRef);
8
+ this.successfullySent = createEvent(this, "successfullySent", 7);
9
+ this.unsuccessfullySent = createEvent(this, "unsuccessfullySent", 7);
10
+ /**
11
+ * Default value for country code input field.
12
+ *
13
+ * @type {string}
14
+ */
15
+ this.countryCode = '1';
16
+ /**
17
+ * Placeholder text for phone number input field.
18
+ *
19
+ * @type {string}
20
+ */
21
+ this.phoneNumberInputPlaceholder = 'Enter phone number';
22
+ /**
23
+ * Label for submit button.
24
+ *
25
+ * @type {string}
26
+ */
27
+ this.submitButtonLabel = 'Send SMS';
28
+ /**
29
+ * Handle form submission event and send directions to phone if validation checks passes.
30
+ */
31
+ this.submitFormHandler = (event) => {
32
+ event.preventDefault();
33
+ const isParametersValid = this.venueId && this.originLocationId && this.destinationLocationId ? true : false;
34
+ if (!this.formElement.checkValidity() || !isParametersValid) {
35
+ if (!this.countryCodeInputElement.validity.valid) {
36
+ this.countryCodeInputElement.focus();
37
+ }
38
+ if (!this.phoneNumberInputElement.validity.valid) {
39
+ this.phoneNumberInputElement.focus();
40
+ }
41
+ return;
42
+ }
43
+ mapsindoors.services.ShareService.directionsToPhone(this.venueId, this.originLocationId, this.destinationLocationId, this.countryCodeInputElement.value, this.phoneNumberInputElement.value)
44
+ .then(() => this.successfullySent.emit())
45
+ .catch((err) => this.unsuccessfullySent.emit(err));
46
+ };
47
+ }
48
+ componentDidRender() {
49
+ this.countryCodeInputElement.value = this.countryCode;
50
+ }
51
+ componentDidLoad() {
52
+ this.addIntersectionObserver();
53
+ }
10
54
  /**
11
- * Handle form submission event and send directions to phone if validation checks passes.
55
+ * Observe the input field for phone number and focus it on intersection.
12
56
  */
13
- this.submitFormHandler = (event) => {
14
- event.preventDefault();
15
- const isParametersValid = this.venueId && this.originLocationId && this.destinationLocationId ? true : false;
16
- if (!this.formElement.checkValidity() || !isParametersValid) {
17
- if (!this.countryCodeInputElement.validity.valid) {
18
- this.countryCodeInputElement.focus();
19
- }
20
- if (!this.phoneNumberInputElement.validity.valid) {
21
- this.phoneNumberInputElement.focus();
57
+ addIntersectionObserver() {
58
+ this.intersectionObserver = new IntersectionObserver((entries) => {
59
+ if (entries[0].intersectionRatio <= 0) {
60
+ return;
61
+ }
62
+ this.phoneNumberInputElement.focus();
63
+ this.intersectionObserver.disconnect();
64
+ });
65
+ this.intersectionObserver.observe(this.phoneNumberInputElement);
66
+ }
67
+ /**
68
+ * Set input attribute on mi-keyboard component.
69
+ *
70
+ * @param {FocusEvent} event
71
+ */
72
+ setKeyboardInputElement(event) {
73
+ this.miKeyboardElement.inputElement = event.target;
74
+ }
75
+ /**
76
+ * Update form validity.
77
+ */
78
+ updateFormValidity() {
79
+ // Form validity check
80
+ if (!this.formElement.checkValidity()) {
81
+ this.submitButtonElement.disabled = true;
82
+ return;
22
83
  }
23
- return;
24
- }
25
- mapsindoors.services.ShareService.directionsToPhone(this.venueId, this.originLocationId, this.destinationLocationId, this.countryCodeInputElement.value, this.phoneNumberInputElement.value)
26
- .then(() => this.successfullySent.emit())
27
- .catch((err) => this.unsuccessfullySent.emit(err));
28
- };
29
- this.venueId = undefined;
30
- this.originLocationId = undefined;
31
- this.destinationLocationId = undefined;
32
- this.countryCode = '1';
33
- this.phoneNumberInputPlaceholder = 'Enter phone number';
34
- this.submitButtonLabel = 'Send SMS';
35
- }
36
- componentDidRender() {
37
- this.countryCodeInputElement.value = this.countryCode;
38
- }
39
- componentDidLoad() {
40
- this.addIntersectionObserver();
41
- }
42
- /**
43
- * Observe the input field for phone number and focus it on intersection.
44
- */
45
- addIntersectionObserver() {
46
- this.intersectionObserver = new IntersectionObserver((entries) => {
47
- if (entries[0].intersectionRatio <= 0) {
48
- return;
49
- }
50
- this.phoneNumberInputElement.focus();
51
- this.intersectionObserver.disconnect();
52
- });
53
- this.intersectionObserver.observe(this.phoneNumberInputElement);
54
- }
55
- /**
56
- * Set input attribute on mi-keyboard component.
57
- *
58
- * @param {FocusEvent} event
59
- */
60
- setKeyboardInputElement(event) {
61
- this.miKeyboardElement.inputElement = event.target;
62
- }
63
- /**
64
- * Update form validity.
65
- */
66
- updateFormValidity() {
67
- // Form validity check
68
- if (!this.formElement.checkValidity()) {
69
- this.submitButtonElement.disabled = true;
70
- return;
84
+ this.submitButtonElement.disabled = false;
85
+ }
86
+ render() {
87
+ return (h("form", { key: '4d6b6a2e7021daa63d91509f0c848c672d6e82e2', onSubmit: this.submitFormHandler, ref: (el) => this.formElement = el }, h("div", { key: '2fc6c9bfc7ab5b39cd64d8e22fb3dce2eabc05d3', class: "inputs" }, h("span", { key: 'b2304f9e435f795e9e7ae10f0a039fd681f94796', class: "plus-sign" }, "\uFF0B"), h("input", { key: '3eb7ee171409f1e7f36596a617540ad79ca48a17', id: "country-code", class: "country-code", pattern: "[0-9]{1,3}", required: true, autocomplete: "off", type: "text", placeholder: this.countryCode, ref: (el) => this.countryCodeInputElement = el, onInput: () => this.updateFormValidity(), onFocus: (e) => this.setKeyboardInputElement(e) }), h("input", { key: '3b97aa3beadd03d823e10bcceaf40f93e2dd5448', id: "phone-number", class: "phone-number", pattern: "[0-9]{6,10}", required: true, autocomplete: "off", type: "text", placeholder: this.phoneNumberInputPlaceholder, ref: (el) => this.phoneNumberInputElement = el, onInput: () => this.updateFormValidity(), onFocus: (e) => this.setKeyboardInputElement(e) })), h("mi-keyboard", { key: 'b0355bab5b026232943b56c8ca1f4883578d7a17', layout: "numeric", ref: (el) => this.miKeyboardElement = el }), h("div", { key: '28a97726023b3b57a6aa890bf31c8a249893bdad', class: "flex justify-center" }, h("button", { key: 'e455ace31620e5d2c641acc549291e9a8b54851a', type: "submit", disabled: true, class: "mi-button mi-button--primary", ref: (el) => this.submitButtonElement = el }, this.submitButtonLabel))));
71
88
  }
72
- this.submitButtonElement.disabled = false;
73
- }
74
- render() {
75
- return (h("form", { onSubmit: this.submitFormHandler, ref: (el) => this.formElement = el }, h("div", { class: "inputs" }, h("span", { class: "plus-sign" }, "\uFF0B"), h("input", { id: "country-code", class: "country-code", pattern: "[0-9]{1,3}", required: true, autocomplete: "off", type: "text", placeholder: this.countryCode, ref: (el) => this.countryCodeInputElement = el, onInput: () => this.updateFormValidity(), onFocus: (e) => this.setKeyboardInputElement(e) }), h("input", { id: "phone-number", class: "phone-number", pattern: "[0-9]{6,10}", required: true, autocomplete: "off", type: "text", placeholder: this.phoneNumberInputPlaceholder, ref: (el) => this.phoneNumberInputElement = el, onInput: () => this.updateFormValidity(), onFocus: (e) => this.setKeyboardInputElement(e) })), h("mi-keyboard", { layout: "numeric", ref: (el) => this.miKeyboardElement = el }), h("div", { class: "flex justify-center" }, h("button", { type: "submit", disabled: true, class: "mi-button mi-button--primary", ref: (el) => this.submitButtonElement = el }, this.submitButtonLabel))));
76
- }
77
89
  };
78
- ShareSms.style = shareSmsCss;
90
+ ShareSms.style = shareSmsCss();
79
91
 
80
92
  export { ShareSms as mi_share_sms };
@@ -1,31 +1,40 @@
1
- import { r as registerInstance, c as createEvent, h, H as Host } from './index-7e9696f3.js';
1
+ import { r as registerInstance, c as createEvent, h, H as Host } from './index-BZQHyS7V.js';
2
2
 
3
- const stepSwitcherCss = ":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}";
3
+ const stepSwitcherCss = () => `: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}`;
4
4
 
5
5
  const StepSwitcher = class {
6
- constructor(hostRef) {
7
- registerInstance(this, hostRef);
8
- this.stepIndexChanged = createEvent(this, "stepIndexChanged", 7);
9
- this.heading = undefined;
10
- this.steps = [];
11
- this.stepIndex = 0;
12
- }
13
- /**
14
- * Set step index and emit stepIndexChanged event.
15
- *
16
- * @param {number} index
17
- */
18
- setStepIndex(index) {
19
- this.stepIndex = index;
20
- this.stepIndexChanged.emit(this.stepIndex);
21
- }
22
- render() {
23
- return (h(Host, null, h("button", { type: "button", disabled: this.steps.length === 0 || this.stepIndex === 0, onClick: () => this.setStepIndex(this.stepIndex - 1) }, h("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", width: "24px", height: "24px" }, h("path", { d: "M0 0h24v24H0V0z", fill: "none" }), h("path", { d: "M15.41 16.59L10.83 12l4.58-4.59L14 6l-6 6 6 6 1.41-1.41z" }))), h("div", { class: "steps" }, this.heading ? h("p", { part: "heading" }, this.heading) : null, h("div", { class: "steps__dots" }, this.steps.map((item, index) => {
24
- const isActive = this.stepIndex === index ? true : false;
25
- return h("span", { part: isActive ? 'active-dot' : 'dot', class: { 'active': isActive } });
26
- }))), h("button", { type: "button", disabled: this.steps.length === 0 || this.stepIndex === this.steps.length - 1, onClick: () => this.setStepIndex(this.stepIndex + 1) }, h("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", width: "24px", height: "24px" }, h("path", { d: "M0 0h24v24H0V0z", fill: "none" }), h("path", { d: "M8.59 16.59L13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z" })))));
27
- }
6
+ constructor(hostRef) {
7
+ registerInstance(this, hostRef);
8
+ this.stepIndexChanged = createEvent(this, "stepIndexChanged", 7);
9
+ /**
10
+ * Steps to display dots for.
11
+ *
12
+ * @type {any[]}
13
+ */
14
+ this.steps = [];
15
+ /**
16
+ * Step index to show. Defaults to first step.
17
+ *
18
+ * @type {number}
19
+ */
20
+ this.stepIndex = 0;
21
+ }
22
+ /**
23
+ * Set step index and emit stepIndexChanged event.
24
+ *
25
+ * @param {number} index
26
+ */
27
+ setStepIndex(index) {
28
+ this.stepIndex = index;
29
+ this.stepIndexChanged.emit(this.stepIndex);
30
+ }
31
+ render() {
32
+ return (h(Host, { key: '1e395bce6f748cccf4dbbfd779698021b053898d' }, h("button", { key: 'b519a479608fdb32b3093a7afb1594a1ef07a0d6', type: "button", disabled: this.steps.length === 0 || this.stepIndex === 0, onClick: () => this.setStepIndex(this.stepIndex - 1) }, h("svg", { key: 'f76750f1dee589871fdb3ec6cb0b9997899d17f5', xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", width: "24px", height: "24px" }, h("path", { key: '1f00900037a228cde36ff1162ccbceadd2fac043', d: "M0 0h24v24H0V0z", fill: "none" }), h("path", { key: '06bb8082e8c1847ac8c6189f98b938ffb4e68434', d: "M15.41 16.59L10.83 12l4.58-4.59L14 6l-6 6 6 6 1.41-1.41z" }))), h("div", { key: '96dffdb02ac846d3d3c077464b112a9c6fc18038', class: "steps" }, this.heading ? h("p", { part: "heading" }, this.heading) : null, h("div", { key: '6dc56a58ca81214d85c32775b59874ecaf77afdd', class: "steps__dots" }, this.steps.map((item, index) => {
33
+ const isActive = this.stepIndex === index ? true : false;
34
+ return h("span", { part: isActive ? 'active-dot' : 'dot', class: { 'active': isActive } });
35
+ }))), h("button", { key: '5c8a8344ee80fd9a9405bfe9951b23b2fa56ac58', type: "button", disabled: this.steps.length === 0 || this.stepIndex === this.steps.length - 1, onClick: () => this.setStepIndex(this.stepIndex + 1) }, h("svg", { key: '86d476332a460a49beb2791578c3d4d71890b94c', xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", width: "24px", height: "24px" }, h("path", { key: 'c2d9e3b32289adb5990736677bb756a89546adeb', d: "M0 0h24v24H0V0z", fill: "none" }), h("path", { key: '8bbdf7b1b80e768a538df7b2e3cf5bd7ac5acb68', d: "M8.59 16.59L13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z" })))));
36
+ }
28
37
  };
29
- StepSwitcher.style = stepSwitcherCss;
38
+ StepSwitcher.style = stepSwitcherCss();
30
39
 
31
40
  export { StepSwitcher as mi_step_switcher };
@@ -1,25 +1,25 @@
1
- import { r as registerInstance, h } from './index-7e9696f3.js';
1
+ import { r as registerInstance, h } from './index-BZQHyS7V.js';
2
2
 
3
- const tabPanelCss = "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}";
3
+ const tabPanelCss = () => `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}`;
4
4
 
5
5
  const TabPanel = class {
6
- constructor(hostRef) {
7
- registerInstance(this, hostRef);
8
- this.isActive = false;
9
- }
10
- async active(active) {
11
- if (active !== undefined) {
12
- this.isActive = !!active;
6
+ constructor(hostRef) {
7
+ registerInstance(this, hostRef);
8
+ this.isActive = false;
9
+ }
10
+ async active(active) {
11
+ if (active !== undefined) {
12
+ this.isActive = !!active;
13
+ }
14
+ return this.isActive;
15
+ }
16
+ render() {
17
+ const classList = {
18
+ 'active': this.isActive
19
+ };
20
+ return (h("div", { key: '5ab9e40be53f24513cf2864e1cdc9ac78c73bc8a', class: classList }, h("slot", { key: 'a845f4a8d286200a463309cb8de2362cdc4065d2' })));
13
21
  }
14
- return this.isActive;
15
- }
16
- render() {
17
- const classList = {
18
- 'active': this.isActive
19
- };
20
- return (h("div", { class: classList }, h("slot", null)));
21
- }
22
22
  };
23
- TabPanel.style = tabPanelCss;
23
+ TabPanel.style = tabPanelCss();
24
24
 
25
25
  export { TabPanel as mi_tab_panel };
@@ -1,12 +1,10 @@
1
- import { r as registerInstance } from './index-7e9696f3.js';
1
+ import { r as registerInstance } from './index-BZQHyS7V.js';
2
2
 
3
3
  const Tab = class {
4
- constructor(hostRef) {
5
- registerInstance(this, hostRef);
6
- this.label = undefined;
7
- this.tabFor = undefined;
8
- }
9
- render() { return; }
4
+ constructor(hostRef) {
5
+ registerInstance(this, hostRef);
6
+ }
7
+ render() { return; }
10
8
  };
11
9
 
12
10
  export { Tab as mi_tab };
@@ -1,47 +1,49 @@
1
- import { r as registerInstance, h, H as Host, g as getElement } from './index-7e9696f3.js';
1
+ import { r as registerInstance, h, H as Host, g as getElement } from './index-BZQHyS7V.js';
2
2
 
3
- const tabsCss = ":host{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}:host .nav{border:none;border-bottom:solid;border-color:#d1d5db;border-width:1px;padding-left:24px}:host .nav--borderless-bottom{border-bottom:0}:host .nav ul{display:flex;flex-direction:row;padding:0;margin:0;margin-bottom:-1px}:host .nav ul li{list-style:none;text-align:center;cursor:pointer;padding:16px;border-width:1px;border-style:solid;border-color:rgba(0, 0, 0, 0)}:host .nav ul li.active{background-color:#f9fafb;border-color:#d1d5db;border-width:1px;border-style:solid;border-bottom:none;border-top-left-radius:4px;border-top-right-radius:4px;font-weight:600}:host .content{display:block;padding:16px;background-color:#f9fafb}:host .content--bordered{border-width:1px;border-color:#d1d5db;border-style:solid;border-radius:4px}";
3
+ const tabsCss = () => `:host{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}:host .nav{border:none;border-bottom:solid;border-color:#d1d5db;border-width:1px;padding-left:24px}:host .nav--borderless-bottom{border-bottom:0}:host .nav ul{display:flex;flex-direction:row;padding:0;margin:0;margin-bottom:-1px}:host .nav ul li{list-style:none;text-align:center;cursor:pointer;padding:16px;border-width:1px;border-style:solid;border-color:rgba(0, 0, 0, 0)}:host .nav ul li.active{background-color:#f9fafb;border-color:#d1d5db;border-width:1px;border-style:solid;border-bottom:none;border-top-left-radius:4px;border-top-right-radius:4px;font-weight:600}:host .content{display:block;padding:16px;background-color:#f9fafb}:host .content--bordered{border-width:1px;border-color:#d1d5db;border-style:solid;border-radius:4px}`;
4
4
 
5
5
  const Tabs = class {
6
- constructor(hostRef) {
7
- registerInstance(this, hostRef);
8
- this.active = 0;
9
- this.bordered = false;
10
- this.tabs = undefined;
11
- }
12
- connectedCallback() {
13
- // Create an observer instance linked to the callback function
14
- const observer = new MutationObserver(this.componentWillRender.bind(this));
15
- // Start observing the target node for configured mutations
16
- observer.observe(this.el, { childList: true });
17
- }
18
- componentWillRender() {
19
- const tabs = this.el.querySelectorAll('mi-tab');
20
- this.tabs = Array.from(tabs).reduce((tabs, tab, index) => {
21
- const content = Array.from(this.el.getElementsByTagName('mi-tab-panel')).find(el => el.id === tab.tabFor);
22
- if (content) {
23
- tabs.push({ label: tab.label, content: content });
24
- }
25
- return tabs;
26
- }, []);
27
- }
28
- componentDidRender() {
29
- this.selectTab(this.active);
30
- }
31
- async selectTab(index) {
32
- const isTabActive = await this.tabs[index].content.active();
33
- if (!isTabActive) {
34
- this.active = index;
35
- this.tabs.forEach((tab, tabIndex) => tab.content.active(tabIndex === index));
6
+ constructor(hostRef) {
7
+ registerInstance(this, hostRef);
8
+ this.active = 0;
9
+ /**
10
+ * Sets a border surrounding the content view.
11
+ */
12
+ this.bordered = false;
36
13
  }
37
- }
38
- render() {
39
- return (h(Host, null, h("nav", { class: `nav ${this.bordered === true ? 'nav--borderless-bottom' : ''}` }, h("ul", null, this.tabs.map((tab, index) => {
40
- return (h("li", { class: this.active === index ? 'active' : '', onClick: () => { this.selectTab(index); } }, " ", tab.label, " "));
41
- }))), h("section", { class: `content ${this.bordered === true ? 'content--bordered' : ''}` }, h("slot", null))));
42
- }
43
- get el() { return getElement(this); }
14
+ connectedCallback() {
15
+ // Create an observer instance linked to the callback function
16
+ const observer = new MutationObserver(this.componentWillRender.bind(this));
17
+ // Start observing the target node for configured mutations
18
+ observer.observe(this.el, { childList: true });
19
+ }
20
+ componentWillRender() {
21
+ const tabs = this.el.querySelectorAll('mi-tab');
22
+ this.tabs = Array.from(tabs).reduce((tabs, tab, index) => {
23
+ const content = Array.from(this.el.getElementsByTagName('mi-tab-panel')).find(el => el.id === tab.tabFor);
24
+ if (content) {
25
+ tabs.push({ label: tab.label, content: content });
26
+ }
27
+ return tabs;
28
+ }, []);
29
+ }
30
+ componentDidRender() {
31
+ this.selectTab(this.active);
32
+ }
33
+ async selectTab(index) {
34
+ const isTabActive = await this.tabs[index].content.active();
35
+ if (!isTabActive) {
36
+ this.active = index;
37
+ this.tabs.forEach((tab, tabIndex) => tab.content.active(tabIndex === index));
38
+ }
39
+ }
40
+ render() {
41
+ return (h(Host, { key: 'cfda4988c7be231b136bb7e2e29f57e5f69bc31d' }, h("nav", { key: '5f4682c587caaba179dbf186af270d69c3f5e739', class: `nav ${this.bordered === true ? 'nav--borderless-bottom' : ''}` }, h("ul", { key: '828e348d49f83a96cd36dd08690bc8eb990c9329' }, this.tabs.map((tab, index) => {
42
+ return (h("li", { class: this.active === index ? 'active' : '', onClick: () => { this.selectTab(index); } }, " ", tab.label, " "));
43
+ }))), h("section", { key: 'c9b6a595f575534ec720331401bc620c9b06125e', class: `content ${this.bordered === true ? 'content--bordered' : ''}` }, h("slot", { key: 'e52795c27ad173b657b003016a9fa378641abe35' }))));
44
+ }
45
+ get el() { return getElement(this); }
44
46
  };
45
- Tabs.style = tabsCss;
47
+ Tabs.style = tabsCss();
46
48
 
47
49
  export { Tabs as mi_tabs };
@@ -1,57 +1,57 @@
1
- import { r as registerInstance, h } from './index-7e9696f3.js';
1
+ import { r as registerInstance, h } from './index-BZQHyS7V.js';
2
2
 
3
3
  const Time = class {
4
- constructor(hostRef) {
5
- registerInstance(this, hostRef);
6
- this.seconds = undefined;
7
- this.translations = undefined;
8
- this.translationsData = undefined;
9
- }
10
- setTranslations() {
11
- if (this.translations) {
12
- this.translationsData = JSON.parse(this.translations);
4
+ constructor(hostRef) {
5
+ registerInstance(this, hostRef);
6
+ this.translationsData = { days: 'd', hours: 'h', minutes: 'min' };
13
7
  }
14
- else {
15
- this.translationsData = { days: 'd', hours: 'h', minutes: 'min' };
8
+ setTranslations() {
9
+ if (this.translations) {
10
+ this.translationsData = JSON.parse(this.translations);
11
+ }
12
+ else {
13
+ this.translationsData = { days: 'd', hours: 'h', minutes: 'min' };
14
+ }
16
15
  }
17
- }
18
- componentWillLoad() {
19
- this.setTranslations();
20
- }
21
- /**
22
- * Get display string in days, hours, and minutes, eg. "1 d 23 h 4 min".
23
- * Minimum display value is 1 minute.
24
- *
25
- * @param {number} seconds Duration in seconds.
26
- * @returns {string}
27
- */
28
- getDurationDisplayString(seconds) {
29
- const days = Math.floor(seconds / 86400);
30
- const hours = Math.floor((seconds % 86400) / 3600);
31
- const minutes = Math.floor(((seconds % 86400) % 3600) / 60);
32
- const dDisplay = days > 0 ? `${days} ${this.translationsData.days} ` : '';
33
- const hDisplay = hours > 0 ? `${hours} ${this.translationsData.hours} ` : '';
34
- let mDisplay = minutes > 0 ? `${minutes} ${this.translationsData.minutes}` : '';
35
- // Set minimum value of 1 min.
36
- if (!dDisplay && !hDisplay && !mDisplay) {
37
- mDisplay = '1 min';
16
+ componentWillLoad() {
17
+ this.setTranslations();
38
18
  }
39
- return `${dDisplay}${hDisplay}${mDisplay}`.trim();
40
- }
41
- render() {
42
- return (this.seconds >= 0 && this.translationsData ? this.renderDuration() : null);
43
- }
44
- /**
45
- * Render formatted duration string.
46
- *
47
- * @returns {JSX.Element}
48
- */
49
- renderDuration() {
50
- return (h("span", null, this.getDurationDisplayString(this.seconds)));
51
- }
52
- static get watchers() { return {
53
- "translations": ["setTranslations"]
54
- }; }
19
+ /**
20
+ * Get display string in days, hours, and minutes, eg. "1 d 23 h 4 min".
21
+ * Minimum display value is 1 minute.
22
+ *
23
+ * @param {number} seconds Duration in seconds.
24
+ * @returns {string}
25
+ */
26
+ getDurationDisplayString(seconds) {
27
+ const days = Math.floor(seconds / 86400);
28
+ const hours = Math.floor((seconds % 86400) / 3600);
29
+ const minutes = Math.floor(((seconds % 86400) % 3600) / 60);
30
+ const dDisplay = days > 0 ? `${days} ${this.translationsData.days} ` : '';
31
+ const hDisplay = hours > 0 ? `${hours} ${this.translationsData.hours} ` : '';
32
+ let mDisplay = minutes > 0 ? `${minutes} ${this.translationsData.minutes}` : '';
33
+ // Set minimum value of 1 min.
34
+ if (!dDisplay && !hDisplay && !mDisplay) {
35
+ mDisplay = '1 min';
36
+ }
37
+ return `${dDisplay}${hDisplay}${mDisplay}`.trim();
38
+ }
39
+ render() {
40
+ return (this.seconds >= 0 && this.translationsData ? this.renderDuration() : null);
41
+ }
42
+ /**
43
+ * Render formatted duration string.
44
+ *
45
+ * @returns {JSX.Element}
46
+ */
47
+ renderDuration() {
48
+ return (h("span", null, this.getDurationDisplayString(this.seconds)));
49
+ }
50
+ static get watchers() { return {
51
+ "translations": [{
52
+ "setTranslations": 0
53
+ }]
54
+ }; }
55
55
  };
56
56
 
57
57
  export { Time as mi_time };
@@ -0,0 +1,5 @@
1
+ var miVariables = {
2
+ miSDKUrlV4: 'https://app.mapsindoors.com/mapsindoors/js/sdk/4.52.0/mapsindoors-4.52.0.js.gz'
3
+ };
4
+
5
+ export { miVariables as m };