@geotrekce/geotrek-rando-widget 0.0.3 → 0.0.6
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/cjs/geotrek-rando-widget.cjs.js +2 -2
- package/dist/cjs/grw-app.cjs.entry.js +111 -0
- package/dist/cjs/{grw-app_10.cjs.entry.js → grw-filter_6.cjs.entry.js} +284 -446
- package/dist/cjs/grw-information-desk-detail_3.cjs.entry.js +52 -0
- package/dist/cjs/grw-trek-card.cjs.entry.js +47 -0
- package/dist/cjs/{index-c6f73e30.js → index-c2c4531d.js} +46 -1
- package/dist/cjs/length-d315d156.js +34 -0
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/store-fd04a216.js +211 -0
- package/dist/collection/collection-manifest.json +1 -0
- package/dist/collection/components/grw-app/grw-app.css +69 -5
- package/dist/collection/components/grw-app/grw-app.js +76 -28
- package/dist/collection/components/grw-filter/grw-filter.css +29 -0
- package/dist/collection/components/grw-filter/grw-filter.js +132 -0
- package/dist/collection/components/grw-information-desk-detail/grw-information-desk-detail.css +5 -4
- package/dist/collection/components/grw-information-desk-detail/grw-information-desk-detail.js +1 -1
- package/dist/collection/components/grw-map/grw-map.css +19 -1
- package/dist/collection/components/grw-map/grw-map.js +101 -40
- package/dist/collection/components/grw-poi-detail/grw-poi-detail.css +5 -4
- package/dist/collection/components/grw-poi-detail/grw-poi-detail.js +1 -1
- package/dist/collection/components/grw-sensitive-area-detail/grw-sensitive-area-detail.css +27 -3
- package/dist/collection/components/grw-sensitive-area-detail/grw-sensitive-area-detail.js +17 -3
- package/dist/collection/components/grw-trek-card/grw-trek-card.css +66 -32
- package/dist/collection/components/grw-trek-card/grw-trek-card.js +34 -10
- package/dist/collection/components/grw-trek-detail/grw-trek-detail.css +134 -4
- package/dist/collection/components/grw-trek-detail/grw-trek-detail.js +95 -6
- package/dist/collection/components/grw-treks-list/grw-treks-list.css +16 -3
- package/dist/collection/components/grw-treks-list/grw-treks-list.js +33 -6
- package/dist/collection/store/grw-trek-provider.js +32 -10
- package/dist/collection/store/grw-treks-provider.js +14 -4
- package/dist/collection/store/store.js +10 -1
- package/dist/collection/stories/App.js +8 -10
- package/dist/collection/stories/App.stories.js +4 -3
- package/dist/collection/stories/TrekMap.stories.js +3 -2
- package/dist/collection/stories/TreksList.js +8 -8
- package/dist/collection/stories/TreksMap.stories.js +3 -2
- package/dist/components/grw-app.js +66 -9
- package/dist/components/grw-filter.d.ts +11 -0
- package/dist/components/grw-filter.js +6 -0
- package/dist/components/grw-filter2.js +95 -0
- package/dist/components/grw-information-desk-detail2.js +2 -2
- package/dist/components/grw-map2.js +102 -41
- package/dist/components/grw-poi-detail2.js +2 -2
- package/dist/components/grw-sensitive-area-detail2.js +7 -2
- package/dist/components/grw-trek-card2.js +10 -5
- package/dist/components/grw-trek-detail2.js +25 -4
- package/dist/components/grw-trek-provider2.js +32 -10
- package/dist/components/grw-treks-list2.js +15 -7
- package/dist/components/grw-treks-provider2.js +14 -4
- package/dist/components/store.js +10 -1
- package/dist/esm/geotrek-rando-widget.js +2 -2
- package/dist/esm/grw-app.entry.js +107 -0
- package/dist/esm/{grw-app_10.entry.js → grw-filter_6.entry.js} +246 -404
- package/dist/esm/grw-information-desk-detail_3.entry.js +46 -0
- package/dist/esm/grw-trek-card.entry.js +43 -0
- package/dist/esm/{index-7aa9e822.js → index-192d910f.js} +47 -2
- package/dist/esm/length-d82189db.js +27 -0
- package/dist/esm/loader.js +2 -2
- package/dist/esm/store-b2c76c0c.js +208 -0
- package/dist/geotrek-rando-widget/geotrek-rando-widget.esm.js +1 -1
- package/dist/geotrek-rando-widget/p-1b2ba86d.entry.js +1 -0
- package/dist/geotrek-rando-widget/p-5f17d340.entry.js +1 -0
- package/dist/geotrek-rando-widget/p-6716c635.entry.js +1 -0
- package/dist/geotrek-rando-widget/p-6dce5e6c.js +2 -0
- package/dist/geotrek-rando-widget/p-7715153d.entry.js +1 -0
- package/dist/geotrek-rando-widget/p-e6710c64.js +1 -0
- package/dist/geotrek-rando-widget/p-f3f7d6be.js +1 -0
- package/dist/types/components/grw-app/grw-app.d.ts +9 -2
- package/dist/types/components/grw-filter/grw-filter.d.ts +9 -0
- package/dist/types/components/grw-map/grw-map.d.ts +3 -1
- package/dist/types/components/grw-trek-card/grw-trek-card.d.ts +6 -4
- package/dist/types/components/grw-trek-detail/grw-trek-detail.d.ts +9 -4
- package/dist/types/components/grw-treks-list/grw-treks-list.d.ts +1 -0
- package/dist/types/components.d.ts +23 -2
- package/dist/types/store/store.d.ts +22 -3
- package/dist/types/types/types.d.ts +74 -1
- package/package.json +5 -4
- package/readme.md +4 -5
- package/dist/geotrek-rando-widget/p-332ba9ab.js +0 -2
- package/dist/geotrek-rando-widget/p-73bc92fe.entry.js +0 -1
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { r as registerInstance, h, H as Host } from './index-192d910f.js';
|
|
2
|
+
import { s as state } from './store-b2c76c0c.js';
|
|
3
|
+
|
|
4
|
+
const grwInformationDeskDetailCss = ":host{display:flex;flex-direction:column}:host a{color:var(--color-primary)}.information-desk-img{width:180px}.information-desk-img img{width:180px;border-radius:8px}.information-desk-sub-container{display:flex;flex-direction:column}.information-desk-name{color:var(--color-primary);font-size:24px;font-weight:bold;padding:12px 0px}.information-desk-description{font-size:16px}";
|
|
5
|
+
|
|
6
|
+
const GrwInformationDeskDetail = class {
|
|
7
|
+
constructor(hostRef) {
|
|
8
|
+
registerInstance(this, hostRef);
|
|
9
|
+
}
|
|
10
|
+
render() {
|
|
11
|
+
return (h(Host, null, this.informationDesk.photo_url && (h("div", { class: "information-desk-img" }, h("img", { src: this.informationDesk.photo_url, loading: "lazy" }))), h("div", { class: "information-desk-sub-container" }, this.informationDesk.name && h("div", { class: "information-desk-name" }, this.informationDesk.name), this.informationDesk.description && h("div", { class: "information-desk-description", innerHTML: this.informationDesk.description }), this.informationDesk.postal_code ||
|
|
12
|
+
this.informationDesk.municipality ||
|
|
13
|
+
(this.informationDesk.street && (h("div", null, this.informationDesk.postal_code, ` ${this.informationDesk.municipality}`, ` ${this.informationDesk.street}`))), this.informationDesk.phone && (h("div", null, h("a", { href: `tel:${this.informationDesk.phone}` }, this.informationDesk.phone))), this.informationDesk.email && (h("div", null, h("a", { href: `mailto:${this.informationDesk.email}` }, this.informationDesk.email))), this.informationDesk.website && (h("div", null, h("a", { href: `${this.informationDesk.website}` }, this.informationDesk.website))))));
|
|
14
|
+
}
|
|
15
|
+
};
|
|
16
|
+
GrwInformationDeskDetail.style = grwInformationDeskDetailCss;
|
|
17
|
+
|
|
18
|
+
const grwPoiDetailCss = ":host{display:flex;flex-direction:column}:host a{color:var(--color-primary)}.poi-img{width:180px}.poi-img img{width:180px;border-radius:8px}.poi-sub-container{display:flex;flex-direction:column}.poi-name{color:var(--color-primary);font-size:24px;font-weight:bold;padding:12px 0px}.poi-description{font-size:16px}";
|
|
19
|
+
|
|
20
|
+
const GrwPoiDetail = class {
|
|
21
|
+
constructor(hostRef) {
|
|
22
|
+
registerInstance(this, hostRef);
|
|
23
|
+
}
|
|
24
|
+
render() {
|
|
25
|
+
return (h(Host, null, this.poi.attachments && this.poi.attachments[0] && this.poi.attachments[0].thumbnail && (h("div", { class: "poi-img" }, h("img", { src: this.poi.attachments[0].thumbnail, loading: "lazy" }))), h("div", { class: "poi-sub-container" }, h("div", { class: "poi-name" }, this.poi.name), h("div", { class: "poi-description", innerHTML: this.poi.description }))));
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
GrwPoiDetail.style = grwPoiDetailCss;
|
|
29
|
+
|
|
30
|
+
const grwSensitiveAreaDetailCss = ":host{display:flex;flex-direction:column}:host a{color:var(--color-primary)}.sensitive-area-title{color:var(--color-primary);font-size:24px;padding:12px 0px;font-weight:bold}.sensitive-area-description{font-size:16px}.sensitive-area-period-container .sensitive-area-period-title,.sensitive-area-period-container .sensitive-area-practice-title,.sensitive-area-period-container .sensitive-area-contact-title,.sensitive-area-practice-container .sensitive-area-period-title,.sensitive-area-practice-container .sensitive-area-practice-title,.sensitive-area-practice-container .sensitive-area-contact-title,.sensitive-area-contact-container .sensitive-area-period-title,.sensitive-area-contact-container .sensitive-area-practice-title,.sensitive-area-contact-container .sensitive-area-contact-title{color:var(--color-primary);font-size:24px;padding:12px 0px}.sensitive-area-period-container .sensitive-area-period-values,.sensitive-area-period-container .sensitive-area-practice-values,.sensitive-area-practice-container .sensitive-area-period-values,.sensitive-area-practice-container .sensitive-area-practice-values,.sensitive-area-contact-container .sensitive-area-period-values,.sensitive-area-contact-container .sensitive-area-practice-values{display:flex}";
|
|
31
|
+
|
|
32
|
+
const GrwSensitiveAreaDetail = class {
|
|
33
|
+
constructor(hostRef) {
|
|
34
|
+
registerInstance(this, hostRef);
|
|
35
|
+
}
|
|
36
|
+
render() {
|
|
37
|
+
return (h(Host, null, h("div", { class: "sensitive-area-title" }, this.sensitiveArea.name), h("div", { class: "sensitive-area-description", innerHTML: this.sensitiveArea.description }), this.sensitiveArea.practices && this.sensitiveArea.practices.length > 0 && (h("div", { class: "sensitive-area-practice-container" }, h("div", { class: "sensitive-area-practice-title" }, "Domaines d'activit\u00E9s concern\u00E9s :"), h("div", { class: "sensitive-area-practice-values" }, this.sensitiveArea.practices.map((practice, index) => (h("div", { innerHTML: `${state.practices.find(statePractice => statePractice.id === practice).name.toUpperCase()}${index + 1 !== this.sensitiveArea.practices.length ? ' - ' : ''}` })))))), this.sensitiveArea.period && this.sensitiveArea.period.length > 0 && (h("div", { class: "sensitive-area-period-container" }, h("div", { class: "sensitive-area-period-title" }, "P\u00E9riodes de sensibilit\u00E9"), h("div", { class: "sensitive-area-period-values" }, this.sensitiveArea.period.map((month, index) => {
|
|
38
|
+
if (month) {
|
|
39
|
+
return (h("div", { innerHTML: `${new Date(0, index + 1, 0).toLocaleDateString('fr', { month: 'long' }).toUpperCase()}${this.sensitiveArea.period.slice(index + 1).find(month => month) ? ' - ' : ''}` }));
|
|
40
|
+
}
|
|
41
|
+
})))), h("div", { class: "sensitive-area-contact-container" }, h("div", { class: "sensitive-area-contact-title" }, "Contact"), h("div", { innerHTML: this.sensitiveArea.contact, class: "sensitive-area-contact-value" }))));
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
GrwSensitiveAreaDetail.style = grwSensitiveAreaDetailCss;
|
|
45
|
+
|
|
46
|
+
export { GrwInformationDeskDetail as grw_information_desk_detail, GrwPoiDetail as grw_poi_detail, GrwSensitiveAreaDetail as grw_sensitive_area_detail };
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { r as registerInstance, c as createEvent, h, H as Host } from './index-192d910f.js';
|
|
2
|
+
import { s as state, o as onChange } from './store-b2c76c0c.js';
|
|
3
|
+
import { d as durationImage, f as formatDuration, l as lengthImage, a as formatLength, b as ascentImage, c as formatAscent } from './length-d82189db.js';
|
|
4
|
+
|
|
5
|
+
const grwTrekCardCss = ".trek-card-container,.trek-card-large-view-container{font-family:\"Roboto\";border-radius:8px;box-shadow:4px 8px 24px rgba(0, 0, 0, 0.25);cursor:pointer}.trek-card-container .image,.trek-card-large-view-container .image{object-fit:cover}.trek-card-container .sub-container,.trek-card-large-view-container .sub-container{display:flex;flex-direction:column;justify-content:center;padding:12px}.trek-card-container .sub-container .name,.trek-card-large-view-container .sub-container .name{color:var(--color-primary);font-size:24px;font-weight:bold;margin-bottom:8px}.trek-card-container .sub-container .departure,.trek-card-large-view-container .sub-container .departure{color:rgba(0, 0, 0, 0.7);font-size:16px;margin:4px 0px}.trek-card-container .sub-container .themes-container,.trek-card-large-view-container .sub-container .themes-container{display:flex;justify-content:flex-start;align-items:center;flex-wrap:wrap}.trek-card-container .sub-container .themes-container .theme,.trek-card-large-view-container .sub-container .themes-container .theme{background-color:var(--color-primary-tint);color:#ffffff;border-radius:8px;padding:8px;margin:0px 8px 8px 0px}.trek-card-container .sub-container .icons-labels-container,.trek-card-large-view-container .sub-container .icons-labels-container{display:flex;justify-content:flex-start;align-items:center;flex-wrap:wrap}.trek-card-container .sub-container .icons-labels-container .row,.trek-card-large-view-container .sub-container .icons-labels-container .row{display:flex;justify-content:space-between;align-items:center;width:100%}.trek-card-container .sub-container .icons-labels-container .row:not(:last-child),.trek-card-large-view-container .sub-container .icons-labels-container .row:not(:last-child){margin-bottom:12px}.trek-card-container .sub-container .icons-labels-container .row .icon-label,.trek-card-large-view-container .sub-container .icons-labels-container .row .icon-label{display:flex;align-items:center;width:50%}.trek-card-container .sub-container .icons-labels-container .row .icon-label:nth-child(2),.trek-card-large-view-container .sub-container .icons-labels-container .row .icon-label:nth-child(2){margin:0px 4px}.trek-card-container .sub-container .icons-labels-container .row .icon-label img,.trek-card-container .sub-container .icons-labels-container .row .icon-label .svg-icon svg,.trek-card-large-view-container .sub-container .icons-labels-container .row .icon-label img,.trek-card-large-view-container .sub-container .icons-labels-container .row .icon-label .svg-icon svg{width:24px;height:auto;margin-right:8px}.trek-card-container .sub-container .icons-labels-container .row .practice img,.trek-card-large-view-container .sub-container .icons-labels-container .row .practice img{background-color:var(--color-primary)}.trek-card-container{width:350px;height:auto}.trek-card-container .image{width:100%}.trek-card-large-view-container{height:auto;display:flex;flex-direction:row}.trek-card-large-view-container .image{width:250px}";
|
|
6
|
+
|
|
7
|
+
const GrwTrekCard = class {
|
|
8
|
+
constructor(hostRef) {
|
|
9
|
+
registerInstance(this, hostRef);
|
|
10
|
+
this.trekCardPress = createEvent(this, "trekCardPress", 7);
|
|
11
|
+
this.colorPrimary = '#6b0030';
|
|
12
|
+
this.colorPrimaryTint = '#974c6e';
|
|
13
|
+
this.isLargeView = false;
|
|
14
|
+
}
|
|
15
|
+
componentWillLoad() {
|
|
16
|
+
this.currentTrek = this.trek ? this.trek : state.currentTrek;
|
|
17
|
+
if (this.currentTrek) {
|
|
18
|
+
this.difficulty = state.difficulties.find(difficulty => difficulty.id === this.currentTrek.difficulty);
|
|
19
|
+
this.route = state.routes.find(route => route.id === this.currentTrek.route);
|
|
20
|
+
this.practice = state.practices.find(practice => practice.id === this.currentTrek.practice);
|
|
21
|
+
this.themes = state.themes.filter(theme => this.currentTrek.themes.includes(theme.id));
|
|
22
|
+
}
|
|
23
|
+
onChange('currentTrek', () => {
|
|
24
|
+
this.currentTrek = this.trek ? this.trek : state.currentTrek;
|
|
25
|
+
if (this.currentTrek) {
|
|
26
|
+
this.difficulty = state.difficulties.find(difficulty => difficulty.id === this.currentTrek.difficulty);
|
|
27
|
+
this.route = state.routes.find(route => route.id === this.currentTrek.route);
|
|
28
|
+
this.practice = state.practices.find(practice => practice.id === this.currentTrek.practice);
|
|
29
|
+
this.themes = state.themes.filter(theme => this.currentTrek.themes.includes(theme.id));
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
render() {
|
|
34
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
35
|
+
return (h(Host, { onClick: () => this.trekCardPress.emit(this.currentTrek.id), style: { 'width': this.isLargeView ? '100%' : 'auto', '--color-primary': this.colorPrimary, '--color-primary-tint': this.colorPrimaryTint } }, this.currentTrek && (h("div", { class: this.isLargeView ? 'trek-card-large-view-container' : 'trek-card-container' }, this.currentTrek.attachments && this.currentTrek.attachments[0] && this.currentTrek.attachments[0].thumbnail && (h("img", { class: "image", src: `${this.currentTrek.attachments[0].thumbnail}`, loading: "lazy" })), h("div", { class: "sub-container" }, h("div", { class: "departure" }, (_a = this.currentTrek) === null || _a === void 0 ? void 0 : _a.departure), h("div", { class: "name" }, (_b = this.currentTrek) === null || _b === void 0 ? void 0 : _b.name), h("div", { class: "themes-container" }, this.themes.map(theme => (h("div", { class: "theme" }, theme.label)))), h("div", { class: "icons-labels-container" }, h("div", { class: "row" }, h("div", { class: "icon-label difficulty" }, ((_c = this.difficulty) === null || _c === void 0 ? void 0 : _c.pictogram) && h("img", { src: this.difficulty.pictogram }), (_d = this.difficulty) === null || _d === void 0 ? void 0 :
|
|
36
|
+
_d.label), h("div", { class: "icon-label duration" }, h("div", { class: "svg-icon", innerHTML: durationImage }), formatDuration(this.currentTrek.duration))), h("div", { class: "row" }, h("div", { class: "icon-label length" }, h("div", { class: "svg-icon", innerHTML: lengthImage }), formatLength(this.currentTrek.length_2d)), h("div", { class: "icon-label ascent" }, h("div", { class: "svg-icon", innerHTML: ascentImage }), formatAscent(this.currentTrek.ascent))), h("div", { class: "row" }, h("div", { class: "icon-label route" }, ((_e = this.route) === null || _e === void 0 ? void 0 : _e.pictogram) && h("img", { src: this.route.pictogram }), (_f = this.route) === null || _f === void 0 ? void 0 :
|
|
37
|
+
_f.route), h("div", { class: "icon-label practice" }, ((_g = this.practice) === null || _g === void 0 ? void 0 : _g.pictogram) && h("img", { src: this.practice.pictogram }), (_h = this.practice) === null || _h === void 0 ? void 0 :
|
|
38
|
+
_h.name))))))));
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
GrwTrekCard.style = grwTrekCardCss;
|
|
42
|
+
|
|
43
|
+
export { GrwTrekCard as grw_trek_card };
|
|
@@ -167,6 +167,7 @@ const isComplexType = (o) => {
|
|
|
167
167
|
// export function h(nodeName: string | d.FunctionalComponent, vnodeData: d.PropsType, ...children: d.ChildType[]): d.VNode;
|
|
168
168
|
const h = (nodeName, vnodeData, ...children) => {
|
|
169
169
|
let child = null;
|
|
170
|
+
let key = null;
|
|
170
171
|
let simple = false;
|
|
171
172
|
let lastSimple = false;
|
|
172
173
|
const vNodeChildren = [];
|
|
@@ -194,6 +195,10 @@ const h = (nodeName, vnodeData, ...children) => {
|
|
|
194
195
|
};
|
|
195
196
|
walk(children);
|
|
196
197
|
if (vnodeData) {
|
|
198
|
+
// normalize class / classname attributes
|
|
199
|
+
if (vnodeData.key) {
|
|
200
|
+
key = vnodeData.key;
|
|
201
|
+
}
|
|
197
202
|
{
|
|
198
203
|
const classData = vnodeData.className || vnodeData.class;
|
|
199
204
|
if (classData) {
|
|
@@ -211,6 +216,9 @@ const h = (nodeName, vnodeData, ...children) => {
|
|
|
211
216
|
if (vNodeChildren.length > 0) {
|
|
212
217
|
vnode.$children$ = vNodeChildren;
|
|
213
218
|
}
|
|
219
|
+
{
|
|
220
|
+
vnode.$key$ = key;
|
|
221
|
+
}
|
|
214
222
|
return vnode;
|
|
215
223
|
};
|
|
216
224
|
const newVNode = (tag, text) => {
|
|
@@ -224,6 +232,9 @@ const newVNode = (tag, text) => {
|
|
|
224
232
|
{
|
|
225
233
|
vnode.$attrs$ = null;
|
|
226
234
|
}
|
|
235
|
+
{
|
|
236
|
+
vnode.$key$ = null;
|
|
237
|
+
}
|
|
227
238
|
return vnode;
|
|
228
239
|
};
|
|
229
240
|
const Host = {};
|
|
@@ -272,6 +283,8 @@ const setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
|
|
|
272
283
|
}
|
|
273
284
|
}
|
|
274
285
|
}
|
|
286
|
+
else if (memberName === 'key')
|
|
287
|
+
;
|
|
275
288
|
else if ((!isProp ) &&
|
|
276
289
|
memberName[0] === 'o' &&
|
|
277
290
|
memberName[1] === 'n') {
|
|
@@ -436,6 +449,8 @@ const removeVnodes = (vnodes, startIdx, endIdx, vnode, elm) => {
|
|
|
436
449
|
const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
|
|
437
450
|
let oldStartIdx = 0;
|
|
438
451
|
let newStartIdx = 0;
|
|
452
|
+
let idxInOld = 0;
|
|
453
|
+
let i = 0;
|
|
439
454
|
let oldEndIdx = oldCh.length - 1;
|
|
440
455
|
let oldStartVnode = oldCh[0];
|
|
441
456
|
let oldEndVnode = oldCh[oldEndIdx];
|
|
@@ -443,6 +458,7 @@ const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
|
|
|
443
458
|
let newStartVnode = newCh[0];
|
|
444
459
|
let newEndVnode = newCh[newEndIdx];
|
|
445
460
|
let node;
|
|
461
|
+
let elmToMove;
|
|
446
462
|
while (oldStartIdx <= oldEndIdx && newStartIdx <= newEndIdx) {
|
|
447
463
|
if (oldStartVnode == null) {
|
|
448
464
|
// Vnode might have been moved left
|
|
@@ -480,7 +496,29 @@ const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
|
|
|
480
496
|
newStartVnode = newCh[++newStartIdx];
|
|
481
497
|
}
|
|
482
498
|
else {
|
|
499
|
+
// createKeyToOldIdx
|
|
500
|
+
idxInOld = -1;
|
|
483
501
|
{
|
|
502
|
+
for (i = oldStartIdx; i <= oldEndIdx; ++i) {
|
|
503
|
+
if (oldCh[i] && oldCh[i].$key$ !== null && oldCh[i].$key$ === newStartVnode.$key$) {
|
|
504
|
+
idxInOld = i;
|
|
505
|
+
break;
|
|
506
|
+
}
|
|
507
|
+
}
|
|
508
|
+
}
|
|
509
|
+
if (idxInOld >= 0) {
|
|
510
|
+
elmToMove = oldCh[idxInOld];
|
|
511
|
+
if (elmToMove.$tag$ !== newStartVnode.$tag$) {
|
|
512
|
+
node = createElm(oldCh && oldCh[newStartIdx], newVNode, idxInOld);
|
|
513
|
+
}
|
|
514
|
+
else {
|
|
515
|
+
patch(elmToMove, newStartVnode);
|
|
516
|
+
oldCh[idxInOld] = undefined;
|
|
517
|
+
node = elmToMove.$elm$;
|
|
518
|
+
}
|
|
519
|
+
newStartVnode = newCh[++newStartIdx];
|
|
520
|
+
}
|
|
521
|
+
else {
|
|
484
522
|
// new element
|
|
485
523
|
node = createElm(oldCh && oldCh[newStartIdx], newVNode, newStartIdx);
|
|
486
524
|
newStartVnode = newCh[++newStartIdx];
|
|
@@ -503,7 +541,9 @@ const isSameVnode = (vnode1, vnode2) => {
|
|
|
503
541
|
// compare if two vnode to see if they're "technically" the same
|
|
504
542
|
// need to have the same element tag, and same key to be the same
|
|
505
543
|
if (vnode1.$tag$ === vnode2.$tag$) {
|
|
506
|
-
|
|
544
|
+
{
|
|
545
|
+
return vnode1.$key$ === vnode2.$key$;
|
|
546
|
+
}
|
|
507
547
|
}
|
|
508
548
|
return false;
|
|
509
549
|
};
|
|
@@ -793,6 +833,11 @@ const addHydratedFlag = (elm) => elm.classList.add('hydrated')
|
|
|
793
833
|
const parsePropertyValue = (propValue, propType) => {
|
|
794
834
|
// ensure this value is of the correct prop type
|
|
795
835
|
if (propValue != null && !isComplexType(propValue)) {
|
|
836
|
+
if (propType & 4 /* Boolean */) {
|
|
837
|
+
// per the HTML spec, any string value means it is a boolean true value
|
|
838
|
+
// but we'll cheat here and say that the string "false" is the boolean false
|
|
839
|
+
return propValue === 'false' ? false : propValue === '' || !!propValue;
|
|
840
|
+
}
|
|
796
841
|
if (propType & 2 /* Number */) {
|
|
797
842
|
// force it to be a number
|
|
798
843
|
return parseFloat(propValue);
|
|
@@ -1265,4 +1310,4 @@ const flush = () => {
|
|
|
1265
1310
|
const nextTick = /*@__PURE__*/ (cb) => promiseResolve().then(cb);
|
|
1266
1311
|
const writeTask = /*@__PURE__*/ queueTask(queueDomWrites, true);
|
|
1267
1312
|
|
|
1268
|
-
export { Host as H,
|
|
1313
|
+
export { Host as H, getRenderingRef as a, bootstrapLazy as b, createEvent as c, forceUpdate as f, getElement as g, h, promiseResolve as p, registerInstance as r };
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
function formatDuration(duration) {
|
|
2
|
+
let formattedDuration;
|
|
3
|
+
if (duration < 24) {
|
|
4
|
+
formattedDuration = `${Math.floor(duration)}h`;
|
|
5
|
+
if (duration % 1 > 0) {
|
|
6
|
+
formattedDuration += `${Math.round(60 * (duration % 1))}min`;
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
else {
|
|
10
|
+
formattedDuration = `${duration / 24}j`;
|
|
11
|
+
}
|
|
12
|
+
return formattedDuration;
|
|
13
|
+
}
|
|
14
|
+
function formatLength(length) {
|
|
15
|
+
return `${Math.round(length / 1000)}km`;
|
|
16
|
+
}
|
|
17
|
+
function formatAscent(ascent) {
|
|
18
|
+
return `${ascent}m`;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
const ascentImage = `<svg xmlns="http://www.w3.org/2000/svg" width="512" height="512" viewBox="0 0 512 512"><polyline points="352 144 464 144 464 256" style="fill:none;stroke:#000;stroke-linecap:round;stroke-linejoin:round;stroke-width:32px"/><path d="M48,368,169.37,246.63a32,32,0,0,1,45.26,0l50.74,50.74a32,32,0,0,0,45.26,0L448,160" style="fill:none;stroke:#000;stroke-linecap:round;stroke-linejoin:round;stroke-width:32px"/></svg>`;
|
|
22
|
+
|
|
23
|
+
const durationImage = `<svg xmlns="http://www.w3.org/2000/svg" width="512" height="512" viewBox="0 0 512 512"><path d="M145.61,464H366.39c19.8,0,35.55-16.29,33.42-35.06C386.06,308,304,310,304,256s83.11-51,95.8-172.94c2-18.78-13.61-35.06-33.41-35.06H145.61c-19.8,0-35.37,16.28-33.41,35.06C124.89,205,208,201,208,256s-82.06,52-95.8,172.94C110.06,447.71,125.81,464,145.61,464Z" style="fill:none;stroke:#000;stroke-linecap:round;stroke-linejoin:round;stroke-width:32px"/><path d="M343.3,432H169.13c-15.6,0-20-18-9.06-29.16C186.55,376,240,356.78,240,326V224c0-19.85-38-35-61.51-67.2-3.88-5.31-3.49-12.8,6.37-12.8H327.59c8.41,0,10.23,7.43,6.4,12.75C310.82,189,272,204.05,272,224V326c0,30.53,55.71,47,80.4,76.87C362.35,414.91,358.87,432,343.3,432Z"/></svg>`;
|
|
24
|
+
|
|
25
|
+
const lengthImage = `<svg xmlns="http://www.w3.org/2000/svg" width="512" height="512" viewBox="0 0 512 512"><polyline points="304 96 416 96 416 208" style="fill:none;stroke:#000;stroke-linecap:round;stroke-linejoin:round;stroke-width:32px"/><line x1="405.77" y1="106.2" x2="111.98" y2="400.02" style="fill:none;stroke:#000;stroke-linecap:round;stroke-linejoin:round;stroke-width:32px"/><polyline points="208 416 96 416 96 304" style="fill:none;stroke:#000;stroke-linecap:round;stroke-linejoin:round;stroke-width:32px"/></svg>`;
|
|
26
|
+
|
|
27
|
+
export { formatLength as a, ascentImage as b, formatAscent as c, durationImage as d, formatDuration as f, lengthImage as l };
|
package/dist/esm/loader.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { p as promiseResolve, b as bootstrapLazy } from './index-
|
|
1
|
+
import { p as promiseResolve, b as bootstrapLazy } from './index-192d910f.js';
|
|
2
2
|
|
|
3
3
|
/*
|
|
4
4
|
Stencil Client Patch Esm v2.16.1 | MIT Licensed | https://stenciljs.com
|
|
@@ -10,7 +10,7 @@ const patchEsm = () => {
|
|
|
10
10
|
const defineCustomElements = (win, options) => {
|
|
11
11
|
if (typeof window === 'undefined') return Promise.resolve();
|
|
12
12
|
return patchEsm().then(() => {
|
|
13
|
-
return bootstrapLazy([["grw-
|
|
13
|
+
return bootstrapLazy([["grw-trek-card",[[1,"grw-trek-card",{"trek":[16],"colorPrimary":[1,"color-primary"],"colorPrimaryTint":[1,"color-primary-tint"],"isLargeView":[4,"is-large-view"],"currentTrek":[32],"difficulty":[32],"route":[32],"practice":[32],"themes":[32]}]]],["grw-information-desk-detail_3",[[1,"grw-information-desk-detail",{"informationDesk":[16]}],[1,"grw-poi-detail",{"poi":[16]}],[1,"grw-sensitive-area-detail",{"sensitiveArea":[16]}]]],["grw-filter_6",[[1,"grw-trek-detail",{"trek":[16],"colorPrimary":[1,"color-primary"],"colorPrimaryShade":[1,"color-primary-shade"],"colorPrimaryTint":[1,"color-primary-tint"],"difficulty":[32],"route":[32],"practice":[32],"themes":[32],"labels":[32],"sources":[32],"accessibilities":[32],"accessibilityLevel":[32],"currentTrek":[32]}],[1,"grw-treks-list",{"colorPrimary":[1,"color-primary"],"colorPrimaryTint":[1,"color-primary-tint"],"isLargeView":[4,"is-large-view"],"treksToDisplay":[32]}],[1,"grw-filter",{"filterType":[1,"filter-type"],"filterName":[1,"filter-name"],"filterNameProperty":[1,"filter-name-property"]}],[0,"grw-map",{"urlLayer":[1,"url-layer"],"attribution":[1],"center":[1],"zoom":[2],"colorPrimary":[1,"color-primary"],"colorPrimaryTint":[1,"color-primary-tint"],"colorTrekLine":[1,"color-trek-line"],"colorDepartureIcon":[1,"color-departure-icon"],"colorArrivalIcon":[1,"color-arrival-icon"],"colorSensitiveArea":[1,"color-sensitive-area"],"colorPoiIcon":[1,"color-poi-icon"],"mapIsReady":[32]}],[1,"grw-trek-provider",{"language":[1],"api":[1],"trekId":[1,"trek-id"]}],[1,"grw-treks-provider",{"language":[1],"api":[1],"inBbox":[1,"in-bbox"],"cities":[1],"districts":[1],"structures":[1],"themes":[1],"portals":[1],"routes":[1],"practices":[1]}]]],["grw-app",[[1,"grw-app",{"api":[1],"language":[1],"inBbox":[1,"in-bbox"],"cities":[1],"districts":[1],"structures":[1],"themes":[1],"portals":[1],"routes":[1],"practices":[1],"urlLayer":[1,"url-layer"],"center":[1],"zoom":[8],"attribution":[1],"colorPrimary":[1,"color-primary"],"colorPrimaryShade":[1,"color-primary-shade"],"colorPrimaryTint":[1,"color-primary-tint"],"colorTrekLine":[1,"color-trek-line"],"colorDepartureIcon":[1,"color-departure-icon"],"colorArrivalIcon":[1,"color-arrival-icon"],"colorSensitiveArea":[1,"color-sensitive-area"],"colorPoiIcon":[1,"color-poi-icon"],"showTrek":[32],"showTreksMap":[32],"showTrekMap":[32],"showFilters":[32],"isLargeView":[32],"currentTrekId":[32]},[[0,"trekCardPress","onTrekCardPress"],[9,"resize","onWindowResize"]]]]]], options);
|
|
14
14
|
});
|
|
15
15
|
};
|
|
16
16
|
|
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
import { a as getRenderingRef, f as forceUpdate } from './index-192d910f.js';
|
|
2
|
+
|
|
3
|
+
const appendToMap = (map, propName, value) => {
|
|
4
|
+
const items = map.get(propName);
|
|
5
|
+
if (!items) {
|
|
6
|
+
map.set(propName, [value]);
|
|
7
|
+
}
|
|
8
|
+
else if (!items.includes(value)) {
|
|
9
|
+
items.push(value);
|
|
10
|
+
}
|
|
11
|
+
};
|
|
12
|
+
const debounce = (fn, ms) => {
|
|
13
|
+
let timeoutId;
|
|
14
|
+
return (...args) => {
|
|
15
|
+
if (timeoutId) {
|
|
16
|
+
clearTimeout(timeoutId);
|
|
17
|
+
}
|
|
18
|
+
timeoutId = setTimeout(() => {
|
|
19
|
+
timeoutId = 0;
|
|
20
|
+
fn(...args);
|
|
21
|
+
}, ms);
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Check if a possible element isConnected.
|
|
27
|
+
* The property might not be there, so we check for it.
|
|
28
|
+
*
|
|
29
|
+
* We want it to return true if isConnected is not a property,
|
|
30
|
+
* otherwise we would remove these elements and would not update.
|
|
31
|
+
*
|
|
32
|
+
* Better leak in Edge than to be useless.
|
|
33
|
+
*/
|
|
34
|
+
const isConnected = (maybeElement) => !('isConnected' in maybeElement) || maybeElement.isConnected;
|
|
35
|
+
const cleanupElements = debounce((map) => {
|
|
36
|
+
for (let key of map.keys()) {
|
|
37
|
+
map.set(key, map.get(key).filter(isConnected));
|
|
38
|
+
}
|
|
39
|
+
}, 2000);
|
|
40
|
+
const stencilSubscription = () => {
|
|
41
|
+
if (typeof getRenderingRef !== 'function') {
|
|
42
|
+
// If we are not in a stencil project, we do nothing.
|
|
43
|
+
// This function is not really exported by @stencil/core.
|
|
44
|
+
return {};
|
|
45
|
+
}
|
|
46
|
+
const elmsToUpdate = new Map();
|
|
47
|
+
return {
|
|
48
|
+
dispose: () => elmsToUpdate.clear(),
|
|
49
|
+
get: (propName) => {
|
|
50
|
+
const elm = getRenderingRef();
|
|
51
|
+
if (elm) {
|
|
52
|
+
appendToMap(elmsToUpdate, propName, elm);
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
set: (propName) => {
|
|
56
|
+
const elements = elmsToUpdate.get(propName);
|
|
57
|
+
if (elements) {
|
|
58
|
+
elmsToUpdate.set(propName, elements.filter(forceUpdate));
|
|
59
|
+
}
|
|
60
|
+
cleanupElements(elmsToUpdate);
|
|
61
|
+
},
|
|
62
|
+
reset: () => {
|
|
63
|
+
elmsToUpdate.forEach((elms) => elms.forEach(forceUpdate));
|
|
64
|
+
cleanupElements(elmsToUpdate);
|
|
65
|
+
},
|
|
66
|
+
};
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
const createObservableMap = (defaultState, shouldUpdate = (a, b) => a !== b) => {
|
|
70
|
+
let states = new Map(Object.entries(defaultState !== null && defaultState !== void 0 ? defaultState : {}));
|
|
71
|
+
const handlers = {
|
|
72
|
+
dispose: [],
|
|
73
|
+
get: [],
|
|
74
|
+
set: [],
|
|
75
|
+
reset: [],
|
|
76
|
+
};
|
|
77
|
+
const reset = () => {
|
|
78
|
+
states = new Map(Object.entries(defaultState !== null && defaultState !== void 0 ? defaultState : {}));
|
|
79
|
+
handlers.reset.forEach((cb) => cb());
|
|
80
|
+
};
|
|
81
|
+
const dispose = () => {
|
|
82
|
+
// Call first dispose as resetting the state would
|
|
83
|
+
// cause less updates ;)
|
|
84
|
+
handlers.dispose.forEach((cb) => cb());
|
|
85
|
+
reset();
|
|
86
|
+
};
|
|
87
|
+
const get = (propName) => {
|
|
88
|
+
handlers.get.forEach((cb) => cb(propName));
|
|
89
|
+
return states.get(propName);
|
|
90
|
+
};
|
|
91
|
+
const set = (propName, value) => {
|
|
92
|
+
const oldValue = states.get(propName);
|
|
93
|
+
if (shouldUpdate(value, oldValue, propName)) {
|
|
94
|
+
states.set(propName, value);
|
|
95
|
+
handlers.set.forEach((cb) => cb(propName, value, oldValue));
|
|
96
|
+
}
|
|
97
|
+
};
|
|
98
|
+
const state = (typeof Proxy === 'undefined'
|
|
99
|
+
? {}
|
|
100
|
+
: new Proxy(defaultState, {
|
|
101
|
+
get(_, propName) {
|
|
102
|
+
return get(propName);
|
|
103
|
+
},
|
|
104
|
+
ownKeys(_) {
|
|
105
|
+
return Array.from(states.keys());
|
|
106
|
+
},
|
|
107
|
+
getOwnPropertyDescriptor() {
|
|
108
|
+
return {
|
|
109
|
+
enumerable: true,
|
|
110
|
+
configurable: true,
|
|
111
|
+
};
|
|
112
|
+
},
|
|
113
|
+
has(_, propName) {
|
|
114
|
+
return states.has(propName);
|
|
115
|
+
},
|
|
116
|
+
set(_, propName, value) {
|
|
117
|
+
set(propName, value);
|
|
118
|
+
return true;
|
|
119
|
+
},
|
|
120
|
+
}));
|
|
121
|
+
const on = (eventName, callback) => {
|
|
122
|
+
handlers[eventName].push(callback);
|
|
123
|
+
return () => {
|
|
124
|
+
removeFromArray(handlers[eventName], callback);
|
|
125
|
+
};
|
|
126
|
+
};
|
|
127
|
+
const onChange = (propName, cb) => {
|
|
128
|
+
const unSet = on('set', (key, newValue) => {
|
|
129
|
+
if (key === propName) {
|
|
130
|
+
cb(newValue);
|
|
131
|
+
}
|
|
132
|
+
});
|
|
133
|
+
const unReset = on('reset', () => cb(defaultState[propName]));
|
|
134
|
+
return () => {
|
|
135
|
+
unSet();
|
|
136
|
+
unReset();
|
|
137
|
+
};
|
|
138
|
+
};
|
|
139
|
+
const use = (...subscriptions) => {
|
|
140
|
+
const unsubs = subscriptions.reduce((unsubs, subscription) => {
|
|
141
|
+
if (subscription.set) {
|
|
142
|
+
unsubs.push(on('set', subscription.set));
|
|
143
|
+
}
|
|
144
|
+
if (subscription.get) {
|
|
145
|
+
unsubs.push(on('get', subscription.get));
|
|
146
|
+
}
|
|
147
|
+
if (subscription.reset) {
|
|
148
|
+
unsubs.push(on('reset', subscription.reset));
|
|
149
|
+
}
|
|
150
|
+
if (subscription.dispose) {
|
|
151
|
+
unsubs.push(on('dispose', subscription.dispose));
|
|
152
|
+
}
|
|
153
|
+
return unsubs;
|
|
154
|
+
}, []);
|
|
155
|
+
return () => unsubs.forEach((unsub) => unsub());
|
|
156
|
+
};
|
|
157
|
+
const forceUpdate = (key) => {
|
|
158
|
+
const oldValue = states.get(key);
|
|
159
|
+
handlers.set.forEach((cb) => cb(key, oldValue, oldValue));
|
|
160
|
+
};
|
|
161
|
+
return {
|
|
162
|
+
state,
|
|
163
|
+
get,
|
|
164
|
+
set,
|
|
165
|
+
on,
|
|
166
|
+
onChange,
|
|
167
|
+
use,
|
|
168
|
+
dispose,
|
|
169
|
+
reset,
|
|
170
|
+
forceUpdate,
|
|
171
|
+
};
|
|
172
|
+
};
|
|
173
|
+
const removeFromArray = (array, item) => {
|
|
174
|
+
const index = array.indexOf(item);
|
|
175
|
+
if (index >= 0) {
|
|
176
|
+
array[index] = array[array.length - 1];
|
|
177
|
+
array.length--;
|
|
178
|
+
}
|
|
179
|
+
};
|
|
180
|
+
|
|
181
|
+
const createStore = (defaultState, shouldUpdate) => {
|
|
182
|
+
const map = createObservableMap(defaultState, shouldUpdate);
|
|
183
|
+
map.use(stencilSubscription());
|
|
184
|
+
return map;
|
|
185
|
+
};
|
|
186
|
+
|
|
187
|
+
const { state, onChange } = createStore({
|
|
188
|
+
api: '',
|
|
189
|
+
treks: [],
|
|
190
|
+
currentTreks: [],
|
|
191
|
+
treksWithinBounds: [],
|
|
192
|
+
currentMapTreksBounds: null,
|
|
193
|
+
difficulties: [],
|
|
194
|
+
routes: [],
|
|
195
|
+
practices: [],
|
|
196
|
+
themes: [],
|
|
197
|
+
durations: [],
|
|
198
|
+
currentSensitiveAreas: null,
|
|
199
|
+
labels: null,
|
|
200
|
+
sources: null,
|
|
201
|
+
accessibilities: null,
|
|
202
|
+
accessibilitiesLevel: null,
|
|
203
|
+
currentTrek: null,
|
|
204
|
+
currentPois: null,
|
|
205
|
+
currentInformationDesks: null,
|
|
206
|
+
});
|
|
207
|
+
|
|
208
|
+
export { onChange as o, state as s };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{p as r,b as o}from"./p-
|
|
1
|
+
import{p as r,b as o}from"./p-6dce5e6c.js";(()=>{const o=import.meta.url,e={};return""!==o&&(e.resourcesUrl=new URL(".",o).href),r(e)})().then((r=>o([["p-1b2ba86d",[[1,"grw-trek-card",{trek:[16],colorPrimary:[1,"color-primary"],colorPrimaryTint:[1,"color-primary-tint"],isLargeView:[4,"is-large-view"],currentTrek:[32],difficulty:[32],route:[32],practice:[32],themes:[32]}]]],["p-7715153d",[[1,"grw-information-desk-detail",{informationDesk:[16]}],[1,"grw-poi-detail",{poi:[16]}],[1,"grw-sensitive-area-detail",{sensitiveArea:[16]}]]],["p-6716c635",[[1,"grw-trek-detail",{trek:[16],colorPrimary:[1,"color-primary"],colorPrimaryShade:[1,"color-primary-shade"],colorPrimaryTint:[1,"color-primary-tint"],difficulty:[32],route:[32],practice:[32],themes:[32],labels:[32],sources:[32],accessibilities:[32],accessibilityLevel:[32],currentTrek:[32]}],[1,"grw-treks-list",{colorPrimary:[1,"color-primary"],colorPrimaryTint:[1,"color-primary-tint"],isLargeView:[4,"is-large-view"],treksToDisplay:[32]}],[1,"grw-filter",{filterType:[1,"filter-type"],filterName:[1,"filter-name"],filterNameProperty:[1,"filter-name-property"]}],[0,"grw-map",{urlLayer:[1,"url-layer"],attribution:[1],center:[1],zoom:[2],colorPrimary:[1,"color-primary"],colorPrimaryTint:[1,"color-primary-tint"],colorTrekLine:[1,"color-trek-line"],colorDepartureIcon:[1,"color-departure-icon"],colorArrivalIcon:[1,"color-arrival-icon"],colorSensitiveArea:[1,"color-sensitive-area"],colorPoiIcon:[1,"color-poi-icon"],mapIsReady:[32]}],[1,"grw-trek-provider",{language:[1],api:[1],trekId:[1,"trek-id"]}],[1,"grw-treks-provider",{language:[1],api:[1],inBbox:[1,"in-bbox"],cities:[1],districts:[1],structures:[1],themes:[1],portals:[1],routes:[1],practices:[1]}]]],["p-5f17d340",[[1,"grw-app",{api:[1],language:[1],inBbox:[1,"in-bbox"],cities:[1],districts:[1],structures:[1],themes:[1],portals:[1],routes:[1],practices:[1],urlLayer:[1,"url-layer"],center:[1],zoom:[8],attribution:[1],colorPrimary:[1,"color-primary"],colorPrimaryShade:[1,"color-primary-shade"],colorPrimaryTint:[1,"color-primary-tint"],colorTrekLine:[1,"color-trek-line"],colorDepartureIcon:[1,"color-departure-icon"],colorArrivalIcon:[1,"color-arrival-icon"],colorSensitiveArea:[1,"color-sensitive-area"],colorPoiIcon:[1,"color-poi-icon"],showTrek:[32],showTreksMap:[32],showTrekMap:[32],showFilters:[32],isLargeView:[32],currentTrekId:[32]},[[0,"trekCardPress","onTrekCardPress"],[9,"resize","onWindowResize"]]]]]],r)));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as i,c as r,h as e,H as n}from"./p-6dce5e6c.js";import{s as t,o as a}from"./p-e6710c64.js";import{d as c,f as o,l as s,a as l,b as d,c as h}from"./p-f3f7d6be.js";const b=class{constructor(e){i(this,e),this.trekCardPress=r(this,"trekCardPress",7),this.colorPrimary="#6b0030",this.colorPrimaryTint="#974c6e",this.isLargeView=!1}componentWillLoad(){this.currentTrek=this.trek?this.trek:t.currentTrek,this.currentTrek&&(this.difficulty=t.difficulties.find((i=>i.id===this.currentTrek.difficulty)),this.route=t.routes.find((i=>i.id===this.currentTrek.route)),this.practice=t.practices.find((i=>i.id===this.currentTrek.practice)),this.themes=t.themes.filter((i=>this.currentTrek.themes.includes(i.id)))),a("currentTrek",(()=>{this.currentTrek=this.trek?this.trek:t.currentTrek,this.currentTrek&&(this.difficulty=t.difficulties.find((i=>i.id===this.currentTrek.difficulty)),this.route=t.routes.find((i=>i.id===this.currentTrek.route)),this.practice=t.practices.find((i=>i.id===this.currentTrek.practice)),this.themes=t.themes.filter((i=>this.currentTrek.themes.includes(i.id))))}))}render(){var i,r,t,a,b,v,g,u;return e(n,{onClick:()=>this.trekCardPress.emit(this.currentTrek.id),style:{width:this.isLargeView?"100%":"auto","--color-primary":this.colorPrimary,"--color-primary-tint":this.colorPrimaryTint}},this.currentTrek&&e("div",{class:this.isLargeView?"trek-card-large-view-container":"trek-card-container"},this.currentTrek.attachments&&this.currentTrek.attachments[0]&&this.currentTrek.attachments[0].thumbnail&&e("img",{class:"image",src:`${this.currentTrek.attachments[0].thumbnail}`,loading:"lazy"}),e("div",{class:"sub-container"},e("div",{class:"departure"},null===(i=this.currentTrek)||void 0===i?void 0:i.departure),e("div",{class:"name"},null===(r=this.currentTrek)||void 0===r?void 0:r.name),e("div",{class:"themes-container"},this.themes.map((i=>e("div",{class:"theme"},i.label)))),e("div",{class:"icons-labels-container"},e("div",{class:"row"},e("div",{class:"icon-label difficulty"},(null===(t=this.difficulty)||void 0===t?void 0:t.pictogram)&&e("img",{src:this.difficulty.pictogram}),null===(a=this.difficulty)||void 0===a?void 0:a.label),e("div",{class:"icon-label duration"},e("div",{class:"svg-icon",innerHTML:c}),o(this.currentTrek.duration))),e("div",{class:"row"},e("div",{class:"icon-label length"},e("div",{class:"svg-icon",innerHTML:s}),l(this.currentTrek.length_2d)),e("div",{class:"icon-label ascent"},e("div",{class:"svg-icon",innerHTML:d}),h(this.currentTrek.ascent))),e("div",{class:"row"},e("div",{class:"icon-label route"},(null===(b=this.route)||void 0===b?void 0:b.pictogram)&&e("img",{src:this.route.pictogram}),null===(v=this.route)||void 0===v?void 0:v.route),e("div",{class:"icon-label practice"},(null===(g=this.practice)||void 0===g?void 0:g.pictogram)&&e("img",{src:this.practice.pictogram}),null===(u=this.practice)||void 0===u?void 0:u.name))))))}};b.style='.trek-card-container,.trek-card-large-view-container{font-family:"Roboto";border-radius:8px;box-shadow:4px 8px 24px rgba(0, 0, 0, 0.25);cursor:pointer}.trek-card-container .image,.trek-card-large-view-container .image{object-fit:cover}.trek-card-container .sub-container,.trek-card-large-view-container .sub-container{display:flex;flex-direction:column;justify-content:center;padding:12px}.trek-card-container .sub-container .name,.trek-card-large-view-container .sub-container .name{color:var(--color-primary);font-size:24px;font-weight:bold;margin-bottom:8px}.trek-card-container .sub-container .departure,.trek-card-large-view-container .sub-container .departure{color:rgba(0, 0, 0, 0.7);font-size:16px;margin:4px 0px}.trek-card-container .sub-container .themes-container,.trek-card-large-view-container .sub-container .themes-container{display:flex;justify-content:flex-start;align-items:center;flex-wrap:wrap}.trek-card-container .sub-container .themes-container .theme,.trek-card-large-view-container .sub-container .themes-container .theme{background-color:var(--color-primary-tint);color:#ffffff;border-radius:8px;padding:8px;margin:0px 8px 8px 0px}.trek-card-container .sub-container .icons-labels-container,.trek-card-large-view-container .sub-container .icons-labels-container{display:flex;justify-content:flex-start;align-items:center;flex-wrap:wrap}.trek-card-container .sub-container .icons-labels-container .row,.trek-card-large-view-container .sub-container .icons-labels-container .row{display:flex;justify-content:space-between;align-items:center;width:100%}.trek-card-container .sub-container .icons-labels-container .row:not(:last-child),.trek-card-large-view-container .sub-container .icons-labels-container .row:not(:last-child){margin-bottom:12px}.trek-card-container .sub-container .icons-labels-container .row .icon-label,.trek-card-large-view-container .sub-container .icons-labels-container .row .icon-label{display:flex;align-items:center;width:50%}.trek-card-container .sub-container .icons-labels-container .row .icon-label:nth-child(2),.trek-card-large-view-container .sub-container .icons-labels-container .row .icon-label:nth-child(2){margin:0px 4px}.trek-card-container .sub-container .icons-labels-container .row .icon-label img,.trek-card-container .sub-container .icons-labels-container .row .icon-label .svg-icon svg,.trek-card-large-view-container .sub-container .icons-labels-container .row .icon-label img,.trek-card-large-view-container .sub-container .icons-labels-container .row .icon-label .svg-icon svg{width:24px;height:auto;margin-right:8px}.trek-card-container .sub-container .icons-labels-container .row .practice img,.trek-card-large-view-container .sub-container .icons-labels-container .row .practice img{background-color:var(--color-primary)}.trek-card-container{width:350px;height:auto}.trek-card-container .image{width:100%}.trek-card-large-view-container{height:auto;display:flex;flex-direction:row}.trek-card-large-view-container .image{width:250px}';export{b as grw_trek_card}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as i,h as t,H as e,g as r}from"./p-6dce5e6c.js";import{s as o}from"./p-e6710c64.js";const a=class{constructor(t){i(this,t),this.showTrek=!1,this.showTreksMap=!1,this.showTrekMap=!1,this.showFilters=!1,this.isLargeView=!1,this.language="fr",this.colorPrimary="#6b0030",this.colorPrimaryShade="#4a0021",this.colorPrimaryTint="#974c6e",this.colorTrekLine="#6b0030",this.colorDepartureIcon="#006b3b",this.colorArrivalIcon="#85003b",this.colorSensitiveArea="#4974a5",this.colorPoiIcon="#974c6e",this.handlePopStateBind=this.handlePopState.bind(this),this.largeViewSize=1024}onTrekCardPress(i){this.currentTrekId=i.detail,this.showTrek=!this.showTrek;const t=new URL(window.location.toString());t.searchParams.set("trek",this.currentTrekId.toString()),window.history.pushState({},"",t)}onWindowResize(){this.handleView()}watchPropHandler(){window.dispatchEvent(new window.Event("resize"))}componentDidLoad(){this.handleView(),window.addEventListener("popstate",this.handlePopStateBind,!1);const i=new URL(window.location.toString()),t=i.searchParams.get("trek");t&&(window.history.replaceState({isInitialHistoryWithTrek:!0},"",i),this.currentTrekId=Number(t),this.showTrek=!this.showTrek)}onTrekDetailsClose(){this.currentTrekId=null,this.showTrek=!this.showTrek}handleView(){this.isLargeView=this.element.getBoundingClientRect().width>=this.largeViewSize,this.showTreksMap=this.isLargeView,this.showTrekMap=this.isLargeView}handleFilters(){this.showFilters=!this.showFilters}handleBackButton(){if(window.history.state.isInitialHistoryWithTrek){this.onTrekDetailsClose();const i=new URL(window.location.toString());i.searchParams.delete("trek"),window.history.pushState({},"",i)}else window.history.back()}handlePopState(){const i=new URL(window.location.toString()).searchParams.get("trek");i?(this.currentTrekId=Number(i),this.showTrek=!this.showTrek):this.onTrekDetailsClose()}handleShowMap(){this.currentTrekId?this.showTrekMap=!this.showTrekMap:this.showTreksMap=!this.showTreksMap}disconnectedCallback(){window.removeEventListener("popstate",this.handlePopStateBind)}render(){return t(e,{style:{"--color-primary":this.colorPrimary,"--color-primary-tint":this.colorPrimaryTint,"--color-primary-shade":this.colorPrimaryShade}},t("grw-treks-provider",{api:this.api,language:this.language,"in-bbox":this.inBbox,cities:this.cities,districts:this.districts,structures:this.structures,themes:this.themes,portals:this.portals,routes:this.routes,practices:this.practices}),this.showTrek&&this.currentTrekId&&t("grw-trek-provider",{api:o.api,language:this.language,"trek-id":this.currentTrekId}),t("div",{class:"app-container"},t("div",{class:this.isLargeView?"large-view-header-container":"header-container"},this.showTrek?t("div",{onClick:()=>this.handleBackButton(),class:"arrow-back-icon",innerHTML:'<svg xmlns="http://www.w3.org/2000/svg" width="512" height="512" viewBox="0 0 512 512"><polyline points="244 400 100 256 244 112" style="fill:none;stroke:#ffffff;stroke-linecap:round;stroke-linejoin:round;stroke-width:48px"/><line x1="120" y1="256" x2="412" y2="256" style="fill:none;stroke:#ffffff;stroke-linecap:round;stroke-linejoin:round;stroke-width:48px"/></svg>'}):t("div",{onClick:()=>this.handleFilters(),class:"handle-filters-button"},"FILTRER"),!this.showTrek&&this.showFilters&&t("div",{class:"options-container"},t("div",{class:"filters-container"},t("div",{class:"current-treks-length"},`${o.currentTreks.length} résultat${o.currentTreks.length>1?"s":""}`),t("div",{onClick:()=>this.handleFilters(),class:"close-filters-button"},"X"),t("div",null,t("grw-filter",{filterName:"Pratique",filterType:"practices",filterNameProperty:"name"})),t("div",{class:"filter-margin-top"},t("grw-filter",{filterName:"Difficulté",filterType:"difficulties",filterNameProperty:"label"})),t("div",{class:"filter-margin-top"},t("grw-filter",{filterName:"Durée",filterType:"durations",filterNameProperty:"name"}))),t("div",{onClick:()=>this.handleFilters(),class:"back-filters-container"})),t("div",{class:"attribution-container"},t("a",{target:"_blank",href:"https://geotrek.fr"},"GEOTREK"))),t("div",{class:"content-container"},t("div",{class:this.isLargeView?"large-view-app-treks-list-container":"app-treks-list-container",style:{display:this.showTrek?"none":"flex",position:this.showTrek?"absolute":"relative"}},t("grw-treks-list",{"is-large-view":this.isLargeView,"color-primary":this.colorPrimary,"color-primary-tint":this.colorPrimaryTint})),this.showTrek&&!o.currentTrek&&t("div",{class:this.isLargeView?"large-view-loader-container":"loader-container"},t("span",{class:"loader"})),o.currentTrek&&t("div",{class:this.isLargeView?"large-view-app-trek-detail-container":"app-trek-detail-container"},t("grw-trek-detail",{"color-primary":this.colorPrimary,"color-primary-shade":this.colorPrimaryShade,"color-primary-tint":this.colorPrimaryTint})),t("grw-map",{class:this.isLargeView?"large-view-app-map-container":"app-map-container",style:{visibility:this.showTreksMap&&!this.showTrek||this.showTrekMap&&this.showTrek?"visible":"hidden"},"url-layer":this.urlLayer,center:this.center,zoom:this.zoom,attribution:this.attribution,"color-primary":this.colorPrimary,"color-primary-tint":this.colorPrimaryTint,"color-trek-line":this.colorTrekLine,"color-departure-icon":this.colorDepartureIcon,"color-arrival-icon":this.colorArrivalIcon,"color-sensitive-area":this.colorSensitiveArea,"color-poi-icon":this.colorPoiIcon})),t("div",{class:"map-visibility-button",style:{display:this.isLargeView?"none":"flex"}},t("div",{onClick:()=>this.handleShowMap()},this.showTreksMap||this.showTrekMap?this.showTrek?"Voir la fiche":"Voir la liste":"Voir la carte"))))}get element(){return r(this)}static get watchers(){return{isLargeView:["watchPropHandler"]}}};a.style='.app-container{position:relative;height:100%;max-height:100vh;font-family:"Roboto"}.header-container,.large-view-header-container{display:flex;align-items:center;background-color:var(--color-primary);height:64px}.header-container .arrow-back-icon,.large-view-header-container .arrow-back-icon{width:48px;height:auto;margin-left:24px}.header-container .arrow-back-icon svg,.large-view-header-container .arrow-back-icon svg{cursor:pointer;width:48px;height:auto}.header-container .handle-filters-button,.large-view-header-container .handle-filters-button{user-select:none;cursor:pointer;color:var(--color-primary);background-color:#ffffff;margin-left:36px;border-radius:8px;padding:8px}.header-container .attribution-container,.large-view-header-container .attribution-container{position:absolute;right:24px}.header-container .attribution-container a,.large-view-header-container .attribution-container a{color:#ffffff;text-decoration:none}.options-container{height:calc(100% - 64px);position:absolute;width:100%;z-index:1100;top:64px}.filters-container{position:absolute;width:100%;background-color:#ffffff;padding:36px 0px;z-index:1100}.filters-container .close-filters-button{cursor:pointer;font-weight:bold;position:absolute;top:12px;right:12px;padding:12px;border-radius:12px;color:var(--color-primary);border:1px var(--color-primary) solid}.filters-container .close-filters-button:hover{background-color:var(--color-primary);color:#ffffff}.filters-container .filter-margin-top{margin-top:24px}.filters-container .current-treks-length{margin:0px 0px 32px 8px;color:var(--color-primary);font-size:24px;font-weight:bold}.back-filters-container{background-color:rgba(0, 0, 0, 0.5);width:100%;height:calc(100% - 64px);position:absolute;z-index:1099;top:64px}.loader-container,.large-view-loader-container{display:flex;justify-content:center;align-items:center;height:100%}.loader-container .loader,.large-view-loader-container .loader{width:48px;height:48px;border:5px solid var(--color-primary-tint);border-bottom-color:var(--color-primary);border-radius:50%;display:inline-block;box-sizing:border-box;animation:rotation 1s linear infinite}@keyframes rotation{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}.content-container{position:relative;display:flex;height:calc(100% - 64px)}.app-treks-list-container,.app-trek-detail-container,.large-view-app-treks-list-container,.large-view-app-trek-detail-container{height:100%}.app-map-container,.large-view-app-map-container{width:100%;height:100%}.map-visibility-button{cursor:pointer;display:flex;justify-content:center;align-items:center;position:absolute;bottom:24px;width:100%;z-index:400;user-select:none}.map-visibility-button div{background-color:var(--color-primary);color:#ffffff;padding:12px;border-radius:24px;width:120px;text-align:center}.header-container .title{font-size:24px}.loader-container{position:absolute;width:100%}.app-treks-list-container,.app-trek-detail-container{width:100%}.app-map-container{position:relative;width:100%;position:absolute}.large-view-header-container .title{font-size:32px}.large-view-loader-container{position:relative;width:50%}.large-view-app-treks-list-container,.large-view-app-trek-detail-container{width:50%}.large-view-app-map-container{position:relative;width:50%}';export{a as grw_app}
|