@mapsindoors/map-template 1.95.2 → 1.95.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/mi-data-table.entry.js +4 -2
- package/dist/mi-dropdown.entry.js +4 -2
- package/dist/mi-floor-selector.entry.js +5 -1
- package/dist/mi-keyboard.entry.js +3 -1
- package/dist/mi-list.entry.js +5 -1
- package/dist/mi-my-position.entry.js +6 -2
- package/dist/mi-route-instructions.entry.js +2 -0
- package/dist/mi-scroll-buttons.entry.js +5 -3
- package/dist/mi-search.entry.js +14 -2
- package/dist/mi-share-sms.entry.js +3 -1
- package/package.json +1 -1
|
@@ -53,6 +53,8 @@ const DataTable = class {
|
|
|
53
53
|
this.renderTableContent();
|
|
54
54
|
}
|
|
55
55
|
connectedCallback() {
|
|
56
|
+
if (!this.rows)
|
|
57
|
+
return;
|
|
56
58
|
const miColumns = this.el.querySelectorAll('mi-column');
|
|
57
59
|
this.columns = Array.from(miColumns).map((miColumn) => {
|
|
58
60
|
const column = {
|
|
@@ -174,12 +176,12 @@ const DataTable = class {
|
|
|
174
176
|
}
|
|
175
177
|
}
|
|
176
178
|
render() {
|
|
177
|
-
return (h(Host, { key: '
|
|
179
|
+
return (h(Host, { key: 'fc96b149bc557f8d2ef6fd95bf89d2596e748bd3' }, h("table", { key: '9939b343c303eabb12b894487e7a2218d9f1cf7b', class: "table" }, h("thead", { key: '0198ecdcf36e13590187ca682a52f6216e0423c1' }, h("tr", { key: '1a6f6eb7c26b8d37b93c8189da6cf64360a32285' }, this.renderSelectHeader(), this.columns.map(column => {
|
|
178
180
|
var _a;
|
|
179
181
|
const width = !column.fitContent ? column.width || 'auto' : '';
|
|
180
182
|
const sortOrder = ((_a = this.sortByColumn) === null || _a === void 0 ? void 0 : _a.column) === column ? this.sortByColumn.sortOrder : null;
|
|
181
183
|
return h("th", { "data-binding": column.binding, style: { 'width': width, 'max-width': width, 'min-width': width }, onClick: (event) => this.columnHeaderClickHandler(event, column), class: `table__header-cell ${this.isHeaderSticky ? 'table__header-cell--sticky' : ''} ${isNullOrUndefined(column.sortable) ? 'table__header-cell--no-sort' : ''} ${isNullOrUndefined(sortOrder) ? '' : sortOrder} ${column.fitContent ? 'table__header-cell--fit-content' : ''}` }, column.label);
|
|
182
|
-
}))), h("tbody", { key: '
|
|
184
|
+
}))), h("tbody", { key: '5543ed9ff86b1f53220e1ec95b58b3131f1e3bbd' }, this.renderTableContent())), this.tableRows.length === 0 ? this.renderEmptyPage() : null));
|
|
183
185
|
}
|
|
184
186
|
/**
|
|
185
187
|
* If the table is selectable then renderSelectHeader will render the th element with the checkbox to check or uncheck all items in the table.
|
|
@@ -295,6 +295,8 @@ const Dropdown = class {
|
|
|
295
295
|
* Lifecycle method called when the component is updated.
|
|
296
296
|
*/
|
|
297
297
|
componentDidRender() {
|
|
298
|
+
if (!this.items)
|
|
299
|
+
return;
|
|
298
300
|
this.calculateDropDownPosition();
|
|
299
301
|
if (!this.multiple) {
|
|
300
302
|
// Makes sure that an item is always highlighted when the content window is open.
|
|
@@ -525,8 +527,8 @@ const Dropdown = class {
|
|
|
525
527
|
const filter = this.filterable ? this.renderFiltering() : null;
|
|
526
528
|
const multiple = this.multiple ? this.renderMultipleOptions() : null;
|
|
527
529
|
const leftSideIcon = this.iconSrc ? this.renderLeftSideIcon() : null;
|
|
528
|
-
const listOfItems = (h("ul", { key: '
|
|
529
|
-
return (h(Host, { key: '
|
|
530
|
+
const listOfItems = (h("ul", { key: '95a252f97ce61e89e5aeda83d8106e22394765a4', class: "list" }, this.currentItems.map((item, index) => this.renderListItem(item, index, (multiple ? true : false)))));
|
|
531
|
+
return (h(Host, { key: '0c745c84dba8ff682411751d5c70297279602f12', class: { 'open': this.open } }, h("button", { key: 'ac6873022da51f3289d3db29ddcb280a4ad304b0', part: "button", class: "button", disabled: this.disabled || this.items.length === 0, onClick: () => this.toggleContentWindow() }, leftSideIcon, this.renderButtonLabel(), h("svg", { key: 'a86464b106e4e7e31540f7c84afd83ca852158af', class: "arrow", part: "icon-down-arrow", width: "12", height: "6", viewBox: "0 0 18 10", xmlns: "http://www.w3.org/2000/svg" }, h("path", { key: '98210e841220078401226d3beef0c78102199afb', 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" }))), h("section", { key: '12d83258fac629639bec4469826ed4d6fe59d3b0', ref: (el) => this.listElement = el, part: "dropdown-container", class: "content", "tab-index": "1" }, filter, multiple, this.currentItems.length === 0 ? this.renderNoResultsTemplate() : listOfItems)));
|
|
530
532
|
}
|
|
531
533
|
/**
|
|
532
534
|
* Helper function to render markup when no items are available to be displayed in the content window.
|
|
@@ -149,6 +149,8 @@ const FloorSelector = class {
|
|
|
149
149
|
* It resets the floorlist and the active floor when the building changes.
|
|
150
150
|
*/
|
|
151
151
|
connectedCallback() {
|
|
152
|
+
if (!this.mapsindoors)
|
|
153
|
+
return;
|
|
152
154
|
this.mapsindoors.addListener('building_changed', () => {
|
|
153
155
|
this.floors = [];
|
|
154
156
|
const building = this.mapsindoors.getBuilding();
|
|
@@ -179,6 +181,8 @@ const FloorSelector = class {
|
|
|
179
181
|
* Called after every render().
|
|
180
182
|
*/
|
|
181
183
|
componentDidRender() {
|
|
184
|
+
if (!this.mapsindoors || !this.floorSelectorElement)
|
|
185
|
+
return;
|
|
182
186
|
if (!this.mapsindoors.getBuilding() || this.mapsindoors.getFloor() === null || this.mapsindoors.getFloor() === undefined) {
|
|
183
187
|
this.floorSelectorElement.classList.add('mi-floor-selector--hidden');
|
|
184
188
|
}
|
|
@@ -196,7 +200,7 @@ const FloorSelector = class {
|
|
|
196
200
|
* @returns {JSX.Element}
|
|
197
201
|
*/
|
|
198
202
|
render() {
|
|
199
|
-
return (h(Host, { key: '
|
|
203
|
+
return (h(Host, { key: '94371368bf86dbdf8e87431f6d56ed44d0d243ea' }, h("div", { key: '1851cc7c272e8721cba6c924393352a276b058a5', class: 'mi-floor-selector', ref: (element) => this.floorSelectorElement = element }, h("button", { key: '8f6ca96d5ce9f200ccc0a3bdeaea8dcfe020119a', class: `mi-floor-selector__button mi-floor-selector__button--${this.floorSelectorClosed ? 'closed' : 'open'}`, onClick: () => this.onToggleFloorSelector() }), h("div", { key: '75fac544899864d762e90a437d616a16cd93487a', class: `mi-floor-selector__list ${this.fadeFloorSelectorOnTop ? 'mi-floor-selector__list--fade-top' : ''} ${this.fadeFloorSelectorOnBottom ? 'mi-floor-selector__list--fade-bottom' : ''}`, ref: (element) => this.floorListElement = element, onScroll: () => this.onScrollStyle() }, this.floors.map((floor) => (h("button", { "data-floor": floor.index, style: this.currentFloor === floor.index ? { backgroundColor: this.primaryColor } : {}, class: `mi-floor-selector__floor ${this.currentFloor === floor.index ? 'mi-floor-selector__floor--active' : ''}`, onClick: (event) => this.onSelectFloor(event, floor.index) }, h("span", null, floor.name))))))));
|
|
200
204
|
}
|
|
201
205
|
get el() { return getElement(this); }
|
|
202
206
|
};
|
|
@@ -180,6 +180,8 @@ const Keyboard = class {
|
|
|
180
180
|
theme: 'hg-theme-default hg-layout-numeric numeric-theme'
|
|
181
181
|
});
|
|
182
182
|
// Populate the keyboard's internal input value with any existing value from the input field.
|
|
183
|
+
if (!this.inputElement)
|
|
184
|
+
return;
|
|
183
185
|
this.simpleKeyboard.setInput(this.inputElement.value);
|
|
184
186
|
}
|
|
185
187
|
/**
|
|
@@ -240,7 +242,7 @@ const Keyboard = class {
|
|
|
240
242
|
* @returns {JSX.Element}
|
|
241
243
|
*/
|
|
242
244
|
render() {
|
|
243
|
-
return (h("div", { key: '
|
|
245
|
+
return (h("div", { key: 'b156e627b81f1ea2868b72aa9699b1e5a3c96b39', class: 'simple-keyboard' }));
|
|
244
246
|
}
|
|
245
247
|
static get watchers() { return {
|
|
246
248
|
"inputElement": [{
|
package/dist/mi-list.entry.js
CHANGED
|
@@ -17,6 +17,10 @@ const List = class {
|
|
|
17
17
|
this.scrollLength = 100;
|
|
18
18
|
}
|
|
19
19
|
componentDidLoad() {
|
|
20
|
+
if (!this.scrollButtonsEnabled && this.scrollButtonsEnabled !== false)
|
|
21
|
+
return;
|
|
22
|
+
if (typeof this.scrollLength !== 'number')
|
|
23
|
+
return;
|
|
20
24
|
this.addIntersectionObserver();
|
|
21
25
|
if (this.scrollButtonsEnabled) {
|
|
22
26
|
this.setScrollContainerElementRef();
|
|
@@ -56,7 +60,7 @@ const List = class {
|
|
|
56
60
|
this.intersectionObserver.observe(this.scrollContainerElement);
|
|
57
61
|
}
|
|
58
62
|
render() {
|
|
59
|
-
return (h("div", { key: '
|
|
63
|
+
return (h("div", { key: 'bc2f046eadf87cd3ce09af999a80f3c46b83f985', class: "container" }, h("div", { key: '59fce6d0b99e85506457e8cd26378b771853c091', role: "list", class: "scroll-container", ref: (el) => this.scrollContainerElement = el }, h("slot", { key: '589917cef174ca09f80310b8acbc8f726a11581b' })), this.scrollButtonsEnabled ? h("mi-scroll-buttons", { scrollLength: this.scrollLength, ref: (el) => this.miScrollButtonsElement = el }) : null));
|
|
60
64
|
}
|
|
61
65
|
};
|
|
62
66
|
List.style = listCss();
|
|
@@ -2270,6 +2270,8 @@ const MyPositionComponent = class {
|
|
|
2270
2270
|
*/
|
|
2271
2271
|
connectedCallback() {
|
|
2272
2272
|
var _a;
|
|
2273
|
+
if (!this.mapsindoors)
|
|
2274
|
+
return;
|
|
2273
2275
|
this.mapView = this.mapsindoors.getMapView();
|
|
2274
2276
|
this.options = merge(this.defaultOptions, (_a = this.myPositionOptions) !== null && _a !== void 0 ? _a : {});
|
|
2275
2277
|
// Clean up any existing position provider listeners before assigning a new one
|
|
@@ -2407,6 +2409,8 @@ const MyPositionComponent = class {
|
|
|
2407
2409
|
* Component render callback.
|
|
2408
2410
|
*/
|
|
2409
2411
|
componentDidRender() {
|
|
2412
|
+
if (!this.mapView)
|
|
2413
|
+
return;
|
|
2410
2414
|
this.setCompassStyle(this.mapView.getBearing());
|
|
2411
2415
|
}
|
|
2412
2416
|
/**
|
|
@@ -2438,14 +2442,14 @@ const MyPositionComponent = class {
|
|
|
2438
2442
|
* @returns {JSX.Element}
|
|
2439
2443
|
*/
|
|
2440
2444
|
render() {
|
|
2441
|
-
return (h(Host, { key: '
|
|
2445
|
+
return (h(Host, { key: '1bd75195ad233880f7b5779077491ea2eeac1043' }, h("div", { key: '207646d366dca4c935f93e11de64fe34281ed756', class: 'mi-my-position' }, h("button", { key: '86d6f5c11fe677a0af8d148c82b5d8715bfacb37', class: `mi-my-position__position-button
|
|
2442
2446
|
${this.positionState === PositionStateTypes.POSITION_UNKNOWN || this.positionState === PositionStateTypes.POSITION_INACCURATE ? 'mi-my-position__position-button--unknown' : ''}
|
|
2443
2447
|
${this.positionState === PositionStateTypes.POSITION_REQUESTING ? 'mi-my-position__position-button--requesting' : ''}
|
|
2444
2448
|
${this.positionState === PositionStateTypes.POSITION_KNOWN ? 'mi-my-position__position-button--known' : ''}
|
|
2445
2449
|
${this.positionState === PositionStateTypes.POSITION_CENTERED ? 'mi-my-position__position-button--centered' : ''}
|
|
2446
2450
|
${this.positionState === PositionStateTypes.POSITION_TRACKED ? 'mi-my-position__position-button--tracked' : ''}
|
|
2447
2451
|
${this.positionState === PositionStateTypes.POSITION_UNTRACKED ? 'mi-my-position__position-button--untracked' : ''}
|
|
2448
|
-
${this.positionState === PositionStateTypes.POSITION_FOLLOW ? 'mi-my-position__position-button--follow' : ''}`, onClick: (event) => this.onPositionButtonClicked(event) }), h("button", { key: '
|
|
2452
|
+
${this.positionState === PositionStateTypes.POSITION_FOLLOW ? 'mi-my-position__position-button--follow' : ''}`, onClick: (event) => this.onPositionButtonClicked(event) }), h("button", { key: '06d2973cf54899046d6d03422d9e7e2cb2762f5e', ref: (el) => this.compassButton = el, class: 'mi-my-position__compass-button', onClick: () => this.onCompassButtonClicked() }))));
|
|
2449
2453
|
}
|
|
2450
2454
|
};
|
|
2451
2455
|
MyPositionComponent.style = myPositionCss();
|
|
@@ -78,6 +78,8 @@ const RouteInstructions = class {
|
|
|
78
78
|
this.lastStepTransitStop = null;
|
|
79
79
|
}
|
|
80
80
|
componentDidRender() {
|
|
81
|
+
if (!this.hideIndoorSubsteps && this.hideIndoorSubsteps !== false)
|
|
82
|
+
return;
|
|
81
83
|
this.miStepElements.forEach((element) => {
|
|
82
84
|
element.hideIndoorSubsteps = this.hideIndoorSubsteps;
|
|
83
85
|
});
|
|
@@ -54,6 +54,8 @@ const ScrollButtons = class {
|
|
|
54
54
|
* @returns {Promise<void>}
|
|
55
55
|
*/
|
|
56
56
|
async updateScrollButtonsState() {
|
|
57
|
+
if (!this.scrollContainerElementRef || !this.upButtonElement)
|
|
58
|
+
return;
|
|
57
59
|
// Disable or enable the scroll up button
|
|
58
60
|
if (this.scrollContainerElementRef.scrollTop === 0) {
|
|
59
61
|
this.upButtonElement.disabled = true;
|
|
@@ -95,17 +97,17 @@ const ScrollButtons = class {
|
|
|
95
97
|
* @returns {JSX.Element}
|
|
96
98
|
*/
|
|
97
99
|
render() {
|
|
98
|
-
return (h("div", { key: '
|
|
100
|
+
return (h("div", { key: '35e32a60ec5721855c552d6f7771ff53301d5981', part: "container", class: "scroll-buttons" }, h("button", { key: 'e5b1d5811d4b693c18c3e68a82c9607b7f06be36', part: "button button-up", class: "mi-button mi-button--base btn btn-up", type: "button", disabled: true, "aria-label": "Scroll Up", ref: (el) => {
|
|
99
101
|
this.upButtonElement = el;
|
|
100
102
|
}, onClick: (event) => {
|
|
101
103
|
event.stopPropagation();
|
|
102
104
|
this.updateScrollPosition(-this.scrollLength);
|
|
103
|
-
} }, h("mi-icon", { key: '
|
|
105
|
+
} }, h("mi-icon", { key: '061c50e3809963dfcc558bd9bf6ce71904aa5a30', "icon-name": "chevron-up" })), h("button", { key: '6706f4cf2ba101a9453018fab8c532c90d4c27ee', part: "button button-down", class: "mi-button mi-button--base btn btn-down", type: "button", "aria-label": "Scroll Down", ref: (el) => {
|
|
104
106
|
this.downButtonElement = el;
|
|
105
107
|
}, onClick: (event) => {
|
|
106
108
|
event.stopPropagation();
|
|
107
109
|
this.updateScrollPosition(this.scrollLength);
|
|
108
|
-
} }, h("mi-icon", { key: '
|
|
110
|
+
} }, h("mi-icon", { key: '1cc8e05eebf066dac04ff12bac6767d8d7d59c29', "icon-name": "chevron-down" }))));
|
|
109
111
|
}
|
|
110
112
|
static get watchers() { return {
|
|
111
113
|
"scrollContainerElementRef": [{
|
package/dist/mi-search.entry.js
CHANGED
|
@@ -187,6 +187,8 @@ const Search = class {
|
|
|
187
187
|
* Clear the input field.
|
|
188
188
|
*/
|
|
189
189
|
async clear() {
|
|
190
|
+
if (!this.inputElement)
|
|
191
|
+
return;
|
|
190
192
|
this.inputElement.value = '';
|
|
191
193
|
this.value = '';
|
|
192
194
|
this.lastRequested = null;
|
|
@@ -196,6 +198,8 @@ const Search = class {
|
|
|
196
198
|
* Programmatically trigger the search.
|
|
197
199
|
*/
|
|
198
200
|
async triggerSearch() {
|
|
201
|
+
if (!this.inputElement)
|
|
202
|
+
return;
|
|
199
203
|
const inputValue = this.inputElement.value;
|
|
200
204
|
this.search(inputValue);
|
|
201
205
|
}
|
|
@@ -204,6 +208,8 @@ const Search = class {
|
|
|
204
208
|
* Setting it will not perform a search.
|
|
205
209
|
*/
|
|
206
210
|
async setDisplayText(displayText) {
|
|
211
|
+
if (!this.inputElement)
|
|
212
|
+
return;
|
|
207
213
|
this.preventSearch = true;
|
|
208
214
|
this.inputElement.value = displayText;
|
|
209
215
|
this.value = displayText;
|
|
@@ -215,12 +221,16 @@ const Search = class {
|
|
|
215
221
|
* from scrolling the document to bring the newly-focused element into view.
|
|
216
222
|
*/
|
|
217
223
|
async focusInput() {
|
|
224
|
+
if (!this.inputElement)
|
|
225
|
+
return;
|
|
218
226
|
this.inputElement.focus({ preventScroll: true });
|
|
219
227
|
}
|
|
220
228
|
/**
|
|
221
229
|
* Get hold of the search input field.
|
|
222
230
|
*/
|
|
223
231
|
async getInputField() {
|
|
232
|
+
if (!this.inputElement)
|
|
233
|
+
return null;
|
|
224
234
|
return this.inputElement;
|
|
225
235
|
}
|
|
226
236
|
/**
|
|
@@ -391,6 +401,8 @@ const Search = class {
|
|
|
391
401
|
}
|
|
392
402
|
}
|
|
393
403
|
componentDidRender() {
|
|
404
|
+
if (!this.inputElement)
|
|
405
|
+
return;
|
|
394
406
|
if (this.dataAttributes) {
|
|
395
407
|
for (const key in this.dataAttributes) {
|
|
396
408
|
this.inputElement.setAttribute(key, this.dataAttributes[key]);
|
|
@@ -400,8 +412,8 @@ const Search = class {
|
|
|
400
412
|
}
|
|
401
413
|
render() {
|
|
402
414
|
var _a;
|
|
403
|
-
return (h(Host, { key: '
|
|
404
|
-
h("button", { key: '
|
|
415
|
+
return (h(Host, { key: '2a7218a542e11e078974394e53952a96170d900a' }, h("input", { key: '933157a4c89795b1a90c2472303586390ae18e4c', disabled: this.disabled, id: this.idAttribute ? this.idAttribute : null, type: "search", ref: (el) => this.inputElement = el, onInput: () => this.inputChanged(), placeholder: this.placeholder, autocomplete: "off" }), ((_a = this.inputElement) === null || _a === void 0 ? void 0 : _a.value) &&
|
|
416
|
+
h("button", { key: '92360364b036ba224cd74741b5ac95818f05564c', type: "button", onClick: () => this.clear(), "aria-label": "Clear" }, h("svg", { key: 'da9d421f4fd9033a0326f9ede9974de48430498a', width: "14", height: "14", viewBox: "0 0 14 14", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, h("path", { key: '759d43febded3f03cb538038d323836ccd423a54', 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" })))));
|
|
405
417
|
}
|
|
406
418
|
static get watchers() { return {
|
|
407
419
|
"value": [{
|
|
@@ -46,6 +46,8 @@ const ShareSms = class {
|
|
|
46
46
|
};
|
|
47
47
|
}
|
|
48
48
|
componentDidRender() {
|
|
49
|
+
if (!this.countryCodeInputElement || !this.countryCode)
|
|
50
|
+
return;
|
|
49
51
|
this.countryCodeInputElement.value = this.countryCode;
|
|
50
52
|
}
|
|
51
53
|
componentDidLoad() {
|
|
@@ -84,7 +86,7 @@ const ShareSms = class {
|
|
|
84
86
|
this.submitButtonElement.disabled = false;
|
|
85
87
|
}
|
|
86
88
|
render() {
|
|
87
|
-
return (h("form", { key: '
|
|
89
|
+
return (h("form", { key: '6b95e4a70dd312d48820f1ab7d097f5015fbcd82', onSubmit: this.submitFormHandler, ref: (el) => this.formElement = el }, h("div", { key: 'a1d9078dcf9edea773fff8437117fabd96cee74d', class: "inputs" }, h("span", { key: '79d9bc0cdee2f4a8d950f912ed384cb91fa9c651', class: "plus-sign" }, "\uFF0B"), h("input", { key: '803a9d46a87d0984401995ba6c999dc6e349664a', 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: '6b2276bafe173ceebbe3b4e878f5db6081d536fe', 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: 'd6f440ff7123ce57e02a6831aa9907048b9b59fa', layout: "numeric", ref: (el) => this.miKeyboardElement = el }), h("div", { key: 'd86ec402d9aa5c457d26b6ab26bdf292f088e3be', class: "flex justify-center" }, h("button", { key: '70b53db06f85c5e463b84189731e1d479b0cdf77', type: "submit", disabled: true, class: "mi-button mi-button--primary", ref: (el) => this.submitButtonElement = el }, this.submitButtonLabel))));
|
|
88
90
|
}
|
|
89
91
|
};
|
|
90
92
|
ShareSms.style = shareSmsCss();
|