@mapsindoors/map-template 1.93.2 → 1.94.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (103) hide show
  1. package/dist/{GoogleMapsMap-982405ad.mjs → GoogleMapsMap-BqYRaFgc.mjs} +51 -62
  2. package/dist/MapboxMap-CUYrfLHY.mjs +34732 -0
  3. package/dist/_commonjsHelpers-ba3f0406.js +21 -0
  4. package/dist/combo-box-item.entry.js +15 -0
  5. package/dist/icon-b8d01d6f.js +24 -0
  6. package/dist/index-7e9696f3.js +1678 -0
  7. package/dist/index.js +1 -0
  8. package/dist/loader.js +18 -0
  9. package/dist/mapsindoors-react.es.js +3 -5
  10. package/dist/mapsindoors-react.umd.js +197 -582
  11. package/dist/mapsindoors-webcomponent.es.js +58512 -75790
  12. package/dist/mi-card_2.entry.js +28 -0
  13. package/dist/mi-chip.entry.js +22 -0
  14. package/dist/mi-column.entry.js +28 -0
  15. package/dist/mi-combo-box.entry.js +416 -0
  16. package/dist/mi-components.js +18 -0
  17. package/dist/mi-data-table.entry.js +302 -0
  18. package/dist/mi-distance_2.entry.js +67 -0
  19. package/dist/mi-dropdown-item.entry.js +15 -0
  20. package/dist/mi-dropdown.entry.js +610 -0
  21. package/dist/mi-floor-selector.entry.js +202 -0
  22. package/dist/mi-keyboard.entry.js +238 -0
  23. package/dist/mi-list-item-category.entry.js +48 -0
  24. package/dist/mi-list-item-location.entry.js +171 -0
  25. package/dist/mi-list.entry.js +56 -0
  26. package/dist/mi-location-booking.entry.js +5193 -0
  27. package/dist/mi-location-info.entry.js +63 -0
  28. package/dist/mi-map-googlemaps.entry.js +750 -0
  29. package/dist/mi-map-mapbox.entry.js +467 -0
  30. package/dist/mi-metric-card.entry.js +48 -0
  31. package/dist/mi-my-position.entry.js +986 -0
  32. package/dist/mi-notification.entry.js +127 -0
  33. package/dist/mi-route-instructions-heading.entry.js +73 -0
  34. package/dist/mi-route-instructions-maneuver-legacy.entry.js +82 -0
  35. package/dist/mi-route-instructions-maneuver.entry.js +82 -0
  36. package/dist/mi-route-instructions-step-legacy.entry.js +308 -0
  37. package/dist/mi-route-instructions-step.entry.js +321 -0
  38. package/dist/mi-route-instructions.entry.js +157 -0
  39. package/dist/mi-scroll-buttons.entry.js +112 -0
  40. package/dist/mi-search.entry.js +376 -0
  41. package/dist/mi-share-sms.entry.js +80 -0
  42. package/dist/mi-step-switcher.entry.js +31 -0
  43. package/dist/mi-tab-panel.entry.js +25 -0
  44. package/dist/mi-tab.entry.js +12 -0
  45. package/dist/mi-tabs.entry.js +47 -0
  46. package/dist/mi-time.entry.js +57 -0
  47. package/dist/mi-variables-9a6c8d4d.js +6 -0
  48. package/dist/polyfills/core-js.js +11 -0
  49. package/dist/polyfills/css-shim.js +1 -0
  50. package/dist/polyfills/dom.js +79 -0
  51. package/dist/polyfills/es5-html-element.js +1 -0
  52. package/dist/polyfills/index.js +34 -0
  53. package/dist/polyfills/system.js +6 -0
  54. package/dist/{reactcomponent-7fbbd9b2.mjs → reactcomponent-DTepe7hB.mjs} +14121 -14626
  55. package/dist/route-travel-mode.enum-7f4ce9c7.js +9 -0
  56. package/dist/sort-order.enum-64ce8998.js +552 -0
  57. package/dist/unit-system.enum-eaefb53e.js +7 -0
  58. package/dist/utils-ae714467.js +61 -0
  59. package/package.json +10 -6
  60. package/dist/MapboxMap-06ef82a3.mjs +0 -37815
  61. package/dist/_commonjsHelpers-ba3f0406-b96e6d6a.mjs +0 -22
  62. package/dist/combo-box-item.entry-d35f3d51.mjs +0 -15
  63. package/dist/icon-b8d01d6f-ddfa2c17.mjs +0 -25
  64. package/dist/mapsindoors-webcomponent.umd.js +0 -3245
  65. package/dist/mi-card_2.entry-fc772c35.mjs +0 -26
  66. package/dist/mi-chip.entry-81c742a1.mjs +0 -19
  67. package/dist/mi-column.entry-3a083282.mjs +0 -21
  68. package/dist/mi-combo-box.entry-cae6401a.mjs +0 -263
  69. package/dist/mi-data-table.entry-d4c3f445.mjs +0 -224
  70. package/dist/mi-distance_2.entry-a33ed69a.mjs +0 -339
  71. package/dist/mi-dropdown-item.entry-974d1e4f.mjs +0 -15
  72. package/dist/mi-dropdown.entry-5317db65.mjs +0 -349
  73. package/dist/mi-floor-selector.entry-185fbd8b.mjs +0 -115
  74. package/dist/mi-keyboard.entry-eaf4b9ef.mjs +0 -3103
  75. package/dist/mi-list-item-category.entry-9c95008c.mjs +0 -39
  76. package/dist/mi-list-item-location.entry-8b41e8f0.mjs +0 -137
  77. package/dist/mi-list.entry-1218d29d.mjs +0 -42
  78. package/dist/mi-location-booking.entry-270aaf5a.mjs +0 -4866
  79. package/dist/mi-location-info.entry-e4f7fd04.mjs +0 -32
  80. package/dist/mi-map-googlemaps.entry-81fa28d2.mjs +0 -467
  81. package/dist/mi-map-mapbox.entry-31821da3.mjs +0 -301
  82. package/dist/mi-metric-card.entry-40407f04.mjs +0 -29
  83. package/dist/mi-my-position.entry-bc48fe6e.mjs +0 -703
  84. package/dist/mi-notification.entry-9a2bc53b.mjs +0 -84
  85. package/dist/mi-route-instructions-heading.entry-e5b1ff04.mjs +0 -75
  86. package/dist/mi-route-instructions-maneuver-legacy.entry-2c3d73ab.mjs +0 -76
  87. package/dist/mi-route-instructions-maneuver.entry-c6f01024.mjs +0 -76
  88. package/dist/mi-route-instructions-step-legacy.entry-80bcf097.mjs +0 -202
  89. package/dist/mi-route-instructions-step.entry-db802e13.mjs +0 -231
  90. package/dist/mi-route-instructions.entry-62416e29.mjs +0 -143
  91. package/dist/mi-scroll-buttons.entry-92b62b21.mjs +0 -83
  92. package/dist/mi-search.entry-87f1e64a.mjs +0 -251
  93. package/dist/mi-share-sms.entry-b6725edb.mjs +0 -56
  94. package/dist/mi-step-switcher.entry-f8f6c040.mjs +0 -27
  95. package/dist/mi-tab-panel.entry-a89213c2.mjs +0 -22
  96. package/dist/mi-tab.entry-a2fb3f8c.mjs +0 -14
  97. package/dist/mi-tabs.entry-cd638ea7.mjs +0 -37
  98. package/dist/mi-time.entry-0b02870d.mjs +0 -46
  99. package/dist/mi-variables-9a6c8d4d-e06eec88.mjs +0 -8
  100. package/dist/route-travel-mode.enum-7f4ce9c7-a9c95a83.mjs +0 -8
  101. package/dist/sort-order.enum-64ce8998-b75ac596.mjs +0 -318
  102. package/dist/unit-system.enum-eaefb53e-0f424da4.mjs +0 -8
  103. package/dist/utils-ae714467-b07fc3be.mjs +0 -37
@@ -1,15 +0,0 @@
1
- import { r as t, g as s } from "./reactcomponent-7fbbd9b2.mjs";
2
- import "react";
3
- import "react-dom";
4
- const l = class {
5
- constructor(e) {
6
- t(this, e), this.selected = !1, this.disabled = !1, this.excludefromall = !1, this.value = void 0, this.text = void 0;
7
- }
8
- get el() {
9
- return s(this);
10
- }
11
- };
12
- export {
13
- l as mi_dropdown_item
14
- };
15
- //# sourceMappingURL=mi-dropdown-item.entry-974d1e4f.mjs.map
@@ -1,349 +0,0 @@
1
- import { r as p, c, h as n, H as u, g as f } from "./reactcomponent-7fbbd9b2.mjs";
2
- import { S as m, f as g } from "./sort-order.enum-64ce8998-b75ac596.mjs";
3
- import "react";
4
- import "react-dom";
5
- import "./_commonjsHelpers-ba3f0406-b96e6d6a.mjs";
6
- function b(t) {
7
- var e = [].slice.call(arguments, 1);
8
- return function() {
9
- return e.reduce(function(i, s) {
10
- return s(i);
11
- }, t.apply(null, arguments));
12
- };
13
- }
14
- var x = function(t) {
15
- return String.prototype.normalize ? t.normalize("NFKD").replace(/[\u0300-\u036F]/g, "") : t;
16
- }, w = function(t) {
17
- return Array.isArray(t) ? t : [t];
18
- };
19
- function I(t) {
20
- for (var e = [], i = 1; i < arguments.length; i++)
21
- e[i - 1] = arguments[i];
22
- return w(t).reduce(function(s, l, r) {
23
- return s + e[r - 1] + l;
24
- }).replace(/\s+/g, " ").trim();
25
- }
26
- var y = function(t) {
27
- return Array.isArray(t) ? t.join(" ") : t;
28
- }, v = function(t) {
29
- return t.toLocaleLowerCase();
30
- }, d = /* @__PURE__ */ b(y, x, I, v);
31
- const _ = `.mi-input[type=text],.mi-input[type=search],.mi-input[type=number],.mi-input[type=password],.mi-input[type=tel]{font-size:1rem;padding:8px;border-style:solid;border-width:1px;border-color:#8d98aa;border-radius:4px}.mi-input[type=text],.mi-input[type=search],.mi-input[type=number],.mi-input[type=password],.mi-input[type=range],.mi-input[type=tel]{display:block}.mi-input[type=radio],.mi-input[type=checkbox]{margin:0px;transform:scale(1.2, 1.2)}.mi-input[type=search]{padding-left:32px;background:url("data:image/svg+xml,%3Csvg width='20' height='20' viewBox='0 0 24 22' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M14.6267 8.43836C14.6267 11.8561 11.8561 14.6267 8.43836 14.6267C5.02062 14.6267 2.25 11.8561 2.25 8.43836C2.25 5.02062 5.02062 2.25 8.43836 2.25C11.8561 2.25 14.6267 5.02062 14.6267 8.43836Z' stroke='%23aeb9cb' stroke-width='2.5'/%3E%3Crect x='15.0979' y='14.1614' width='7.34678' height='1.32449' rx='0.662244' transform='rotate(45 15.0979 14.1614)' fill='%23aeb9cb' stroke='%23aeb9cb'/%3E%3Crect x='13.7847' y='13.2916' width='1.05276' height='0.697347' transform='rotate(45 13.7847 13.2916)' stroke='%23aeb9cb' stroke-width='0.697346'/%3E%3C/svg%3E%0A") no-repeat scroll 8px center, white}.mi-input:disabled{opacity:0.48;cursor:not-allowed}.mi-label{font-style:normal;display:block;font-size:1rem;font-weight:500;color:#1e2025}.mi-label>*{margin-top:4px}.mi-label>input[type=radio],.mi-label>input[type=checkbox],.mi-label>label.mi-toggle-btn{margin-right:8px}mi-dropdown-item{display:none}:host{display:inline-block;position:relative;-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;user-select:none;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"}:host(.open) .button::after{border-top-color:transparent;border-bottom-color:#1f2937;margin-top:-8px}:host(.open) section{display:flex}:host(.open) svg.arrow{transform:rotate(180deg)}.button{display:flex;justify-content:flex-start;align-items:center;height:100%;width:100%;font-family:inherit;background:linear-gradient(#f9fafb, #f3f4f6);padding:0;padding-left:16px;padding-right:16px;border-radius:4px;border-width:1px;border-style:solid;border-color:#d1d5db;color:#1c1917;font-size:1rem;font-weight:500;line-height:1rem;gap:8px}.button__left-icon{height:20px;width:20px}.button svg{margin-left:auto}.button__label{padding-top:12px;padding-bottom:12px;display:block;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.button__label--from-inner-html{display:grid;grid-auto-flow:column;grid-template-columns:24px 1fr;gap:8px;place-items:center}.button:disabled{opacity:0.72;cursor:not-allowed}.content{padding-top:12px;padding-bottom:12px;margin-top:12px;margin-bottom:12px;border-radius:8px;color:#1c1917;font-size:1rem;font-weight:500;background-color:#fcfcfc;box-shadow:0px 2px 2px rgba(0, 0, 0, 0.2), 0px 4px 4px rgba(0, 0, 0, 0.18), 0px 8px 8px rgba(0, 0, 0, 0.16);min-width:320px;max-width:480px;max-height:580px;display:none;flex-direction:column;position:fixed;z-index:10000}.content .filter{margin-bottom:16px;padding-left:8px;padding-right:8px;display:flex;position:relative}.content .filter__input{width:100%}.content .filter__clear{width:20px;height:20px;padding:0;border-width:0;display:flex;align-items:center;justify-content:center;position:absolute;right:14px;top:50%;transform:translateY(-50%);background-color:#1f2937;border-radius:50%}.content .filter__clear:focus{outline:0}.content .filter__clear--hidden{opacity:0;pointer-events:none}.content .filter__clear svg{fill:#fcfcfc;width:10px;height:10px}.content .options{margin-bottom:16px;padding-left:16px;padding-right:16px}.content .options__item{padding:0;color:#3b82f6;font-size:0.75rem;font-weight:500;font-family:inherit;background-color:transparent;border:transparent}.content .options__item:hover{text-decoration:underline}.content .options__item:first-child{margin-right:16px}.content .options__item:disabled{color:rgba(48, 113, 217, 0.72);cursor:not-allowed;text-decoration:none}.content .list{padding:0;margin:0;list-style:none;overflow-y:auto}.content .list__item{cursor:pointer}.content .list__item--disabled{opacity:0.72}.content .list__item--highlighted{background-color:#f3f4f6}.empty-page{display:flex;align-items:left;flex-direction:column;margin-left:16px;margin-bottom:12px}.empty-page>*{margin:0}.empty-page__header{font-size:1rem;font-weight:400;color:#374151}.label{display:flex;flex-direction:row;align-items:center;padding-left:16px;padding-right:16px;padding-top:8px;padding-bottom:8px}.label__item{display:inline-block;margin-top:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.label__item--from-inner-html{display:grid;grid-auto-flow:column;grid-template-columns:24px 1fr;gap:8px;place-items:center}.label__checkbox{margin-right:12px}.label__checkbox--hidden{display:none}`;
32
- var o;
33
- (function(t) {
34
- t.ArrowDown = "ArrowDown", t.ArrowUp = "ArrowUp", t.Enter = "Enter", t.Esc = "Escape";
35
- })(o || (o = {}));
36
- const E = class {
37
- constructor(t) {
38
- p(this, t), this.change = c(this, "change", 3), this.cleared = c(this, "cleared", 7), this.isFilterSelectionDisabled = !1, this.isClearButtonVisible = !1, this.isMouseOverEventDisabled = !1, this.currentItemIndex = 0, this.selectedItemIndex = 0, this.highlightedItemClassName = "list__item--highlighted", this.open = !1, this.items = [], this.itemsOrder = void 0, this.label = void 0, this.filterable = !1, this.placeholder = "Type to filter...", this.multiple = !1, this.selected = [], this.noResultsMessage = "No results found", this.iconSrc = void 0, this.iconAlt = void 0, this.dropdownAlignment = "left", this.currentItems = [], this.disabled = !1;
39
- }
40
- /**
41
- * Watcher for items property.
42
- */
43
- onItemsChanged(t) {
44
- if (t.some((e) => e.tagName.toLowerCase() !== "mi-dropdown-item"))
45
- throw new Error("Items contains unknown element(s).");
46
- if (Object.values(m).includes(this.itemsOrder) && (t = this.getSortedItems(t)), this.currentItems = [...t], this.filter(), !this.multiple) {
47
- const e = this.currentItems.findIndex((i) => i.selected);
48
- this.currentItemIndex = e > -1 ? e : 0, this.selectedItemIndex = this.currentItemIndex;
49
- }
50
- this.items.forEach((e, i) => {
51
- e.dataset.index = i.toString(), e.dataset.excludefromall = `${e.excludefromall}`;
52
- }), this.selectFirstMiDropdownItem();
53
- }
54
- /**
55
- * Watcher for currentItems property.
56
- */
57
- onCurrentItemsChange() {
58
- this.isFilterSelectionDisabled = this.currentItems.length === 0;
59
- }
60
- /**
61
- * Keyboard event listener.
62
- * When the Tab key is pressed, the focus is set to the filter input field (If present).
63
- *
64
- * @param {KeyboardEvent} event
65
- * @returns {void}
66
- */
67
- handleKeyDown(t) {
68
- var e;
69
- t.key === "Tab" && this.open && ((e = this.filterElement) === null || e === void 0 || e.focus(), t.preventDefault());
70
- }
71
- /**
72
- * Outside the dropdown listener. It will close the dropdown when a click is outside a dropdown and dropdown list.
73
- *
74
- * @param {Event} event
75
- */
76
- checkForClickOutside(t) {
77
- this.hostElement.contains(t.target) || (this.open = !1);
78
- }
79
- /**
80
- * Mousemove event handler.
81
- * When the mouse is moved the mouseover event handler is enabled.
82
- */
83
- mouseMoveEventHandler() {
84
- this.isMouseOverEventDisabled = !1;
85
- }
86
- /**
87
- * Scroll event handler.
88
- * The dropdown is closed when the scroll event is trigget outside the dropdown.
89
- */
90
- scrollEventHandler(t) {
91
- const e = t.target;
92
- (!e || !this.hostElement.contains(e)) && (this.open = !1);
93
- }
94
- /**
95
- * Resize event handler.
96
- * Recalculate the position of the dropdown when the window is resized.
97
- */
98
- resizeEventHandler() {
99
- this.calculateDropDownPosition();
100
- }
101
- /**
102
- * Lifecycle method called when the component is loaded in the DOM.
103
- */
104
- componentDidLoad() {
105
- this.createMiDropdownItemsFromDocument(), this.selectFirstMiDropdownItem(), this.enableKeyboardNavigationEvents();
106
- const t = new IntersectionObserver((e) => {
107
- e.forEach((i) => {
108
- i.isIntersecting === !0 && this.filterElement.focus();
109
- });
110
- });
111
- this.filterElement !== void 0 && (t.observe(this.filterElement), this.filterElement.addEventListener("keydown", (e) => {
112
- (e.key === o.ArrowDown || e.key === o.ArrowUp) && e.preventDefault();
113
- }));
114
- }
115
- /**
116
- * Lifecycle method called when the component is updated.
117
- */
118
- componentDidRender() {
119
- this.calculateDropDownPosition(), this.multiple || this.highlightItem(this.currentItemIndex, !0);
120
- }
121
- /**
122
- * Gets all mi-dropdown-item elements for the mi-dropdown items property.
123
- */
124
- createMiDropdownItemsFromDocument() {
125
- const t = this.items && this.items.length > 0 ? this.items : this.hostElement.querySelectorAll("mi-dropdown-item");
126
- t.length > 0 && (this.items = Array.from(t));
127
- }
128
- /**
129
- * Set the first mi-dropdown-item as the textual content of the button.
130
- */
131
- selectFirstMiDropdownItem() {
132
- var t;
133
- if (!this.multiple) {
134
- const e = (t = this.items) === null || t === void 0 ? void 0 : t.findIndex((i) => i.selected);
135
- this.selected = [this.items[e > -1 ? e : 0]];
136
- }
137
- }
138
- /**
139
- * Enables cycling through the items in the content window using arrow up/down keys.
140
- */
141
- enableKeyboardNavigationEvents() {
142
- this.hostElement.addEventListener("keydown", (t) => {
143
- if (this.open === !1 && t.key === o.ArrowDown) {
144
- this.isMouseOverEventDisabled = !0, this.toggleContentWindow(), t.preventDefault();
145
- return;
146
- }
147
- if (this.open === !0 && !this.multiple)
148
- switch (t.key) {
149
- case o.ArrowDown:
150
- this.isMouseOverEventDisabled = !0, this.currentItemIndex = (this.currentItemIndex + 1) % this.currentItems.length, this.highlightItem(this.currentItemIndex, !0), t.preventDefault();
151
- break;
152
- case o.ArrowUp:
153
- this.isMouseOverEventDisabled = !0, this.currentItemIndex = (this.currentItemIndex + this.currentItems.length - 1) % this.currentItems.length, this.highlightItem(this.currentItemIndex, !0), t.preventDefault();
154
- break;
155
- case o.Enter:
156
- if (this.hostElement.shadowRoot.activeElement === this.clearButtonElement)
157
- return;
158
- this.currentItems[this.currentItemIndex] !== void 0 && this.onSelect(this.currentItems[this.currentItemIndex]), t.preventDefault();
159
- break;
160
- }
161
- t.key === o.Esc && (this.multiple || (this.currentItemIndex = this.selectedItemIndex, this.highlightItem(this.currentItemIndex)), this.toggleContentWindow(), this.clearFilter());
162
- });
163
- }
164
- /**
165
- * Updates the currently highlighted item in the markup.
166
- *
167
- * @param {number} itemIndex
168
- */
169
- highlightItem(t, e = !1) {
170
- var i, s;
171
- const l = this.hostElement.shadowRoot.querySelectorAll(".list__item");
172
- l.forEach((r) => {
173
- r.classList.remove(this.highlightedItemClassName);
174
- }), (i = l[t]) === null || i === void 0 || i.classList.add(this.highlightedItemClassName), e && ((s = l[t]) === null || s === void 0 || s.scrollIntoView({ block: "nearest", inline: "nearest" }));
175
- }
176
- /**
177
- * Get sorted items.
178
- * The sorting order is defined by the itemsOrder attribute.
179
- *
180
- * @param {HTMLMiDropdownItemElement[]} items
181
- * @returns {HTMLMiDropdownItemElement[]}
182
- */
183
- getSortedItems(t) {
184
- return this.itemsOrder === m.Asc ? t.sort((e, i) => (e.text || e.innerText).trimStart().toLowerCase().localeCompare((i.text || i.innerText).trimStart().toLowerCase(), void 0, { numeric: !0 })) : t.sort((e, i) => (i.text || i.innerText).trimStart().toLowerCase().localeCompare((e.text || e.innerText).trimStart().toLowerCase(), void 0, { numeric: !0 })), t;
185
- }
186
- /**
187
- * Update and emit list of selected items.
188
- */
189
- onChangedHandler() {
190
- this.selected = [...this.items.filter((t) => t.selected)], this.change.emit(this.selected);
191
- }
192
- /**
193
- * Toggle visibility of content window.
194
- */
195
- toggleContentWindow() {
196
- this.open = !this.open;
197
- }
198
- /**
199
- * Check all checkboxes.
200
- */
201
- selectAll() {
202
- const t = Array.from(this.currentItems);
203
- for (const e of t)
204
- e.selected = !(`${e.dataset.excludefromall}` == "true" || e.disabled);
205
- this.onChangedHandler();
206
- }
207
- /**
208
- * Uncheck all checkboxes.
209
- */
210
- selectNone() {
211
- const t = Array.from(this.currentItems);
212
- for (const e of t)
213
- e.selected = !1;
214
- this.onChangedHandler();
215
- }
216
- /**
217
- * Select or toggle selection of item.
218
- *
219
- * @param {HTMLMiDropdownItemElement} item
220
- */
221
- onSelect(t) {
222
- this.multiple || (this.open = !1, Array.from(this.items).forEach((i) => {
223
- i.selected = !1;
224
- }), this.clearFilter()), t.selected = !t.selected, this.currentItemIndex = Number(t.dataset.index), this.selectedItemIndex = this.currentItemIndex, this.onChangedHandler();
225
- }
226
- /**
227
- * Highlights the item that the cursor is hovering in the content window.
228
- *
229
- * @param {number} filteredItemsIndex
230
- */
231
- onMouseOver(t) {
232
- !this.isMouseOverEventDisabled && !this.multiple && (this.highlightItem(t), this.currentItemIndex = t);
233
- }
234
- /**
235
- * Filter items based on the input query.
236
- */
237
- filter() {
238
- if (this.filterElement) {
239
- const t = this.filterElement.value, e = this.items.map((a) => d(a.text) || d(a.innerText)), i = this.currentItems.length;
240
- if (t === "") {
241
- this.currentItemIndex = this.selectedItemIndex, this.isClearButtonVisible = !1, this.currentItems = [...this.items];
242
- return;
243
- } else
244
- this.isClearButtonVisible = !0;
245
- const s = {
246
- limit: 50,
247
- allowTypo: !1,
248
- threshold: -1e4
249
- }, r = g.go(d(t), e, s).map((a) => this.items.find((h) => (d(h.text) || d(h.innerText)) === d(a.target)));
250
- this.currentItems = r, i !== this.currentItems.length && (this.currentItemIndex = 0);
251
- }
252
- }
253
- /**
254
- * Clear filter.
255
- */
256
- clearFilter() {
257
- this.filterElement && (this.filterElement.value = "", this.filterElement.focus(), this.currentItems = this.items, this.cleared.emit()), this.isClearButtonVisible = !1;
258
- }
259
- /**
260
- * Render the dropdown component.
261
- *
262
- * @returns {JSX.Element}
263
- */
264
- render() {
265
- const t = this.filterable ? this.renderFiltering() : null, e = this.multiple ? this.renderMultipleOptions() : null, i = this.iconSrc ? this.renderLeftSideIcon() : null, s = n("ul", { class: "list" }, this.currentItems.map((l, r) => this.renderListItem(l, r, !!e)));
266
- return n(u, { class: { open: this.open } }, n("button", { part: "button", class: "button", disabled: this.disabled || this.items.length === 0, onClick: () => this.toggleContentWindow() }, i, this.renderButtonLabel(), n("svg", { class: "arrow", part: "icon-down-arrow", width: "12", height: "6", viewBox: "0 0 18 10", xmlns: "http://www.w3.org/2000/svg" }, n("path", { d: "M9.37165 9.58706C9.17303 9.80775 8.82697 9.80775 8.62835 9.58706L0.751035 0.834484C0.46145 0.512722 0.689796 7.73699e-08 1.12268 1.25924e-07L16.8773 1.89302e-06C17.3102 1.94157e-06 17.5386 0.512723 17.249 0.834484L9.37165 9.58706Z" }))), n("section", { ref: (l) => this.listElement = l, part: "dropdown-container", class: "content", "tab-index": "1" }, t, e, this.currentItems.length === 0 ? this.renderNoResultsTemplate() : s));
267
- }
268
- /**
269
- * Helper function to render markup when no items are available to be displayed in the content window.
270
- *
271
- * @returns {JSX.Element}
272
- */
273
- renderNoResultsTemplate() {
274
- return n("div", { class: "empty-page" }, n("p", { class: "empty-page__header" }, this.noResultsMessage));
275
- }
276
- /**
277
- * Helper function to render the button label.
278
- *
279
- * @returns {JSX.Element}
280
- */
281
- renderButtonLabel() {
282
- var t, e, i, s, l;
283
- const r = (t = this.label) !== null && t !== void 0 ? t : (i = (e = this.selected) === null || e === void 0 ? void 0 : e[0]) === null || i === void 0 ? void 0 : i.text;
284
- return r > "" ? n("div", { part: "button-label", class: "button__label" }, r) : !((l = (s = this.selected) === null || s === void 0 ? void 0 : s[0]) === null || l === void 0) && l.innerHTML ? n("div", { part: "button-label", class: "button__label button__label--from-inner-html", innerHTML: this.selected[0].innerHTML }) : n("div", { part: "button-label", class: "button__label" });
285
- }
286
- /**
287
- * Helper function to render an icon when an image source is provided.
288
- *
289
- * @returns {JSX.Element}
290
- */
291
- renderLeftSideIcon() {
292
- return n("img", { part: "button-icon", class: "button__left-icon", src: this.iconSrc, alt: this.iconAlt ? this.iconAlt : "" });
293
- }
294
- /**
295
- * Helper function for rendering the filtering UI.
296
- *
297
- * @returns {JSX.Element}
298
- */
299
- renderFiltering() {
300
- return n("div", { class: "filter" }, n("input", { type: "text", class: "mi-input filter__input", placeholder: this.placeholder, ref: (t) => this.filterElement = t, onInput: () => {
301
- this.filter();
302
- }, tabIndex: this.open ? 0 : -1 }), n("button", { ref: (t) => this.clearButtonElement = t, tabindex: this.isClearButtonVisible ? 0 : -1, type: "button", onClick: () => this.clearFilter(), class: `filter__clear ${this.isClearButtonVisible === !1 ? "filter__clear--hidden" : ""}`, "aria-label": "Clear" }, n("svg", { viewBox: "0 0 14 14", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, n("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" }))));
303
- }
304
- /**
305
- * Helper function for rendering the multi select options.
306
- *
307
- * @returns {JSX.Element}
308
- */
309
- renderMultipleOptions() {
310
- return n("div", { class: "options" }, n("button", { class: "options__item", disabled: this.isFilterSelectionDisabled, onClick: () => this.selectAll() }, "Select all"), n("button", { class: "options__item", disabled: this.isFilterSelectionDisabled, onClick: () => this.selectNone() }, "Select none"));
311
- }
312
- /**
313
- * Helper function for rendering list item.
314
- *
315
- * @param {HTMLMiDropdownItemElement} item
316
- * @param {number} index
317
- * @param {boolean} showCheckBox
318
- * @returns {JSX.Element}
319
- */
320
- renderListItem(t, e, i) {
321
- let s;
322
- const l = t.getAttribute("title") || t.text || t.innerText;
323
- return t.innerText.length > 0 ? s = n("div", { class: "label__item label__item--from-inner-html", innerHTML: t.innerHTML }) : s = n("div", { class: "label__item", innerHTML: t.text }), n("li", { class: { list__item: !0, "list__item--disabled": t.disabled }, title: l, onMouseOver: () => {
324
- this.onMouseOver(e);
325
- } }, n("label", { class: "mi-label label", tabindex: "-1" }, n("input", { class: { label__checkbox: !0, "label__checkbox--hidden": !i, "mi-input": !0 }, type: "checkbox", value: e, checked: t.selected, disabled: t.disabled, "data-excludefromall": t.excludefromall, onChange: () => this.onSelect(t) }), s));
326
- }
327
- /**
328
- * Function for calculating the position of the dropdown list element.
329
- */
330
- calculateDropDownPosition() {
331
- this.listElement.style.bottom = null, this.listElement.style.left = null, this.listElement.style.right = null, this.listElement.style.top = null, this.listElement.style.maxHeight = null, this.listElement.style.minWidth = null;
332
- const { clientWidth: t, clientHeight: e } = document.documentElement, i = this.hostElement.getBoundingClientRect(), s = this.listElement.getBoundingClientRect(), l = e - i.bottom, r = i.top, a = 580, h = 12;
333
- t <= s.width || i.right - s.width < 0 && s.right > t ? (this.listElement.style.right = `${h}px`, this.listElement.style.left = `${h}px`, this.listElement.style.minWidth = "unset") : s.right > t || this.dropdownAlignment === "right" ? (this.listElement.style.left = "unset", this.listElement.style.right = `${t - i.right}px`) : (this.listElement.style.left = `${i.left}px`, this.listElement.style.right = "unset"), r > l ? (this.listElement.style.maxHeight = `${Math.min(r, a)}px`, this.listElement.style.top = "unset", this.listElement.style.bottom = `${e - i.top}px`) : (this.listElement.style.top = `${i.bottom}px`, this.listElement.style.bottom = "unset", this.listElement.style.maxHeight = `${Math.min(l - h * 2, a)}px`);
334
- }
335
- get hostElement() {
336
- return f(this);
337
- }
338
- static get watchers() {
339
- return {
340
- items: ["onItemsChanged"],
341
- currentItems: ["onCurrentItemsChange"]
342
- };
343
- }
344
- };
345
- E.style = _;
346
- export {
347
- E as mi_dropdown
348
- };
349
- //# sourceMappingURL=mi-dropdown.entry-5317db65.mjs.map
@@ -1,115 +0,0 @@
1
- import { r as T, h as N, H as g, g as l } from "./reactcomponent-7fbbd9b2.mjs";
2
- import "react";
3
- import "react-dom";
4
- const s = '.mi-floor-selector{width:-moz-min-content;width:min-content;display:flex;align-items:flex-start;position:relative;overflow:hidden;animation-duration:0.15s;-webkit-user-select:none;-moz-user-select:none;user-select:none;pointer-events:auto;border-radius:56px;border-width:1px;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";font-size:0.875rem;border-color:#e5e7eb;border-style:solid;background-color:#fcfcfc}.mi-floor-selector--hidden{display:none}.mi-floor-selector__button{position:absolute;z-index:4;top:4px;right:4px;left:4px;background-position:center;background-repeat:no-repeat;border-width:1px;background-color:#f9fafb;border-color:#e5e7eb;border-style:solid;border-radius:50%;width:40px;height:40px}.mi-floor-selector__button:hover{background-color:#f3f4f6}.mi-floor-selector__button--open{background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTIiIGhlaWdodD0iMTIiIHZpZXdCb3g9IjAgMCAxMiAxMiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTcuMTUwNDUgNi4wODk5OEM3LjEzODUgNi4wNzg3NiA3LjEyODk3IDYuMDY1MjEgNy4xMjI0NSA2LjA1MDE2QzcuMTE1OTQgNi4wMzUxMSA3LjExMjU3IDYuMDE4ODggNy4xMTI1NyA2LjAwMjQ4QzcuMTEyNTcgNS45ODYwOCA3LjExNTk0IDUuOTY5ODYgNy4xMjI0NSA1Ljk1NDgxQzcuMTI4OTcgNS45Mzk3NiA3LjEzODUgNS45MjYyIDcuMTUwNDUgNS45MTQ5OEwxMS43ODA1IDEuMjc5OThDMTEuODUwNiAxLjIxMDY5IDExLjkwNjMgMS4xMjgxNiAxMS45NDQzIDEuMDM3MThDMTEuOTgyMyAwLjk0NjIwMSAxMi4wMDE5IDAuODQ4NTgyIDEyLjAwMTkgMC43NDk5ODJDMTIuMDAxOSAwLjY1MTM4MiAxMS45ODIzIDAuNTUzNzYzIDExLjk0NDMgMC40NjI3ODRDMTEuOTA2MyAwLjM3MTgwNSAxMS44NTA2IDAuMjg5Mjc2IDExLjc4MDUgMC4yMTk5ODJDMTEuNjM5MiAwLjA4MDc0MTkgMTEuNDQ4OCAwLjAwMjY4NTU1IDExLjI1MDUgMC4wMDI2ODU1NUMxMS4wNTIxIDAuMDAyNjg1NTUgMTAuODYxNyAwLjA4MDc0MTkgMTAuNzIwNSAwLjIxOTk4Mkw2LjA5MDQ1IDQuODQ5OThDNi4wNzg3OSA0Ljg2MjA4IDYuMDY0ODEgNC44NzE3IDYuMDQ5MzUgNC44NzgyN0M2LjAzMzg5IDQuODg0ODUgNi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4K)}.mi-floor-selector__button--open+.mi-floor-selector__list{max-height:300px;overflow:auto;flex-wrap:unset}.mi-floor-selector__button--closed{background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTAuOTY3Mzc0IDYuMTY2NjRMOS4wMDA3MSA5LjY1ODMxQzkuMzE2MTIgOS43OTU5NiA5LjY1NjU2IDkuODY3MDIgMTAuMDAwNyA5Ljg2NzAyQzEwLjM0NDkgOS44NjcwMiAxMC42ODUzIDkuNzk1OTYgMTEuMDAwNyA5LjY1ODMxTDE5LjA0MjQgNi4xNjY2NEMxOS4yNjczIDYuMDY2MTcgMTkuNDU4IDUuOTAyMjkgMTkuNTkxMiA1LjY5NTA4QzE5LjcyNDUgNS40ODc4NiAxOS43OTQzIDUuMjQ2MyAxOS43OTI0IDQuOTk5OTdDMTkuNzkzMSA0Ljc1NjAxIDE5LjcyMTQgNC41MTczMiAxOS41ODY0IDQuMzE0MUMxOS40NTE0IDQuMTEwODggMTkuMjU5MiAzLjk1MjI2IDE5LjAzNCAzLjg1ODMxTDExLjAwMDcgMC4zNzQ5NzJDMTAuNjg1MyAwLjIzNzMxNCAxMC4zNDQ5IDAuMTY2MjYgMTAuMDAwNyAwLjE2NjI2QzkuNjU2NTYgMC4xNjYyNiA5LjMxNjEyIDAuMjM3MzE0IDkuMDAwNzEgMC4zNzQ5NzJMMC45NjczNzQgMy44NzQ5N0MwLjc0NDgzNiAzLjk2NzgzIDAuNTU0Mzk4IDQuMTIzODggMC40MTk2MTggNC4zMjM4M0MwLjI4NDgzNyA0LjUyMzc4IDAuMjExNjI2IDQuNzU4ODUgMC4yMDkwNDEgNC45OTk5N0MwLjIwNjY5OCA1LjI0NzQ2IDAuMjc3MzkxIDUuNDkwMTUgMC40MTIyN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OTkyMzIgMTMuNDAwMUwwLjk1ODk4OSAxMy44NTAxQzAuNzM2MDMzIDEzLjk0ODUgMC41NDY0NyAxNC4xMDk2IDAuNDEzMzI5IDE0LjMxMzhDMC4yODAxODggMTQuNTE3OSAwLjIwOTIgMTQuNzU2MyAwLjIwODk4OSAxNS4wMDAxQzAuMjA4MzAzIDE1LjI0NCAwLjI3OTk4NSAxNS40ODI3IDAuNDE0OTcgMTUuNjg1OUMwLjU0OTk1NSAxNS44ODkyIDAuNzQyMTc3IDE2LjA0NzggMC45NjczMjMgMTYuMTQxN0w5LjAwMDY2IDE5LjY0MTdDOS4zMTYwNyAxOS43Nzk0IDkuNjU2NTEgMTkuODUwNSAxMC4wMDA3IDE5Ljg1MDVDMTAuMzQ0OCAxOS44NTA1IDEwLjY4NTIgMTkuNzc5NCAxMS4wMDA3IDE5LjY0MTdMMTkuMDM0IDE2LjE0MTdDMTkuMjU5MSAxNi4wNDc4IDE5LjQ1MTQgMTUuODg5MiAxOS41ODYzIDE1LjY4NTlDMTkuNzIxMyAxNS40ODI3IDE5Ljc5MyAxNS4yNDQgMTkuNzkyMyAxNS4wMDAxQzE5Ljc5NDcgMTQuNzUyNiAxOS43MjQgMTQuNTA5OSAxOS41ODkxIDE0LjMwMjRDMTkuNDU0MiAxNC4wOTQ5IDE5LjI2MTEgMTMuOTMxNyAxOS4wMzQgMTMuODMzNFoiIGZpbGw9IiM3MDcwNzAiLz4KPC9zdmc+Cg==)}.mi-floor-selector__button span{position:none}.mi-floor-selector__list{box-sizing:unset;display:flex;flex-direction:column;gap:4px;overflow-y:hidden;transition:max-height 0.25s;scroll-behavior:smooth;z-index:0;border-radius:9999px;padding:4px;padding-top:48px;max-height:40px}.mi-floor-selector__list::before,.mi-floor-selector__list::after{content:"";height:100%;position:absolute;pointer-events:none;z-index:3;left:-1px;right:-1px;transition:opacity 0.1s;opacity:0}.mi-floor-selector__list--fade-top::before{opacity:1;top:-1px;background:linear-gradient(180deg, white 39px, rgba(255, 255, 255, 0) 86px)}.mi-floor-selector__list--fade-bottom::after{opacity:1;bottom:-1px;background:linear-gradient(0deg, white 4px, rgba(255, 255, 255, 0) 40px)}.mi-floor-selector__list::-webkit-scrollbar{width:4px}.mi-floor-selector__list::-webkit-scrollbar-track{background:none}.mi-floor-selector__list::-webkit-scrollbar-thumb{background:#8D98AA;border-radius:5px}.mi-floor-selector__floor{position:relative;order:1;flex-shrink:0;margin-top:-1px;z-index:0;float:none;text-align:center;background:none;transition:translateY 0.25s;transform:translateY(0px);color:#666666;border-radius:50%;text-overflow:ellipsis;overflow:hidden;white-space:nowrap;border-style:none;width:40px;height:40px}.mi-floor-selector__floor:hover{z-index:2;background-color:#d1d5db}.mi-floor-selector__floor--active{z-index:2;transform:translateY(0px);color:#fcfcfc}.mi-floor-selector__floor-text{display:block;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;padding-left:4px;padding-right:4px}', j = class {
5
- constructor(M) {
6
- T(this, M), this.maxListHeight = 300, this.mapsindoors = void 0, this.primaryColor = "#005655", this.floors = new Array(), this.currentFloor = void 0, this.floorSelectorClosed = !0, this.fadeFloorSelectorOnTop = !1, this.fadeFloorSelectorOnBottom = !1;
7
- }
8
- /**
9
- * Scrolling the floorList element to the selected floor.
10
- */
11
- scrollToSelectedFloor() {
12
- const M = this.floorSelectorElement.clientHeight, e = this.floorListElement.scrollHeight, o = this.currentFloorElement.offsetTop, i = this.currentFloorElement.offsetHeight;
13
- let t;
14
- e > M ? (t = o - M / 2 + i / 2, t = Math.max(0, t), t = Math.min(t, e - M)) : t = 0, this.floorListElement.scrollTop = t;
15
- }
16
- /**
17
- * Applies a 'transform: translateY()' animation to the provided element.
18
- *
19
- * @param {HTMLElement} element
20
- * @param {number} distance
21
- * @param {number} duration
22
- */
23
- animateTranslateY(M, e, o) {
24
- const i = [{ transform: `translateY(${e}px)` }];
25
- M.animate(i, { duration: o, fill: "forwards" });
26
- }
27
- /**
28
- * Calls the animation for the needed elements with the calculated animation values.
29
- */
30
- animateFloorSelector() {
31
- const M = this.el.querySelectorAll(".mi-floor-selector__floor"), e = [];
32
- for (let o = 0; o < M.length && M[o].getAttribute("data-floor") !== this.currentFloor; o++)
33
- e.push(M[o]);
34
- if (this.floorSelectorClosed) {
35
- const o = this.floorListElement.scrollTop, i = parseInt(window.getComputedStyle(this.floorListElement).getPropertyValue("padding-top")), r = -(this.currentFloorElement.offsetTop - this.floorListElement.offsetTop - o - i);
36
- this.animateTranslateY(this.currentFloorElement, r, 250), this.floorListElement.scrollTop > 0 ? M.forEach((D) => {
37
- D.getAttribute("data-floor") !== this.currentFloor && (e.indexOf(D) > -1 ? this.animateTranslateY(D, D.offsetTop + this.floorListElement.scrollTop, 250) : this.animateTranslateY(D, this.floorListElement.scrollTop, 250));
38
- }) : e.forEach((D) => {
39
- this.animateTranslateY(D, D.offsetTop, 250);
40
- });
41
- } else
42
- this.animateTranslateY(this.currentFloorElement, 0, 250), M.forEach((o) => {
43
- o.getAttribute("data-floor") !== this.currentFloor && this.animateTranslateY(o, 0, 250);
44
- });
45
- }
46
- /**
47
- * Toggles the floor selector open-close.
48
- */
49
- onToggleFloorSelector() {
50
- this.floorSelectorClosed = !this.floorSelectorClosed, this.animateFloorSelector(), this.floorListElement.addEventListener("transitionend", () => {
51
- this.floorSelectorClosed || this.scrollToSelectedFloor(), this.onScrollStyle();
52
- }, { once: !0 });
53
- }
54
- /**
55
- * Adding/removing classes to the floorlist to fade-in/out the top/bottom part of the container..
56
- */
57
- onScrollStyle() {
58
- const M = this.floorListElement.scrollHeight - this.floorListElement.clientHeight;
59
- if (this.floorSelectorClosed) {
60
- this.fadeFloorSelectorOnTop = !1, this.fadeFloorSelectorOnBottom = !1;
61
- return;
62
- }
63
- this.maxListHeight > this.floorListElement.clientHeight - 48 || (this.fadeFloorSelectorOnTop = this.floorListElement.scrollTop > 0, this.fadeFloorSelectorOnBottom = this.floorListElement.scrollTop !== M);
64
- }
65
- /**
66
- * Sets the clicked floor active.
67
- *
68
- * @param {PointerEvent} event
69
- */
70
- onSelectFloor(M, e) {
71
- this.mapsindoors.setFloor(e), this.currentFloor = this.mapsindoors.getFloor().toString(), this.currentFloorElement = M.currentTarget;
72
- }
73
- /**
74
- * Called every time the component is connected to the DOM.
75
- * It resets the floorlist and the active floor when the building changes.
76
- */
77
- connectedCallback() {
78
- this.mapsindoors.addListener("building_changed", () => {
79
- this.floors = [];
80
- const M = this.mapsindoors.getBuilding();
81
- if (M) {
82
- const e = () => {
83
- this.currentFloor = this.mapsindoors.getFloor().toString(), this.mapsindoors.removeListener("floor_changed", e);
84
- };
85
- this.mapsindoors.getFloor() === null || this.mapsindoors.getFloor() === void 0 ? this.mapsindoors.addListener("floor_changed", e) : this.currentFloor = this.mapsindoors.getFloor().toString(), Object.keys(M.floors).sort((o, i) => i - o).forEach((o) => {
86
- M.floors[o].index = o, this.floors.push(M.floors[o]);
87
- });
88
- }
89
- }), this.mapsindoors.addListener("floor_changed", () => {
90
- this.currentFloor = this.mapsindoors.getFloor().toString();
91
- });
92
- }
93
- /**
94
- * Called after every render().
95
- */
96
- componentDidRender() {
97
- !this.mapsindoors.getBuilding() || this.mapsindoors.getFloor() === null || this.mapsindoors.getFloor() === void 0 ? this.floorSelectorElement.classList.add("mi-floor-selector--hidden") : this.floorSelectorElement.classList.remove("mi-floor-selector--hidden"), this.currentFloorElement = this.el.querySelector(".mi-floor-selector__floor--active"), this.currentFloorElement && this.currentFloor && this.animateFloorSelector();
98
- }
99
- /**
100
- * Renders the floor selector.
101
- *
102
- * @returns {JSX.Element}
103
- */
104
- render() {
105
- return N(g, null, N("div", { class: "mi-floor-selector", ref: (M) => this.floorSelectorElement = M }, N("button", { class: `mi-floor-selector__button mi-floor-selector__button--${this.floorSelectorClosed ? "closed" : "open"}`, onClick: () => this.onToggleFloorSelector() }), N("div", { class: `mi-floor-selector__list ${this.fadeFloorSelectorOnTop ? "mi-floor-selector__list--fade-top" : ""} ${this.fadeFloorSelectorOnBottom ? "mi-floor-selector__list--fade-bottom" : ""}`, ref: (M) => this.floorListElement = M, onScroll: () => this.onScrollStyle() }, this.floors.map((M) => N("button", { "data-floor": M.index, style: this.currentFloor === M.index ? { backgroundColor: this.primaryColor } : {}, class: `mi-floor-selector__floor ${this.currentFloor === M.index ? "mi-floor-selector__floor--active" : ""}`, onClick: (e) => this.onSelectFloor(e, M.index) }, N("span", null, M.name))))));
106
- }
107
- get el() {
108
- return l(this);
109
- }
110
- };
111
- j.style = s;
112
- export {
113
- j as mi_floor_selector
114
- };
115
- //# sourceMappingURL=mi-floor-selector.entry-185fbd8b.mjs.map