@mapsindoors/map-template 1.0.0-rc.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +123 -0
- package/dist/_commonjsHelpers-ba3f0406-b96e6d6a.mjs +21 -0
- package/dist/combo-box-item.entry-92232c29.mjs +12 -0
- package/dist/combo-box-item.entry-f244c01a.mjs +14 -0
- package/dist/icon-b8d01d6f-ddfa2c17.mjs +24 -0
- package/dist/mapsindoors-react.es.js +7 -0
- package/dist/mapsindoors-react.umd.js +1391 -0
- package/dist/mapsindoors-webcomponent.es.js +5 -0
- package/dist/mapsindoors-webcomponent.umd.js +1385 -0
- package/dist/mi-card_2.entry-508f65b2.mjs +23 -0
- package/dist/mi-card_2.entry-d24478d0.mjs +25 -0
- package/dist/mi-chip.entry-74b3118c.mjs +15 -0
- package/dist/mi-chip.entry-8bfee95c.mjs +13 -0
- package/dist/mi-column.entry-f66623b9.mjs +20 -0
- package/dist/mi-column.entry-f901d5d1.mjs +18 -0
- package/dist/mi-combo-box.entry-0e6d9797.mjs +262 -0
- package/dist/mi-combo-box.entry-69a04955.mjs +260 -0
- package/dist/mi-data-table.entry-6cae08b0.mjs +215 -0
- package/dist/mi-data-table.entry-7fe09cbe.mjs +213 -0
- package/dist/mi-distance_2.entry-dca308c3.mjs +54 -0
- package/dist/mi-distance_2.entry-dffb2e64.mjs +56 -0
- package/dist/mi-dropdown-item.entry-508c6605.mjs +12 -0
- package/dist/mi-dropdown-item.entry-b6aa9d36.mjs +14 -0
- package/dist/mi-dropdown.entry-43258637.mjs +296 -0
- package/dist/mi-dropdown.entry-e1325610.mjs +298 -0
- package/dist/mi-keyboard.entry-60e47fb9.mjs +2962 -0
- package/dist/mi-keyboard.entry-c97c80e8.mjs +2960 -0
- package/dist/mi-list-item-category.entry-b0f61751.mjs +38 -0
- package/dist/mi-list-item-category.entry-bcac342a.mjs +36 -0
- package/dist/mi-list-item-location.entry-15ec9c7e.mjs +125 -0
- package/dist/mi-list-item-location.entry-ee56967a.mjs +127 -0
- package/dist/mi-list.entry-656130ea.mjs +41 -0
- package/dist/mi-list.entry-c8f1f377.mjs +39 -0
- package/dist/mi-location-booking.entry-a5b9b331.mjs +4863 -0
- package/dist/mi-location-booking.entry-ea841d6e.mjs +4865 -0
- package/dist/mi-location-info.entry-89b37774.mjs +22 -0
- package/dist/mi-location-info.entry-fe2c6c32.mjs +24 -0
- package/dist/mi-map-googlemaps.entry-6cb264de.mjs +398 -0
- package/dist/mi-map-googlemaps.entry-8877f16d.mjs +396 -0
- package/dist/mi-map-mapbox.entry-7a41963d.mjs +298 -0
- package/dist/mi-map-mapbox.entry-928da21a.mjs +300 -0
- package/dist/mi-metric-card.entry-51daca25.mjs +28 -0
- package/dist/mi-metric-card.entry-95dbb9f1.mjs +26 -0
- package/dist/mi-notification.entry-29b28ba8.mjs +81 -0
- package/dist/mi-notification.entry-f7677761.mjs +83 -0
- package/dist/mi-route-instructions-heading.entry-79c22cdd.mjs +72 -0
- package/dist/mi-route-instructions-heading.entry-a4c7f18f.mjs +74 -0
- package/dist/mi-route-instructions-maneuver_2.entry-383704ad.mjs +115 -0
- package/dist/mi-route-instructions-maneuver_2.entry-80c51e6a.mjs +113 -0
- package/dist/mi-route-instructions-step-legacy.entry-785cb60b.mjs +199 -0
- package/dist/mi-route-instructions-step-legacy.entry-eff068ed.mjs +201 -0
- package/dist/mi-route-instructions-step.entry-272e3c84.mjs +199 -0
- package/dist/mi-route-instructions-step.entry-95f5dc43.mjs +201 -0
- package/dist/mi-route-instructions.entry-0628d220.mjs +139 -0
- package/dist/mi-route-instructions.entry-1b4fb352.mjs +141 -0
- package/dist/mi-scroll-buttons.entry-274b003f.mjs +48 -0
- package/dist/mi-scroll-buttons.entry-6132935b.mjs +46 -0
- package/dist/mi-search.entry-994c0189.mjs +206 -0
- package/dist/mi-search.entry-d0e582d1.mjs +208 -0
- package/dist/mi-share-sms.entry-ae15cf77.mjs +53 -0
- package/dist/mi-share-sms.entry-ced7f275.mjs +55 -0
- package/dist/mi-step-switcher.entry-812a5096.mjs +24 -0
- package/dist/mi-step-switcher.entry-c9e28e79.mjs +26 -0
- package/dist/mi-tab-panel.entry-63c34f28.mjs +19 -0
- package/dist/mi-tab-panel.entry-bde9bd39.mjs +21 -0
- package/dist/mi-tab.entry-1767468e.mjs +13 -0
- package/dist/mi-tab.entry-b5ac50ac.mjs +11 -0
- package/dist/mi-tabs.entry-1b8327bf.mjs +34 -0
- package/dist/mi-tabs.entry-bd190e21.mjs +36 -0
- package/dist/mi-variables-9a6c8d4d-e06eec88.mjs +7 -0
- package/dist/reactcomponent-2f9f051f.mjs +27190 -0
- package/dist/route-travel-mode.enum-7f4ce9c7-a9c95a83.mjs +7 -0
- package/dist/sort-order.enum-64ce8998-b75ac596.mjs +317 -0
- package/dist/unit-system.enum-eaefb53e-0f424da4.mjs +7 -0
- package/dist/utils-ae714467-b07fc3be.mjs +36 -0
- package/dist/webcomponent-a10be1e6.mjs +31969 -0
- package/package.json +53 -0
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
import { r, c as o, h as e } from "./reactcomponent-2f9f051f.mjs";
|
|
2
|
+
import { U as a } from "./unit-system.enum-eaefb53e-0f424da4.mjs";
|
|
3
|
+
import { c as l } from "./utils-ae714467-b07fc3be.mjs";
|
|
4
|
+
import "react";
|
|
5
|
+
import "react-dom";
|
|
6
|
+
const p = ':host{display:block;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"}.step{display:grid;gap:8px;justify-items:center}.step__info{display:grid;grid-auto-flow:column;gap:8px;align-items:center}.step__action-icon--circled{position:relative}.step__action-icon mi-icon{display:block;width:40px;height:40px}.step__heading{font-size:1.25rem;margin:0}.step__heading>span{font-size:0.875rem;color:#6b7280}.step__travel-mode{grid-area:modeicon;display:flex;justify-content:center;align-items:center;position:relative;min-height:72px}.step__travel-mode::before{position:absolute;width:calc(50% - 2px);left:0;height:100%;content:""}.step__travel-mode--dotted::before{border-right:4px dotted #bfdbfe}.step__travel-mode--solid::before{border-right:4px solid #bfdbfe}.step__travel-mode-icon{position:absolute;left:50%;top:24px;transform:translateX(-50%);background-color:#fcfcfc;padding:3px;border-radius:4px}.step__travel-mode-icon mi-icon{width:16px;height:16px;background-color:#6b7280;display:block}.step__short-name{margin-right:4px;padding:2px 4px;font-size:0.875rem;color:#fcfcfc;background-color:#6b7280;border-radius:2px}.step__distance-duration{color:#6b7280;font-size:0.875rem}.step__toggle{grid-area:toggle;display:flex;justify-content:center;align-items:center;transition:transform 300ms;cursor:pointer}.step__toggle--open{transform:rotate(180deg)}.step__toggle mi-icon{width:16px;height:16px;display:block;background-color:#3b82f6}.step__substeps{grid-area:substeps}', d = class {
|
|
7
|
+
constructor(t) {
|
|
8
|
+
r(this, t), this.stepClicked = o(this, "stepClicked", 7), this.isInternetExplorer = l(), this.step = void 0, this.stepData = void 0, this.hideIndoorSubsteps = !0, this.fromRouteContext = "", this.fromTravelMode = void 0, this.fromTransitStop = void 0, this.unit = navigator.language === "en-US" ? a.Imperial : a.Metric, this.translations = void 0, this.translationsData = void 0, this.substepsAreOpen = !1;
|
|
9
|
+
}
|
|
10
|
+
parseStepProp() {
|
|
11
|
+
this.step && (this.stepData = JSON.parse(this.step));
|
|
12
|
+
}
|
|
13
|
+
parseTranslationsProp() {
|
|
14
|
+
this.translations && (this.translationsData = JSON.parse(this.translations));
|
|
15
|
+
}
|
|
16
|
+
componentWillLoad() {
|
|
17
|
+
this.parseStepProp(), this.parseTranslationsProp();
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Render if there is step data.
|
|
21
|
+
*/
|
|
22
|
+
render() {
|
|
23
|
+
return this.stepData && this.translationsData ? this.renderStep() : null;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Emits stepClicked event (if click target is not related to an action)
|
|
27
|
+
* @param event Event
|
|
28
|
+
*/
|
|
29
|
+
stepClickHandler(t) {
|
|
30
|
+
if (Array.from(t.target.classList).includes("icon-toggle"))
|
|
31
|
+
return;
|
|
32
|
+
let s = null;
|
|
33
|
+
t.target.dataset.maneuverIndex !== void 0 && (s = parseInt(t.target.dataset.maneuverIndex)), this.stepClicked.emit({ maneuverIndex: s });
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Render step part depending on travel mode.
|
|
37
|
+
*
|
|
38
|
+
* @returns {JSX.Element}
|
|
39
|
+
*/
|
|
40
|
+
renderStep() {
|
|
41
|
+
switch (this.stepData.travel_mode.toUpperCase()) {
|
|
42
|
+
case "DRIVING":
|
|
43
|
+
return this.renderDrivingStep();
|
|
44
|
+
case "WALKING":
|
|
45
|
+
return this.renderWalkingStep();
|
|
46
|
+
case "BICYCLING":
|
|
47
|
+
return this.renderBicyclingStep();
|
|
48
|
+
case "TRANSIT":
|
|
49
|
+
return this.renderTransitStep();
|
|
50
|
+
default:
|
|
51
|
+
return e("div", null, "Unknown travel mode: ", this.stepData.travel_mode);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Render the travel mode indicator and dotted/solid line.
|
|
56
|
+
*
|
|
57
|
+
* @returns {JSX.Element}
|
|
58
|
+
*/
|
|
59
|
+
renderTravelMode() {
|
|
60
|
+
if (this.isInternetExplorer)
|
|
61
|
+
return null;
|
|
62
|
+
let t;
|
|
63
|
+
switch (this.stepData.travel_mode.toUpperCase()) {
|
|
64
|
+
case "DRIVING":
|
|
65
|
+
t = "car";
|
|
66
|
+
break;
|
|
67
|
+
case "WALKING":
|
|
68
|
+
t = "walk";
|
|
69
|
+
break;
|
|
70
|
+
case "BICYCLING":
|
|
71
|
+
t = "bike";
|
|
72
|
+
break;
|
|
73
|
+
case "TRANSIT":
|
|
74
|
+
t = this.getTransitVehicleIconName();
|
|
75
|
+
break;
|
|
76
|
+
}
|
|
77
|
+
return e("span", { part: "step-travel-mode", class: `step__travel-mode step__travel-mode--${this.stepData.travel_mode.toUpperCase() === "TRANSIT" ? "solid" : "dotted"}` }, e("span", { class: "step__travel-mode-icon" }, e("mi-icon", { part: "step-travel-mode-icon", "icon-name": t })));
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Get icon name for transit vehicle.
|
|
81
|
+
*
|
|
82
|
+
* @returns {string}
|
|
83
|
+
*/
|
|
84
|
+
getTransitVehicleIconName() {
|
|
85
|
+
var t, s;
|
|
86
|
+
const i = (s = (t = this.stepData.transit_information) === null || t === void 0 ? void 0 : t.line.vehicle) === null || s === void 0 ? void 0 : s.type.toLowerCase();
|
|
87
|
+
return i && ["boat", "bus", "railway", "train", "subway"].some((n) => n === i) ? i : "transit";
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* Toggles visibility of sub steps (steps in steps)
|
|
91
|
+
*/
|
|
92
|
+
toggleSubsteps() {
|
|
93
|
+
this.substepsAreOpen = !this.substepsAreOpen;
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Render substeps if they should be visible.
|
|
97
|
+
*
|
|
98
|
+
* @returns {JSX.Element}
|
|
99
|
+
*/
|
|
100
|
+
renderSubsteps() {
|
|
101
|
+
return this.substepsAreOpen === !0 ? e("div", { class: "step__substeps" }, this.stepData.steps.map((t, s) => e("mi-route-instructions-maneuver", {
|
|
102
|
+
"data-maneuver-index": s,
|
|
103
|
+
maneuver: JSON.stringify(t),
|
|
104
|
+
translations: this.translations,
|
|
105
|
+
unit: this.unit,
|
|
106
|
+
// @ts-ignore
|
|
107
|
+
exportparts: `
|
|
108
|
+
maneuver-icon,
|
|
109
|
+
maneuver-description,
|
|
110
|
+
maneuver-description-distance,
|
|
111
|
+
maneuver-description-distance-border`
|
|
112
|
+
}))) : null;
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* Render the toggle button for the sub step expander.
|
|
116
|
+
*
|
|
117
|
+
* @returns {JSX.Element}
|
|
118
|
+
*/
|
|
119
|
+
renderToggleButton() {
|
|
120
|
+
return this.stepData.steps.length <= 0 || this.hideIndoorSubsteps === !0 && this.stepData.route_context.toLowerCase() === "insidebuilding" ? null : e("span", { class: `step__toggle ${this.substepsAreOpen ? "step__toggle--open" : ""}`, onClick: () => this.toggleSubsteps() }, this.isInternetExplorer ? "▼" : e("mi-icon", { part: "step-toggle", "icon-name": "toggle" }));
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* Render distance part.
|
|
124
|
+
*
|
|
125
|
+
* @returns {JSX.Element}
|
|
126
|
+
*/
|
|
127
|
+
renderDistance() {
|
|
128
|
+
return e("span", { part: "step-info", class: "step__distance-duration" }, e("mi-distance", { meters: this.stepData.distance.value, unit: this.unit }), e("br", null));
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* Render a driving step.
|
|
132
|
+
*
|
|
133
|
+
* @returns {JSX.Element}
|
|
134
|
+
*/
|
|
135
|
+
renderDrivingStep() {
|
|
136
|
+
return e("div", { class: "step", onClick: (t) => this.stepClickHandler(t) }, this.isInternetExplorer ? null : e("span", { class: "step__action-icon step__action-icon--circled" }, e("mi-icon", { "icon-name": "car" })), e("h3", { part: "step-heading", class: "step__heading" }, this.getStepHeading()), this.renderTravelMode(), e("div", { part: "step-description", class: "step__description" }, this.translationsData.drive, e("br", null), this.renderDistance()), this.renderToggleButton(), this.renderSubsteps());
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* Get display heading.
|
|
140
|
+
*
|
|
141
|
+
* @returns {string}
|
|
142
|
+
*/
|
|
143
|
+
getStepHeading() {
|
|
144
|
+
var t;
|
|
145
|
+
const s = {
|
|
146
|
+
driving: this.translationsData.drive,
|
|
147
|
+
walking: this.translationsData.walk,
|
|
148
|
+
bicycling: this.translationsData.bike
|
|
149
|
+
};
|
|
150
|
+
return !((t = this.stepData.steps[0]) === null || t === void 0) && t.instructions ? this.stepData.steps[0].instructions : s[this.stepData.travel_mode.toLowerCase()];
|
|
151
|
+
}
|
|
152
|
+
/**
|
|
153
|
+
* Render a walking step.
|
|
154
|
+
*
|
|
155
|
+
*
|
|
156
|
+
* @returns {JSX.Element}
|
|
157
|
+
*/
|
|
158
|
+
renderWalkingStep() {
|
|
159
|
+
let t, s;
|
|
160
|
+
return this.stepData.parking === !0 ? (t = `${this.translationsData.park} ${this.stepData.label ? ` ${this.translationsData.at} ` + this.stepData.label : ""}`, s = "park") : this.stepData.highway && this.stepData.highway.toUpperCase() === "STEPS" ? (t = `${this.translationsData.takeStaircaseToLevel} ${this.stepData.end_location.floor_name}`, s = "stairs") : this.stepData.highway && this.stepData.highway.toUpperCase() === "LADDER" ? (t = `${this.translationsData.takeLadderToLevel} ${this.stepData.end_location.floor_name}`, s = "ladder") : this.stepData.highway && this.stepData.highway.toUpperCase() === "ESCALATOR" ? (t = `${this.translationsData.takeEscalatorToLevel} ${this.stepData.end_location.floor_name}`, s = "escalator") : this.stepData.highway && this.stepData.highway.toUpperCase() === "WHEELCHAIRRAMP" ? (t = `${this.translationsData.takeWheelchairRampToLevel} ${this.stepData.end_location.floor_name}`, s = "wheelchair-ramp") : this.stepData.highway && this.stepData.highway.toUpperCase() === "WHEELCHAIRLIFT" ? (t = `${this.translationsData.takeWheelchairLiftToLevel} ${this.stepData.end_location.floor_name}`, s = "wheelchair-lift") : this.stepData.highway && this.stepData.highway.toUpperCase() === "ELEVATOR" ? (t = `${this.translationsData.takeElevatorToLevel} ${this.stepData.end_location.floor_name}`, s = "elevator") : this.fromRouteContext === "InsideBuilding" && this.stepData.route_context === "Outside" ? (t = this.addStepContextNameToHeading(this.translationsData.exit, this.stepData.start_context), s = "exit") : this.fromRouteContext === "InsideBuilding" && this.stepData.route_context === "InsideBuilding" ? (t = this.getStepHeading(), s = "walk") : this.fromRouteContext === "Outside" && this.stepData.route_context === "Outside" && this.fromTravelMode.toUpperCase() === "TRANSIT" ? (t = this.fromTransitStop, s = "transit-stop") : this.fromRouteContext === "Outside" && this.stepData.route_context === "Outside" ? (t = this.getStepHeading(), s = "walk") : this.fromRouteContext === "Outside" && this.stepData.route_context === "InsideBuilding" ? (t = this.addStepContextNameToHeading(this.translationsData.enter, this.stepData.end_context), s = "enter") : (t = this.fromRouteContext, s = "circle"), e("div", { class: "step", onClick: (i) => this.stepClickHandler(i) }, e("div", { part: "step-description", class: "step__description" }, this.renderDistance()), e("div", { class: "step__info" }, this.isInternetExplorer ? null : e("span", { class: `step__action-icon ${s !== "circle" ? "step__action-icon--circled" : ""}` }, e("mi-icon", { "icon-name": s })), e("div", { part: "step-heading", class: "step__heading" }, t)));
|
|
161
|
+
}
|
|
162
|
+
/**
|
|
163
|
+
* Add building or venue name to the step heading
|
|
164
|
+
* @param {string} heading
|
|
165
|
+
* @param {StepContext} stepContext
|
|
166
|
+
* @returns
|
|
167
|
+
*/
|
|
168
|
+
addStepContextNameToHeading(t, s) {
|
|
169
|
+
return s && (s.building ? t += ` ${s.building.buildingInfo.name} ${this.translationsData.building}` : s.venue && (t += ` ${s.venue.venueInfo.name} ${this.translationsData.venue}`)), t;
|
|
170
|
+
}
|
|
171
|
+
/**
|
|
172
|
+
* Render a bicycling step.
|
|
173
|
+
*
|
|
174
|
+
* @returns {JSX.Element}
|
|
175
|
+
*/
|
|
176
|
+
renderBicyclingStep() {
|
|
177
|
+
return e("div", { class: "step", onClick: (t) => this.stepClickHandler(t) }, this.isInternetExplorer ? null : e("span", { class: "step__action-icon step__action-icon--circled" }, e("mi-icon", { "icon-name": "bike" })), e("h3", { part: "step-heading", class: "step__heading" }, this.getStepHeading()), this.renderTravelMode(), e("div", { part: "step-description", class: "step__description" }, this.translationsData.bike, e("br", null), this.renderDistance()), this.renderToggleButton(), this.renderSubsteps());
|
|
178
|
+
}
|
|
179
|
+
/**
|
|
180
|
+
* Render a transit step.
|
|
181
|
+
*
|
|
182
|
+
* @returns {JSX.Element}
|
|
183
|
+
*/
|
|
184
|
+
renderTransitStep() {
|
|
185
|
+
var t, s;
|
|
186
|
+
return e("div", { class: "step", onClick: (i) => this.stepClickHandler(i) }, this.isInternetExplorer ? null : e("span", { class: "step__action-icon step__action-icon--circled" }, e("mi-icon", { "icon-name": "transit-stop" })), e("h3", { part: "step-heading", class: "step__heading" }, this.stepData.instructions), this.renderTravelMode(), e("div", { part: "step-description", class: "step__description" }, this.stepData.transit_information.line.short_name ? e("span", { class: "step__short-name", style: {
|
|
187
|
+
backgroundColor: !((t = this.stepData.transit_information.line) === null || t === void 0) && t.color ? this.stepData.transit_information.line.color : null,
|
|
188
|
+
color: !((s = this.stepData.transit_information.line) === null || s === void 0) && s.text_color ? this.stepData.transit_information.line.text_color : null
|
|
189
|
+
} }, this.stepData.transit_information.line.short_name) : null, this.stepData.transit_information.headsign ? this.stepData.transit_information.headsign : null, e("br", null), e("span", { part: "step-info", class: "step__distance-duration" }, e("mi-time", { seconds: this.stepData.duration.value, translations: `{"days":"${this.translationsData.days}","hours":"${this.translationsData.hours}","minutes":"${this.translationsData.minutes}"}` }), " · ", this.stepData.transit_information.num_stops ? this.stepData.transit_information.num_stops : null, " ", this.translationsData.stops ? this.translationsData.stops : null)), this.renderToggleButton(), this.renderSubsteps());
|
|
190
|
+
}
|
|
191
|
+
static get watchers() {
|
|
192
|
+
return {
|
|
193
|
+
step: ["parseStepProp"],
|
|
194
|
+
translations: ["parseTranslationsProp"]
|
|
195
|
+
};
|
|
196
|
+
}
|
|
197
|
+
};
|
|
198
|
+
d.style = p;
|
|
199
|
+
export {
|
|
200
|
+
d as mi_route_instructions_step
|
|
201
|
+
};
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
import { r as u, c as g, h as s, H as m } from "./webcomponent-a10be1e6.mjs";
|
|
2
|
+
import { R as v } from "./route-travel-mode.enum-7f4ce9c7-a9c95a83.mjs";
|
|
3
|
+
import { U as f } from "./unit-system.enum-eaefb53e-0f424da4.mjs";
|
|
4
|
+
import { c as S } from "./utils-ae714467-b07fc3be.mjs";
|
|
5
|
+
const x = ':host{display:block;background-color:#fcfcfc;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 mi-route-instructions-step:hover{cursor:pointer;background-color:#f9fafb;transition:300ms ease}:host mi-route-instructions-step.active{background-color:#f3f4f6;transition:none;cursor:default}:host .instructions-destination{display:flex}:host .instructions-destination-icon{width:40px;display:flex;justify-content:center;align-items:center}:host .instructions-destination-icon mi-icon{width:24px;height:24px;background-color:#1c1917}:host .instructions-destination-details{flex:1;padding:12px}:host .instructions-destination-details mi-location-info{font-size:0.875rem}', I = class {
|
|
6
|
+
constructor(t) {
|
|
7
|
+
u(this, t), this.clicked = g(this, "clicked", 7), this.miStepElements = [], this.lastStepRouteContext = null, this.lastStepTravelMode = null, this.lastStepTransitStop = null, this.activeStep = {
|
|
8
|
+
legIndex: 0,
|
|
9
|
+
stepIndex: 0
|
|
10
|
+
}, this.unit = f.Metric, this.route = void 0, this.hideIndoorSubsteps = !1, this.travelMode = v.Walking, this.originLocation = void 0, this.originName = void 0, this.destinationLocation = void 0, this.destinationName = void 0, this.translations = {
|
|
11
|
+
walk: "Walk",
|
|
12
|
+
bike: "Bike",
|
|
13
|
+
transit: "Transit",
|
|
14
|
+
drive: "Drive",
|
|
15
|
+
leave: "Leave",
|
|
16
|
+
from: "From",
|
|
17
|
+
park: "Park",
|
|
18
|
+
at: "at",
|
|
19
|
+
building: "Building",
|
|
20
|
+
venue: "Venue",
|
|
21
|
+
takeStaircaseToLevel: "Take staircase to level",
|
|
22
|
+
takeLadderToLevel: "Take the ladder to level",
|
|
23
|
+
takeElevatorToLevel: "Take elevator to level",
|
|
24
|
+
takeEscalatorToLevel: "Take escalator to level",
|
|
25
|
+
takeWheelchairLiftToLevel: "Take wheelchair lift to level",
|
|
26
|
+
takeWheelchairRampToLevel: "Take wheelchair ramp to level",
|
|
27
|
+
exit: "Exit",
|
|
28
|
+
enter: "Enter",
|
|
29
|
+
stops: "stops",
|
|
30
|
+
andContinue: "and continue",
|
|
31
|
+
continueStraightAhead: "Continue straight ahead",
|
|
32
|
+
goLeft: "Go left",
|
|
33
|
+
goSharpLeft: "Go sharp left",
|
|
34
|
+
goSlightLeft: "Go slight left",
|
|
35
|
+
goRight: "Go right",
|
|
36
|
+
goSharpRight: "Go sharp right",
|
|
37
|
+
goSlightRight: "Go slight right",
|
|
38
|
+
turnAround: "Turn around",
|
|
39
|
+
days: "d",
|
|
40
|
+
hours: "h",
|
|
41
|
+
minutes: "min"
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
componentDidRender() {
|
|
45
|
+
this.miStepElements.forEach((t) => {
|
|
46
|
+
t.hideIndoorSubsteps = this.hideIndoorSubsteps;
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Transform the step in legs to a flat array of steps.
|
|
51
|
+
*
|
|
52
|
+
* @returns {Step[]}
|
|
53
|
+
*/
|
|
54
|
+
getRouteSteps() {
|
|
55
|
+
return this.route ? this.route.legs.reduce((t, i, e) => {
|
|
56
|
+
for (const o in i.steps) {
|
|
57
|
+
const n = i.steps[o];
|
|
58
|
+
n.originalLegIndex = e, n.originalStepIndex = parseInt(o), t.push(n);
|
|
59
|
+
}
|
|
60
|
+
return t;
|
|
61
|
+
}, []) : [];
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Updates the activeStep attribute and emits an object with leg, step and maneuver index information.
|
|
65
|
+
*
|
|
66
|
+
* @param {CustomEvent<any>} event Step object.
|
|
67
|
+
* @param {number} stepIndex step index.
|
|
68
|
+
*/
|
|
69
|
+
stepClickedHandler(t, i) {
|
|
70
|
+
const e = this.getRouteSteps()[i];
|
|
71
|
+
this.activeStep = {
|
|
72
|
+
legIndex: e.originalLegIndex,
|
|
73
|
+
stepIndex: e.originalStepIndex
|
|
74
|
+
}, this.clicked.emit({
|
|
75
|
+
legIndex: e.originalLegIndex,
|
|
76
|
+
stepIndex: e.originalStepIndex,
|
|
77
|
+
maneuverIndex: t.detail.maneuverIndex
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Check if the step is active.
|
|
82
|
+
*
|
|
83
|
+
* @param {Step} step
|
|
84
|
+
* @returns {boolean}
|
|
85
|
+
*/
|
|
86
|
+
isActiveStep(t) {
|
|
87
|
+
return this.activeStep ? this.activeStep.legIndex === t.originalLegIndex && this.activeStep.stepIndex === t.originalStepIndex : !1;
|
|
88
|
+
}
|
|
89
|
+
render() {
|
|
90
|
+
return this.route ? this.renderInstructions() : null;
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* Render instructions.
|
|
94
|
+
*
|
|
95
|
+
* @returns {JSX.Element}
|
|
96
|
+
*/
|
|
97
|
+
renderInstructions() {
|
|
98
|
+
return s(m, null, this.getRouteSteps().map((t, i) => {
|
|
99
|
+
var e, o, n, a, r;
|
|
100
|
+
const d = !((o = (e = this.originLocation) === null || e === void 0 ? void 0 : e.properties) === null || o === void 0) && o.name ? this.originLocation.properties.name : this.originName || "", c = t.originalLegIndex === 0 && t.originalStepIndex === 0 ? d : this.lastStepRouteContext, p = this.lastStepTravelMode, h = this.lastStepTransitStop;
|
|
101
|
+
return this.lastStepRouteContext = t.route_context, this.lastStepTravelMode = t.travel_mode, this.lastStepTransitStop = !((a = (n = t.transit_information) === null || n === void 0 ? void 0 : n.arrival_stop) === null || a === void 0) && a.name ? (r = t.transit_information) === null || r === void 0 ? void 0 : r.arrival_stop.name : null, s("mi-route-instructions-step-legacy", {
|
|
102
|
+
ref: (l) => this.miStepElements.push(l),
|
|
103
|
+
"from-travel-mode": p,
|
|
104
|
+
"from-route-context": c,
|
|
105
|
+
"from-transit-stop": h,
|
|
106
|
+
step: JSON.stringify(t),
|
|
107
|
+
translations: JSON.stringify(this.translations),
|
|
108
|
+
unit: this.unit,
|
|
109
|
+
onStepClicked: (l) => this.stepClickedHandler(l, i),
|
|
110
|
+
class: this.isActiveStep(t) ? "active" : "",
|
|
111
|
+
part: this.isActiveStep(t) ? "step active" : "step",
|
|
112
|
+
// @ts-ignore
|
|
113
|
+
exportparts: `
|
|
114
|
+
step-toggle,
|
|
115
|
+
step-heading,
|
|
116
|
+
step-description,
|
|
117
|
+
step-info,
|
|
118
|
+
step-travel-mode,
|
|
119
|
+
step-travel-mode-icon,
|
|
120
|
+
maneuver-icon,
|
|
121
|
+
maneuver-description,
|
|
122
|
+
maneuver-description-distance,
|
|
123
|
+
maneuver-description-distance-border`
|
|
124
|
+
});
|
|
125
|
+
}), this.destinationLocation || this.destinationName ? this.renderDestination() : null);
|
|
126
|
+
}
|
|
127
|
+
/**
|
|
128
|
+
* Render destination.
|
|
129
|
+
*
|
|
130
|
+
* @returns {JSX.Element}
|
|
131
|
+
*/
|
|
132
|
+
renderDestination() {
|
|
133
|
+
return s("div", { class: "instructions-destination" }, s("div", { class: "instructions-destination-icon" }, S() ? null : s("mi-icon", { "icon-name": "marker" })), s("div", { part: "instructions-destination", class: "instructions-destination-details" }, this.destinationLocation ? this.destinationLocation.properties.name : this.destinationName, this.destinationLocation ? s("mi-location-info", { part: "instructions-destination-info", location: this.destinationLocation }) : null));
|
|
134
|
+
}
|
|
135
|
+
};
|
|
136
|
+
I.style = x;
|
|
137
|
+
export {
|
|
138
|
+
I as mi_route_instructions
|
|
139
|
+
};
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
import { r as u, c as g, h as s, H as m } from "./reactcomponent-2f9f051f.mjs";
|
|
2
|
+
import { R as v } from "./route-travel-mode.enum-7f4ce9c7-a9c95a83.mjs";
|
|
3
|
+
import { U as f } from "./unit-system.enum-eaefb53e-0f424da4.mjs";
|
|
4
|
+
import { c as S } from "./utils-ae714467-b07fc3be.mjs";
|
|
5
|
+
import "react";
|
|
6
|
+
import "react-dom";
|
|
7
|
+
const x = ':host{display:block;background-color:#fcfcfc;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 mi-route-instructions-step:hover{cursor:pointer;background-color:#f9fafb;transition:300ms ease}:host mi-route-instructions-step.active{background-color:#f3f4f6;transition:none;cursor:default}:host .instructions-destination{display:flex}:host .instructions-destination-icon{width:40px;display:flex;justify-content:center;align-items:center}:host .instructions-destination-icon mi-icon{width:24px;height:24px;background-color:#1c1917}:host .instructions-destination-details{flex:1;padding:12px}:host .instructions-destination-details mi-location-info{font-size:0.875rem}', I = class {
|
|
8
|
+
constructor(t) {
|
|
9
|
+
u(this, t), this.clicked = g(this, "clicked", 7), this.miStepElements = [], this.lastStepRouteContext = null, this.lastStepTravelMode = null, this.lastStepTransitStop = null, this.activeStep = {
|
|
10
|
+
legIndex: 0,
|
|
11
|
+
stepIndex: 0
|
|
12
|
+
}, this.unit = f.Metric, this.route = void 0, this.hideIndoorSubsteps = !1, this.travelMode = v.Walking, this.originLocation = void 0, this.originName = void 0, this.destinationLocation = void 0, this.destinationName = void 0, this.translations = {
|
|
13
|
+
walk: "Walk",
|
|
14
|
+
bike: "Bike",
|
|
15
|
+
transit: "Transit",
|
|
16
|
+
drive: "Drive",
|
|
17
|
+
leave: "Leave",
|
|
18
|
+
from: "From",
|
|
19
|
+
park: "Park",
|
|
20
|
+
at: "at",
|
|
21
|
+
building: "Building",
|
|
22
|
+
venue: "Venue",
|
|
23
|
+
takeStaircaseToLevel: "Take staircase to level",
|
|
24
|
+
takeLadderToLevel: "Take the ladder to level",
|
|
25
|
+
takeElevatorToLevel: "Take elevator to level",
|
|
26
|
+
takeEscalatorToLevel: "Take escalator to level",
|
|
27
|
+
takeWheelchairLiftToLevel: "Take wheelchair lift to level",
|
|
28
|
+
takeWheelchairRampToLevel: "Take wheelchair ramp to level",
|
|
29
|
+
exit: "Exit",
|
|
30
|
+
enter: "Enter",
|
|
31
|
+
stops: "stops",
|
|
32
|
+
andContinue: "and continue",
|
|
33
|
+
continueStraightAhead: "Continue straight ahead",
|
|
34
|
+
goLeft: "Go left",
|
|
35
|
+
goSharpLeft: "Go sharp left",
|
|
36
|
+
goSlightLeft: "Go slight left",
|
|
37
|
+
goRight: "Go right",
|
|
38
|
+
goSharpRight: "Go sharp right",
|
|
39
|
+
goSlightRight: "Go slight right",
|
|
40
|
+
turnAround: "Turn around",
|
|
41
|
+
days: "d",
|
|
42
|
+
hours: "h",
|
|
43
|
+
minutes: "min"
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
componentDidRender() {
|
|
47
|
+
this.miStepElements.forEach((t) => {
|
|
48
|
+
t.hideIndoorSubsteps = this.hideIndoorSubsteps;
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Transform the step in legs to a flat array of steps.
|
|
53
|
+
*
|
|
54
|
+
* @returns {Step[]}
|
|
55
|
+
*/
|
|
56
|
+
getRouteSteps() {
|
|
57
|
+
return this.route ? this.route.legs.reduce((t, i, e) => {
|
|
58
|
+
for (const o in i.steps) {
|
|
59
|
+
const n = i.steps[o];
|
|
60
|
+
n.originalLegIndex = e, n.originalStepIndex = parseInt(o), t.push(n);
|
|
61
|
+
}
|
|
62
|
+
return t;
|
|
63
|
+
}, []) : [];
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Updates the activeStep attribute and emits an object with leg, step and maneuver index information.
|
|
67
|
+
*
|
|
68
|
+
* @param {CustomEvent<any>} event Step object.
|
|
69
|
+
* @param {number} stepIndex step index.
|
|
70
|
+
*/
|
|
71
|
+
stepClickedHandler(t, i) {
|
|
72
|
+
const e = this.getRouteSteps()[i];
|
|
73
|
+
this.activeStep = {
|
|
74
|
+
legIndex: e.originalLegIndex,
|
|
75
|
+
stepIndex: e.originalStepIndex
|
|
76
|
+
}, this.clicked.emit({
|
|
77
|
+
legIndex: e.originalLegIndex,
|
|
78
|
+
stepIndex: e.originalStepIndex,
|
|
79
|
+
maneuverIndex: t.detail.maneuverIndex
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Check if the step is active.
|
|
84
|
+
*
|
|
85
|
+
* @param {Step} step
|
|
86
|
+
* @returns {boolean}
|
|
87
|
+
*/
|
|
88
|
+
isActiveStep(t) {
|
|
89
|
+
return this.activeStep ? this.activeStep.legIndex === t.originalLegIndex && this.activeStep.stepIndex === t.originalStepIndex : !1;
|
|
90
|
+
}
|
|
91
|
+
render() {
|
|
92
|
+
return this.route ? this.renderInstructions() : null;
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Render instructions.
|
|
96
|
+
*
|
|
97
|
+
* @returns {JSX.Element}
|
|
98
|
+
*/
|
|
99
|
+
renderInstructions() {
|
|
100
|
+
return s(m, null, this.getRouteSteps().map((t, i) => {
|
|
101
|
+
var e, o, n, a, r;
|
|
102
|
+
const d = !((o = (e = this.originLocation) === null || e === void 0 ? void 0 : e.properties) === null || o === void 0) && o.name ? this.originLocation.properties.name : this.originName || "", c = t.originalLegIndex === 0 && t.originalStepIndex === 0 ? d : this.lastStepRouteContext, p = this.lastStepTravelMode, h = this.lastStepTransitStop;
|
|
103
|
+
return this.lastStepRouteContext = t.route_context, this.lastStepTravelMode = t.travel_mode, this.lastStepTransitStop = !((a = (n = t.transit_information) === null || n === void 0 ? void 0 : n.arrival_stop) === null || a === void 0) && a.name ? (r = t.transit_information) === null || r === void 0 ? void 0 : r.arrival_stop.name : null, s("mi-route-instructions-step-legacy", {
|
|
104
|
+
ref: (l) => this.miStepElements.push(l),
|
|
105
|
+
"from-travel-mode": p,
|
|
106
|
+
"from-route-context": c,
|
|
107
|
+
"from-transit-stop": h,
|
|
108
|
+
step: JSON.stringify(t),
|
|
109
|
+
translations: JSON.stringify(this.translations),
|
|
110
|
+
unit: this.unit,
|
|
111
|
+
onStepClicked: (l) => this.stepClickedHandler(l, i),
|
|
112
|
+
class: this.isActiveStep(t) ? "active" : "",
|
|
113
|
+
part: this.isActiveStep(t) ? "step active" : "step",
|
|
114
|
+
// @ts-ignore
|
|
115
|
+
exportparts: `
|
|
116
|
+
step-toggle,
|
|
117
|
+
step-heading,
|
|
118
|
+
step-description,
|
|
119
|
+
step-info,
|
|
120
|
+
step-travel-mode,
|
|
121
|
+
step-travel-mode-icon,
|
|
122
|
+
maneuver-icon,
|
|
123
|
+
maneuver-description,
|
|
124
|
+
maneuver-description-distance,
|
|
125
|
+
maneuver-description-distance-border`
|
|
126
|
+
});
|
|
127
|
+
}), this.destinationLocation || this.destinationName ? this.renderDestination() : null);
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* Render destination.
|
|
131
|
+
*
|
|
132
|
+
* @returns {JSX.Element}
|
|
133
|
+
*/
|
|
134
|
+
renderDestination() {
|
|
135
|
+
return s("div", { class: "instructions-destination" }, s("div", { class: "instructions-destination-icon" }, S() ? null : s("mi-icon", { "icon-name": "marker" })), s("div", { part: "instructions-destination", class: "instructions-destination-details" }, this.destinationLocation ? this.destinationLocation.properties.name : this.destinationName, this.destinationLocation ? s("mi-location-info", { part: "instructions-destination-info", location: this.destinationLocation }) : null));
|
|
136
|
+
}
|
|
137
|
+
};
|
|
138
|
+
I.style = x;
|
|
139
|
+
export {
|
|
140
|
+
I as mi_route_instructions
|
|
141
|
+
};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { r as o, h as e } from "./reactcomponent-2f9f051f.mjs";
|
|
2
|
+
import "react";
|
|
3
|
+
import "react-dom";
|
|
4
|
+
const n = '@charset "UTF-8";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}html{box-sizing:border-box}*,*:before,*:after{box-sizing:inherit}.scroll-buttons{height:100%;width:64px;background-color:#f9fafb;border-left:solid;border-color:#e5e7eb;border-width:1px;display:flex;flex-direction:column;align-items:center;justify-content:center}.scroll-buttons .btn{margin:8px}.scroll-buttons .btn-up::after{content:"↑"}.scroll-buttons .btn-down::after{content:"↓"}', r = class {
|
|
5
|
+
constructor(t) {
|
|
6
|
+
o(this, t), this.scrollContainerElementRef = void 0, this.scrollLength = 100;
|
|
7
|
+
}
|
|
8
|
+
addScrollEventListener() {
|
|
9
|
+
this.scrollContainerElementRef.addEventListener("scroll", () => {
|
|
10
|
+
this.updateScrollButtonsState();
|
|
11
|
+
});
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Adds scroll event listener to the container element when this component is first attached to the DOM.
|
|
15
|
+
*/
|
|
16
|
+
connectedCallback() {
|
|
17
|
+
this.addScrollEventListener();
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Updates enable/disable state for scroll up and down buttons.
|
|
21
|
+
* @returns {Promise<void>}
|
|
22
|
+
*/
|
|
23
|
+
async updateScrollButtonsState() {
|
|
24
|
+
this.scrollContainerElementRef.scrollTop === 0 ? this.upButtonElement.disabled = !0 : this.upButtonElement.disabled && (this.upButtonElement.disabled = !1), this.scrollContainerElementRef.scrollHeight - this.scrollContainerElementRef.scrollTop === this.scrollContainerElementRef.clientHeight ? this.downButtonElement.disabled = !0 : this.downButtonElement.disabled && (this.downButtonElement.disabled = !1);
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Update scroll position.
|
|
28
|
+
* @param {number} value - Value to scroll.
|
|
29
|
+
*/
|
|
30
|
+
updateScrollPosition(t) {
|
|
31
|
+
"scrollBehavior" in document.documentElement.style ? this.scrollContainerElementRef.scroll({
|
|
32
|
+
top: this.scrollContainerElementRef.scrollTop + t,
|
|
33
|
+
behavior: "smooth"
|
|
34
|
+
}) : this.scrollContainerElementRef.scrollTop = t;
|
|
35
|
+
}
|
|
36
|
+
render() {
|
|
37
|
+
return e("div", { class: "scroll-buttons" }, e("button", { class: "mi-button mi-button--base btn btn-up", type: "button", disabled: !0, "aria-label": "Scroll Up", ref: (t) => this.upButtonElement = t, onClick: () => this.updateScrollPosition(-this.scrollLength) }), e("button", { class: "mi-button mi-button--base btn btn-down", type: "button", "aria-label": "Scroll Down", ref: (t) => this.downButtonElement = t, onClick: () => this.updateScrollPosition(this.scrollLength) }));
|
|
38
|
+
}
|
|
39
|
+
static get watchers() {
|
|
40
|
+
return {
|
|
41
|
+
scrollContainerElementRef: ["addScrollEventListener"]
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
r.style = n;
|
|
46
|
+
export {
|
|
47
|
+
r as mi_scroll_buttons
|
|
48
|
+
};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { r as o, h as e } from "./webcomponent-a10be1e6.mjs";
|
|
2
|
+
const n = '@charset "UTF-8";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}html{box-sizing:border-box}*,*:before,*:after{box-sizing:inherit}.scroll-buttons{height:100%;width:64px;background-color:#f9fafb;border-left:solid;border-color:#e5e7eb;border-width:1px;display:flex;flex-direction:column;align-items:center;justify-content:center}.scroll-buttons .btn{margin:8px}.scroll-buttons .btn-up::after{content:"↑"}.scroll-buttons .btn-down::after{content:"↓"}', r = class {
|
|
3
|
+
constructor(t) {
|
|
4
|
+
o(this, t), this.scrollContainerElementRef = void 0, this.scrollLength = 100;
|
|
5
|
+
}
|
|
6
|
+
addScrollEventListener() {
|
|
7
|
+
this.scrollContainerElementRef.addEventListener("scroll", () => {
|
|
8
|
+
this.updateScrollButtonsState();
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Adds scroll event listener to the container element when this component is first attached to the DOM.
|
|
13
|
+
*/
|
|
14
|
+
connectedCallback() {
|
|
15
|
+
this.addScrollEventListener();
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Updates enable/disable state for scroll up and down buttons.
|
|
19
|
+
* @returns {Promise<void>}
|
|
20
|
+
*/
|
|
21
|
+
async updateScrollButtonsState() {
|
|
22
|
+
this.scrollContainerElementRef.scrollTop === 0 ? this.upButtonElement.disabled = !0 : this.upButtonElement.disabled && (this.upButtonElement.disabled = !1), this.scrollContainerElementRef.scrollHeight - this.scrollContainerElementRef.scrollTop === this.scrollContainerElementRef.clientHeight ? this.downButtonElement.disabled = !0 : this.downButtonElement.disabled && (this.downButtonElement.disabled = !1);
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Update scroll position.
|
|
26
|
+
* @param {number} value - Value to scroll.
|
|
27
|
+
*/
|
|
28
|
+
updateScrollPosition(t) {
|
|
29
|
+
"scrollBehavior" in document.documentElement.style ? this.scrollContainerElementRef.scroll({
|
|
30
|
+
top: this.scrollContainerElementRef.scrollTop + t,
|
|
31
|
+
behavior: "smooth"
|
|
32
|
+
}) : this.scrollContainerElementRef.scrollTop = t;
|
|
33
|
+
}
|
|
34
|
+
render() {
|
|
35
|
+
return e("div", { class: "scroll-buttons" }, e("button", { class: "mi-button mi-button--base btn btn-up", type: "button", disabled: !0, "aria-label": "Scroll Up", ref: (t) => this.upButtonElement = t, onClick: () => this.updateScrollPosition(-this.scrollLength) }), e("button", { class: "mi-button mi-button--base btn btn-down", type: "button", "aria-label": "Scroll Down", ref: (t) => this.downButtonElement = t, onClick: () => this.updateScrollPosition(this.scrollLength) }));
|
|
36
|
+
}
|
|
37
|
+
static get watchers() {
|
|
38
|
+
return {
|
|
39
|
+
scrollContainerElementRef: ["addScrollEventListener"]
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
r.style = n;
|
|
44
|
+
export {
|
|
45
|
+
r as mi_scroll_buttons
|
|
46
|
+
};
|