@geotrekce/geotrek-rando-widget 0.0.2 → 0.0.5
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 +93 -0
- package/dist/cjs/{grw-app_7.cjs.entry.js → grw-filter_6.cjs.entry.js} +424 -384
- 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-972b8d2a.js +209 -0
- package/dist/collection/collection-manifest.json +4 -0
- package/dist/collection/components/grw-app/grw-app.css +70 -5
- package/dist/collection/components/grw-app/grw-app.js +139 -33
- 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 +31 -0
- package/dist/collection/components/grw-information-desk-detail/grw-information-desk-detail.js +53 -0
- package/dist/collection/components/grw-map/grw-map.css +99 -0
- package/dist/collection/components/grw-map/grw-map.js +315 -42
- package/dist/collection/components/grw-poi-detail/grw-poi-detail.css +31 -0
- package/dist/collection/components/grw-poi-detail/grw-poi-detail.js +41 -0
- package/dist/collection/components/grw-sensitive-area-detail/grw-sensitive-area-detail.css +39 -0
- package/dist/collection/components/grw-sensitive-area-detail/grw-sensitive-area-detail.js +52 -0
- package/dist/collection/components/grw-trek-card/grw-trek-card.css +67 -30
- package/dist/collection/components/grw-trek-card/grw-trek-card.js +37 -13
- package/dist/collection/components/grw-trek-detail/grw-trek-detail.css +160 -1
- package/dist/collection/components/grw-trek-detail/grw-trek-detail.js +123 -8
- package/dist/collection/components/grw-treks-list/grw-treks-list.css +17 -3
- package/dist/collection/components/grw-treks-list/grw-treks-list.js +29 -7
- package/dist/collection/store/grw-trek-provider.js +36 -8
- package/dist/collection/store/grw-treks-provider.js +16 -7
- package/dist/collection/store/store.js +10 -0
- package/dist/collection/stories/App.js +22 -16
- package/dist/collection/stories/App.stories.js +14 -9
- package/dist/collection/stories/TrekCard.js +2 -1
- package/dist/collection/stories/TrekCard.stories.js +4 -3
- package/dist/collection/stories/TrekDetail.js +3 -1
- package/dist/collection/stories/TrekDetail.stories.js +5 -3
- package/dist/collection/stories/TrekMap.js +6 -4
- package/dist/collection/stories/TrekMap.stories.js +10 -7
- package/dist/collection/stories/TreksList.js +10 -9
- package/dist/collection/stories/TreksList.stories.js +4 -3
- package/dist/collection/stories/TreksMap.stories.js +6 -5
- package/dist/collection/utils/utils.js +2 -2
- package/dist/components/grw-app.js +76 -11
- 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-detail.d.ts +11 -0
- package/dist/components/grw-information-desk-detail.js +6 -0
- package/dist/components/grw-information-desk-detail2.js +34 -0
- package/dist/components/grw-map2.js +263 -39
- package/dist/components/grw-poi-detail.d.ts +11 -0
- package/dist/components/grw-poi-detail.js +6 -0
- package/dist/components/grw-poi-detail2.js +32 -0
- package/dist/components/grw-sensitive-area-detail.d.ts +11 -0
- package/dist/components/grw-sensitive-area-detail.js +6 -0
- package/dist/components/grw-sensitive-area-detail2.js +37 -0
- package/dist/components/grw-trek-card2.js +11 -6
- package/dist/components/grw-trek-detail2.js +40 -7
- package/dist/components/grw-trek-provider2.js +36 -8
- package/dist/components/grw-treks-list2.js +10 -7
- package/dist/components/grw-treks-provider2.js +16 -7
- package/dist/components/length.js +2 -2
- package/dist/components/store.js +10 -0
- package/dist/esm/geotrek-rando-widget.js +2 -2
- package/dist/esm/grw-app.entry.js +89 -0
- package/dist/esm/{grw-app_7.entry.js → grw-filter_6.entry.js} +398 -357
- 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-5a42b5d8.js +206 -0
- package/dist/geotrek-rando-widget/geotrek-rando-widget.css +1 -1
- package/dist/geotrek-rando-widget/geotrek-rando-widget.esm.js +1 -1
- package/dist/geotrek-rando-widget/p-206a52d9.entry.js +1 -0
- package/dist/geotrek-rando-widget/p-2d9ae918.entry.js +1 -0
- package/dist/geotrek-rando-widget/p-6dce5e6c.js +2 -0
- package/dist/geotrek-rando-widget/p-8cfa03c0.entry.js +1 -0
- package/dist/geotrek-rando-widget/p-d3aa9819.entry.js +1 -0
- package/dist/geotrek-rando-widget/p-e63213a9.js +1 -0
- package/dist/geotrek-rando-widget/p-f3f7d6be.js +1 -0
- package/dist/types/components/grw-app/grw-app.d.ts +13 -2
- package/dist/types/components/grw-filter/grw-filter.d.ts +9 -0
- package/dist/types/components/grw-information-desk-detail/grw-information-desk-detail.d.ts +5 -0
- package/dist/types/components/grw-map/grw-map.d.ts +14 -4
- package/dist/types/components/grw-poi-detail/grw-poi-detail.d.ts +5 -0
- package/dist/types/components/grw-sensitive-area-detail/grw-sensitive-area-detail.d.ts +5 -0
- 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 +10 -4
- package/dist/types/components/grw-treks-list/grw-treks-list.d.ts +1 -0
- package/dist/types/components.d.ts +88 -3
- package/dist/types/store/store.d.ts +21 -1
- package/dist/types/types/types.d.ts +119 -3
- package/package.json +9 -10
- package/readme.md +19 -1
- package/dist/geotrek-rando-widget/p-332ba9ab.js +0 -2
- package/dist/geotrek-rando-widget/p-b7c66d2d.entry.js +0 -1
|
@@ -4,19 +4,28 @@ import arrowBackImage from '../../assets/arrow-back.svg';
|
|
|
4
4
|
export class GrwApp {
|
|
5
5
|
constructor() {
|
|
6
6
|
this.showTrek = false;
|
|
7
|
-
this.
|
|
7
|
+
this.showTreksMap = false;
|
|
8
|
+
this.showTrekMap = false;
|
|
9
|
+
this.showFilters = false;
|
|
8
10
|
this.isLargeView = false;
|
|
9
|
-
this.
|
|
11
|
+
this.language = 'fr';
|
|
10
12
|
this.colorPrimary = '#6b0030';
|
|
11
|
-
this.
|
|
13
|
+
this.colorPrimaryShade = '#4a0021';
|
|
14
|
+
this.colorPrimaryTint = '#974c6e';
|
|
12
15
|
this.colorTrekLine = '#6b0030';
|
|
13
16
|
this.colorDepartureIcon = '#006b3b';
|
|
14
17
|
this.colorArrivalIcon = '#85003b';
|
|
15
|
-
this.
|
|
18
|
+
this.colorSensitiveArea = '#4974a5';
|
|
19
|
+
this.colorPoiIcon = '#974c6e';
|
|
20
|
+
this.handlePopStateBind = this.handlePopState.bind(this);
|
|
21
|
+
this.largeViewSize = 1024;
|
|
16
22
|
}
|
|
17
23
|
onTrekCardPress(event) {
|
|
18
24
|
this.currentTrekId = event.detail;
|
|
19
25
|
this.showTrek = !this.showTrek;
|
|
26
|
+
const url = new URL(window.location.toString());
|
|
27
|
+
url.searchParams.set('trek', this.currentTrekId.toString());
|
|
28
|
+
window.history.pushState({}, '', url);
|
|
20
29
|
}
|
|
21
30
|
onWindowResize() {
|
|
22
31
|
this.handleView();
|
|
@@ -26,31 +35,72 @@ export class GrwApp {
|
|
|
26
35
|
}
|
|
27
36
|
componentDidLoad() {
|
|
28
37
|
this.handleView();
|
|
38
|
+
window.addEventListener('popstate', this.handlePopStateBind, false);
|
|
29
39
|
}
|
|
30
40
|
onTrekDetailsClose() {
|
|
41
|
+
this.forwardTrekId = this.currentTrekId;
|
|
31
42
|
this.currentTrekId = null;
|
|
32
43
|
this.showTrek = !this.showTrek;
|
|
33
44
|
}
|
|
34
45
|
handleView() {
|
|
35
46
|
this.isLargeView = this.element.getBoundingClientRect().width >= this.largeViewSize;
|
|
36
|
-
this.
|
|
47
|
+
this.showTreksMap = this.isLargeView;
|
|
48
|
+
this.showTrekMap = this.isLargeView;
|
|
49
|
+
}
|
|
50
|
+
handleFilters() {
|
|
51
|
+
this.showFilters = !this.showFilters;
|
|
52
|
+
}
|
|
53
|
+
handlePopState() {
|
|
54
|
+
if (this.showTrek) {
|
|
55
|
+
this.onTrekDetailsClose();
|
|
56
|
+
}
|
|
57
|
+
else if (this.forwardTrekId) {
|
|
58
|
+
this.currentTrekId = this.forwardTrekId;
|
|
59
|
+
this.forwardTrekId = null;
|
|
60
|
+
this.showTrek = !this.showTrek;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
handleShowMap() {
|
|
64
|
+
if (this.currentTrekId) {
|
|
65
|
+
this.showTrekMap = !this.showTrekMap;
|
|
66
|
+
}
|
|
67
|
+
else {
|
|
68
|
+
this.showTreksMap = !this.showTreksMap;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
disconnectedCallback() {
|
|
72
|
+
window.removeEventListener('popstate', this.handlePopStateBind);
|
|
37
73
|
}
|
|
38
74
|
render() {
|
|
39
|
-
return (h(Host, { style: { '--color-primary': this.colorPrimary, '--color-primary-tint': this.colorPrimaryTint } },
|
|
40
|
-
h("grw-treks-provider", { api: this.api, "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 }),
|
|
41
|
-
this.showTrek && this.currentTrekId && h("grw-trek-provider", { api: state.api, "trek-id": this.currentTrekId }),
|
|
75
|
+
return (h(Host, { style: { '--color-primary': this.colorPrimary, '--color-primary-tint': this.colorPrimaryTint, '--color-primary-shade': this.colorPrimaryShade } },
|
|
76
|
+
h("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 }),
|
|
77
|
+
this.showTrek && this.currentTrekId && h("grw-trek-provider", { api: state.api, language: this.language, "trek-id": this.currentTrekId }),
|
|
42
78
|
h("div", { class: "app-container" },
|
|
43
|
-
h("div", { class: this.isLargeView ? 'large-view-header-container' : 'header-container' },
|
|
79
|
+
h("div", { class: this.isLargeView ? 'large-view-header-container' : 'header-container' },
|
|
80
|
+
this.showTrek ? (h("div", { onClick: () => window.history.back(), class: "arrow-back-icon", innerHTML: arrowBackImage })) : (h("div", { onClick: () => this.handleFilters(), class: "handle-filters-button" }, "FILTRER")),
|
|
81
|
+
!this.showTrek && this.showFilters && (h("div", { class: "options-container" },
|
|
82
|
+
h("div", { class: "filters-container" },
|
|
83
|
+
h("div", { class: "current-treks-length" }, `${state.currentTreks.length} résultat${state.currentTreks.length > 1 ? 's' : ''}`),
|
|
84
|
+
h("div", { onClick: () => this.handleFilters(), class: "close-filters-button" }, "X"),
|
|
85
|
+
h("div", null,
|
|
86
|
+
h("grw-filter", { filterName: "Pratique", filterType: "practices", filterNameProperty: "name" })),
|
|
87
|
+
h("div", { class: "filter-margin-top" },
|
|
88
|
+
h("grw-filter", { filterName: "Difficult\u00E9", filterType: "difficulties", filterNameProperty: "label" })),
|
|
89
|
+
h("div", { class: "filter-margin-top" },
|
|
90
|
+
h("grw-filter", { filterName: "Dur\u00E9e", filterType: "durations", filterNameProperty: "name" }))),
|
|
91
|
+
h("div", { onClick: () => this.handleFilters(), class: "back-filters-container" }))),
|
|
92
|
+
h("div", { class: "attribution-container" },
|
|
93
|
+
h("a", { target: "_blank", href: "https://geotrek.fr" }, "GEOTREK"))),
|
|
44
94
|
h("div", { class: "content-container" },
|
|
45
95
|
h("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' } },
|
|
46
|
-
h("grw-treks-list", { "color-primary": this.colorPrimary, "color-primary-tint": this.colorPrimaryTint })),
|
|
96
|
+
h("grw-treks-list", { "is-large-view": this.isLargeView, "color-primary": this.colorPrimary, "color-primary-tint": this.colorPrimaryTint })),
|
|
47
97
|
this.showTrek && !state.currentTrek && (h("div", { class: this.isLargeView ? 'large-view-loader-container' : 'loader-container' },
|
|
48
98
|
h("span", { class: "loader" }))),
|
|
49
99
|
state.currentTrek && (h("div", { class: this.isLargeView ? 'large-view-app-trek-detail-container' : 'app-trek-detail-container' },
|
|
50
|
-
h("grw-trek-detail", { "color-primary": this.colorPrimary, "color-primary-tint": this.colorPrimaryTint }))),
|
|
51
|
-
h("grw-map", { class: this.isLargeView ? 'large-view-app-map-container' : 'app-map-container', style: { visibility: this.
|
|
100
|
+
h("grw-trek-detail", { "color-primary": this.colorPrimary, "color-primary-shade": this.colorPrimaryShade, "color-primary-tint": this.colorPrimaryTint }))),
|
|
101
|
+
h("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 })),
|
|
52
102
|
h("div", { class: "map-visibility-button", style: { display: this.isLargeView ? 'none' : 'flex' } },
|
|
53
|
-
h("div", { onClick: () =>
|
|
103
|
+
h("div", { onClick: () => this.handleShowMap() }, this.showTreksMap || this.showTrekMap ? (this.showTrek ? 'Voir la fiche' : 'Voir la liste') : 'Voir la carte')))));
|
|
54
104
|
}
|
|
55
105
|
static get is() { return "grw-app"; }
|
|
56
106
|
static get encapsulation() { return "shadow"; }
|
|
@@ -78,6 +128,24 @@ export class GrwApp {
|
|
|
78
128
|
"attribute": "api",
|
|
79
129
|
"reflect": false
|
|
80
130
|
},
|
|
131
|
+
"language": {
|
|
132
|
+
"type": "string",
|
|
133
|
+
"mutable": false,
|
|
134
|
+
"complexType": {
|
|
135
|
+
"original": "string",
|
|
136
|
+
"resolved": "string",
|
|
137
|
+
"references": {}
|
|
138
|
+
},
|
|
139
|
+
"required": false,
|
|
140
|
+
"optional": false,
|
|
141
|
+
"docs": {
|
|
142
|
+
"tags": [],
|
|
143
|
+
"text": ""
|
|
144
|
+
},
|
|
145
|
+
"attribute": "language",
|
|
146
|
+
"reflect": false,
|
|
147
|
+
"defaultValue": "'fr'"
|
|
148
|
+
},
|
|
81
149
|
"inBbox": {
|
|
82
150
|
"type": "string",
|
|
83
151
|
"mutable": false,
|
|
@@ -214,24 +282,6 @@ export class GrwApp {
|
|
|
214
282
|
"attribute": "practices",
|
|
215
283
|
"reflect": false
|
|
216
284
|
},
|
|
217
|
-
"appName": {
|
|
218
|
-
"type": "string",
|
|
219
|
-
"mutable": false,
|
|
220
|
-
"complexType": {
|
|
221
|
-
"original": "string",
|
|
222
|
-
"resolved": "string",
|
|
223
|
-
"references": {}
|
|
224
|
-
},
|
|
225
|
-
"required": false,
|
|
226
|
-
"optional": false,
|
|
227
|
-
"docs": {
|
|
228
|
-
"tags": [],
|
|
229
|
-
"text": ""
|
|
230
|
-
},
|
|
231
|
-
"attribute": "app-name",
|
|
232
|
-
"reflect": false,
|
|
233
|
-
"defaultValue": "'Geotrek Rando Widget'"
|
|
234
|
-
},
|
|
235
285
|
"urlLayer": {
|
|
236
286
|
"type": "string",
|
|
237
287
|
"mutable": false,
|
|
@@ -318,6 +368,24 @@ export class GrwApp {
|
|
|
318
368
|
"reflect": false,
|
|
319
369
|
"defaultValue": "'#6b0030'"
|
|
320
370
|
},
|
|
371
|
+
"colorPrimaryShade": {
|
|
372
|
+
"type": "string",
|
|
373
|
+
"mutable": false,
|
|
374
|
+
"complexType": {
|
|
375
|
+
"original": "string",
|
|
376
|
+
"resolved": "string",
|
|
377
|
+
"references": {}
|
|
378
|
+
},
|
|
379
|
+
"required": false,
|
|
380
|
+
"optional": false,
|
|
381
|
+
"docs": {
|
|
382
|
+
"tags": [],
|
|
383
|
+
"text": ""
|
|
384
|
+
},
|
|
385
|
+
"attribute": "color-primary-shade",
|
|
386
|
+
"reflect": false,
|
|
387
|
+
"defaultValue": "'#4a0021'"
|
|
388
|
+
},
|
|
321
389
|
"colorPrimaryTint": {
|
|
322
390
|
"type": "string",
|
|
323
391
|
"mutable": false,
|
|
@@ -334,7 +402,7 @@ export class GrwApp {
|
|
|
334
402
|
},
|
|
335
403
|
"attribute": "color-primary-tint",
|
|
336
404
|
"reflect": false,
|
|
337
|
-
"defaultValue": "'#
|
|
405
|
+
"defaultValue": "'#974c6e'"
|
|
338
406
|
},
|
|
339
407
|
"colorTrekLine": {
|
|
340
408
|
"type": "string",
|
|
@@ -389,11 +457,49 @@ export class GrwApp {
|
|
|
389
457
|
"attribute": "color-arrival-icon",
|
|
390
458
|
"reflect": false,
|
|
391
459
|
"defaultValue": "'#85003b'"
|
|
460
|
+
},
|
|
461
|
+
"colorSensitiveArea": {
|
|
462
|
+
"type": "string",
|
|
463
|
+
"mutable": false,
|
|
464
|
+
"complexType": {
|
|
465
|
+
"original": "string",
|
|
466
|
+
"resolved": "string",
|
|
467
|
+
"references": {}
|
|
468
|
+
},
|
|
469
|
+
"required": false,
|
|
470
|
+
"optional": false,
|
|
471
|
+
"docs": {
|
|
472
|
+
"tags": [],
|
|
473
|
+
"text": ""
|
|
474
|
+
},
|
|
475
|
+
"attribute": "color-sensitive-area",
|
|
476
|
+
"reflect": false,
|
|
477
|
+
"defaultValue": "'#4974a5'"
|
|
478
|
+
},
|
|
479
|
+
"colorPoiIcon": {
|
|
480
|
+
"type": "string",
|
|
481
|
+
"mutable": false,
|
|
482
|
+
"complexType": {
|
|
483
|
+
"original": "string",
|
|
484
|
+
"resolved": "string",
|
|
485
|
+
"references": {}
|
|
486
|
+
},
|
|
487
|
+
"required": false,
|
|
488
|
+
"optional": false,
|
|
489
|
+
"docs": {
|
|
490
|
+
"tags": [],
|
|
491
|
+
"text": ""
|
|
492
|
+
},
|
|
493
|
+
"attribute": "color-poi-icon",
|
|
494
|
+
"reflect": false,
|
|
495
|
+
"defaultValue": "'#974c6e'"
|
|
392
496
|
}
|
|
393
497
|
}; }
|
|
394
498
|
static get states() { return {
|
|
395
499
|
"showTrek": {},
|
|
396
|
-
"
|
|
500
|
+
"showTreksMap": {},
|
|
501
|
+
"showTrekMap": {},
|
|
502
|
+
"showFilters": {},
|
|
397
503
|
"isLargeView": {},
|
|
398
504
|
"currentTrekId": {}
|
|
399
505
|
}; }
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
.filter-name {
|
|
2
|
+
margin-left: 8px;
|
|
3
|
+
color: var(--color-primary);
|
|
4
|
+
font-size: 24px;
|
|
5
|
+
font-weight: bold;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
.filter-button-container {
|
|
9
|
+
display: flex;
|
|
10
|
+
flex-direction: row;
|
|
11
|
+
flex-wrap: wrap;
|
|
12
|
+
}
|
|
13
|
+
.filter-button-container .filter-button,
|
|
14
|
+
.filter-button-container .selected-filter-button {
|
|
15
|
+
user-select: none;
|
|
16
|
+
cursor: pointer;
|
|
17
|
+
border: 1px var(--color-primary) solid;
|
|
18
|
+
border-radius: 8px;
|
|
19
|
+
margin: 8px 0px 0px 8px;
|
|
20
|
+
padding: 8px;
|
|
21
|
+
}
|
|
22
|
+
.filter-button-container .filter-button {
|
|
23
|
+
color: var(--color-primary);
|
|
24
|
+
background-color: #ffffff;
|
|
25
|
+
}
|
|
26
|
+
.filter-button-container .selected-filter-button {
|
|
27
|
+
color: #ffffff;
|
|
28
|
+
background-color: var(--color-primary);
|
|
29
|
+
}
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
import { Component, Host, h, Prop } from '@stencil/core';
|
|
2
|
+
import state from 'store/store';
|
|
3
|
+
export class GrwFilter {
|
|
4
|
+
constructor() {
|
|
5
|
+
this.filters = [
|
|
6
|
+
{ property: 'practices', trekProperty: 'practice', type: 'include' },
|
|
7
|
+
{ property: 'difficulties', trekProperty: 'difficulty', type: 'include' },
|
|
8
|
+
{ property: 'durations', trekProperty: 'duration', type: 'interval' },
|
|
9
|
+
];
|
|
10
|
+
}
|
|
11
|
+
handleFilter(_event, filterToHandle) {
|
|
12
|
+
const filterFromState = [...state[this.filterType]];
|
|
13
|
+
filterFromState.find(currentFilter => currentFilter.id === filterToHandle.id).selected = !filterFromState.find(currentFilter => currentFilter.id === filterToHandle.id)
|
|
14
|
+
.selected;
|
|
15
|
+
state[this.filterType] = filterFromState;
|
|
16
|
+
let isUsingFilter = false;
|
|
17
|
+
let filtersTreks = [];
|
|
18
|
+
for (const filter of this.filters) {
|
|
19
|
+
const currentFiltersId = state[filter.property].filter(currentFilter => currentFilter.selected).map(currentFilter => currentFilter.id);
|
|
20
|
+
if (currentFiltersId.length > 0) {
|
|
21
|
+
if (filtersTreks.length > 0) {
|
|
22
|
+
if (filter.type === 'include') {
|
|
23
|
+
filtersTreks = [...filtersTreks.filter(trek => currentFiltersId.includes(trek[filter.trekProperty]))];
|
|
24
|
+
}
|
|
25
|
+
else if (filter.type === 'interval') {
|
|
26
|
+
let minValue;
|
|
27
|
+
let maxValue;
|
|
28
|
+
for (const currentFilterId of currentFiltersId) {
|
|
29
|
+
const currentFilter = state[filter.property].find(property => property.id === currentFilterId);
|
|
30
|
+
if (isNaN(minValue) || currentFilter.minValue < minValue) {
|
|
31
|
+
minValue = currentFilter.minValue;
|
|
32
|
+
}
|
|
33
|
+
if (isNaN(maxValue) || currentFilter.maxValue > maxValue) {
|
|
34
|
+
maxValue = currentFilter.maxValue;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
filtersTreks = [...filtersTreks.filter(trek => trek[filter.trekProperty] >= minValue && trek[filter.trekProperty] <= maxValue)];
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
else {
|
|
41
|
+
if (!isUsingFilter) {
|
|
42
|
+
isUsingFilter = true;
|
|
43
|
+
}
|
|
44
|
+
if (filter.type === 'include') {
|
|
45
|
+
filtersTreks = [...state.treks.filter(trek => currentFiltersId.includes(trek[filter.trekProperty]))];
|
|
46
|
+
}
|
|
47
|
+
else if (filter.type === 'interval') {
|
|
48
|
+
let minValue;
|
|
49
|
+
let maxValue;
|
|
50
|
+
for (const currentFilterId of currentFiltersId) {
|
|
51
|
+
const currentFilter = state[filter.property].find(property => property.id === currentFilterId);
|
|
52
|
+
if (isNaN(minValue) || currentFilter.minValue < minValue) {
|
|
53
|
+
minValue = currentFilter.minValue;
|
|
54
|
+
}
|
|
55
|
+
if (isNaN(maxValue) || currentFilter.maxValue > maxValue) {
|
|
56
|
+
maxValue = currentFilter.maxValue;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
filtersTreks = [...state.treks.filter(trek => trek[filter.trekProperty] >= minValue && trek[filter.trekProperty] <= maxValue)];
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
state.currentTreks = isUsingFilter ? filtersTreks : state.treks;
|
|
65
|
+
}
|
|
66
|
+
render() {
|
|
67
|
+
return (h(Host, null,
|
|
68
|
+
h("div", { class: "filter-name" }, this.filterName),
|
|
69
|
+
h("div", { class: "filter-button-container" }, state[this.filterType].map(currentFilter => (h("div", { onClick: event => this.handleFilter(event, currentFilter), class: currentFilter.selected ? 'selected-filter-button' : 'filter-button' }, currentFilter[this.filterNameProperty]))))));
|
|
70
|
+
}
|
|
71
|
+
static get is() { return "grw-filter"; }
|
|
72
|
+
static get encapsulation() { return "shadow"; }
|
|
73
|
+
static get originalStyleUrls() { return {
|
|
74
|
+
"$": ["grw-filter.scss"]
|
|
75
|
+
}; }
|
|
76
|
+
static get styleUrls() { return {
|
|
77
|
+
"$": ["grw-filter.css"]
|
|
78
|
+
}; }
|
|
79
|
+
static get properties() { return {
|
|
80
|
+
"filterType": {
|
|
81
|
+
"type": "string",
|
|
82
|
+
"mutable": false,
|
|
83
|
+
"complexType": {
|
|
84
|
+
"original": "string",
|
|
85
|
+
"resolved": "string",
|
|
86
|
+
"references": {}
|
|
87
|
+
},
|
|
88
|
+
"required": false,
|
|
89
|
+
"optional": false,
|
|
90
|
+
"docs": {
|
|
91
|
+
"tags": [],
|
|
92
|
+
"text": ""
|
|
93
|
+
},
|
|
94
|
+
"attribute": "filter-type",
|
|
95
|
+
"reflect": false
|
|
96
|
+
},
|
|
97
|
+
"filterName": {
|
|
98
|
+
"type": "string",
|
|
99
|
+
"mutable": false,
|
|
100
|
+
"complexType": {
|
|
101
|
+
"original": "string",
|
|
102
|
+
"resolved": "string",
|
|
103
|
+
"references": {}
|
|
104
|
+
},
|
|
105
|
+
"required": false,
|
|
106
|
+
"optional": false,
|
|
107
|
+
"docs": {
|
|
108
|
+
"tags": [],
|
|
109
|
+
"text": ""
|
|
110
|
+
},
|
|
111
|
+
"attribute": "filter-name",
|
|
112
|
+
"reflect": false
|
|
113
|
+
},
|
|
114
|
+
"filterNameProperty": {
|
|
115
|
+
"type": "string",
|
|
116
|
+
"mutable": false,
|
|
117
|
+
"complexType": {
|
|
118
|
+
"original": "string",
|
|
119
|
+
"resolved": "string",
|
|
120
|
+
"references": {}
|
|
121
|
+
},
|
|
122
|
+
"required": false,
|
|
123
|
+
"optional": false,
|
|
124
|
+
"docs": {
|
|
125
|
+
"tags": [],
|
|
126
|
+
"text": ""
|
|
127
|
+
},
|
|
128
|
+
"attribute": "filter-name-property",
|
|
129
|
+
"reflect": false
|
|
130
|
+
}
|
|
131
|
+
}; }
|
|
132
|
+
}
|
package/dist/collection/components/grw-information-desk-detail/grw-information-desk-detail.css
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
:host {
|
|
2
|
+
display: flex;
|
|
3
|
+
flex-direction: column;
|
|
4
|
+
}
|
|
5
|
+
:host a {
|
|
6
|
+
color: var(--color-primary);
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.information-desk-img {
|
|
10
|
+
width: 180px;
|
|
11
|
+
}
|
|
12
|
+
.information-desk-img img {
|
|
13
|
+
width: 180px;
|
|
14
|
+
border-radius: 8px;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.information-desk-sub-container {
|
|
18
|
+
display: flex;
|
|
19
|
+
flex-direction: column;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.information-desk-name {
|
|
23
|
+
color: var(--color-primary);
|
|
24
|
+
font-size: 24px;
|
|
25
|
+
font-weight: bold;
|
|
26
|
+
padding: 12px 0px;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.information-desk-description {
|
|
30
|
+
font-size: 16px;
|
|
31
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { Component, Host, h, Prop } from '@stencil/core';
|
|
2
|
+
export class GrwInformationDeskDetail {
|
|
3
|
+
render() {
|
|
4
|
+
return (h(Host, null,
|
|
5
|
+
this.informationDesk.photo_url && (h("div", { class: "information-desk-img" },
|
|
6
|
+
h("img", { src: this.informationDesk.photo_url, loading: "lazy" }))),
|
|
7
|
+
h("div", { class: "information-desk-sub-container" },
|
|
8
|
+
this.informationDesk.name && h("div", { class: "information-desk-name" }, this.informationDesk.name),
|
|
9
|
+
this.informationDesk.description && h("div", { class: "information-desk-description", innerHTML: this.informationDesk.description }),
|
|
10
|
+
this.informationDesk.postal_code ||
|
|
11
|
+
this.informationDesk.municipality ||
|
|
12
|
+
(this.informationDesk.street && (h("div", null,
|
|
13
|
+
this.informationDesk.postal_code,
|
|
14
|
+
` ${this.informationDesk.municipality}`,
|
|
15
|
+
` ${this.informationDesk.street}`))),
|
|
16
|
+
this.informationDesk.phone && (h("div", null,
|
|
17
|
+
h("a", { href: `tel:${this.informationDesk.phone}` }, this.informationDesk.phone))),
|
|
18
|
+
this.informationDesk.email && (h("div", null,
|
|
19
|
+
h("a", { href: `mailto:${this.informationDesk.email}` }, this.informationDesk.email))),
|
|
20
|
+
this.informationDesk.website && (h("div", null,
|
|
21
|
+
h("a", { href: `${this.informationDesk.website}` }, this.informationDesk.website))))));
|
|
22
|
+
}
|
|
23
|
+
static get is() { return "grw-information-desk-detail"; }
|
|
24
|
+
static get encapsulation() { return "shadow"; }
|
|
25
|
+
static get originalStyleUrls() { return {
|
|
26
|
+
"$": ["grw-information-desk-detail.scss"]
|
|
27
|
+
}; }
|
|
28
|
+
static get styleUrls() { return {
|
|
29
|
+
"$": ["grw-information-desk-detail.css"]
|
|
30
|
+
}; }
|
|
31
|
+
static get properties() { return {
|
|
32
|
+
"informationDesk": {
|
|
33
|
+
"type": "unknown",
|
|
34
|
+
"mutable": false,
|
|
35
|
+
"complexType": {
|
|
36
|
+
"original": "InformationDesk",
|
|
37
|
+
"resolved": "{ id: number; name: string; description: string; type: InformationDeskType; phone: string; email: string; website: string; municipality: string; postal_code: string; street: string; photo_url: string; latitude: string; longitude: string; }",
|
|
38
|
+
"references": {
|
|
39
|
+
"InformationDesk": {
|
|
40
|
+
"location": "import",
|
|
41
|
+
"path": "types/types"
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
"required": false,
|
|
46
|
+
"optional": false,
|
|
47
|
+
"docs": {
|
|
48
|
+
"tags": [],
|
|
49
|
+
"text": ""
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}; }
|
|
53
|
+
}
|
|
@@ -657,6 +657,7 @@ svg.leaflet-image-layer.leaflet-interactive path {
|
|
|
657
657
|
}
|
|
658
658
|
|
|
659
659
|
grw-map {
|
|
660
|
+
font-family: "Roboto";
|
|
660
661
|
display: block;
|
|
661
662
|
height: 100%;
|
|
662
663
|
max-height: 100vh;
|
|
@@ -719,4 +720,102 @@ grw-map {
|
|
|
719
720
|
100% {
|
|
720
721
|
transform: rotate(360deg);
|
|
721
722
|
}
|
|
723
|
+
}
|
|
724
|
+
|
|
725
|
+
.leaflet-popup-content {
|
|
726
|
+
width: 144px;
|
|
727
|
+
margin: 0;
|
|
728
|
+
}
|
|
729
|
+
|
|
730
|
+
.trek-departure-popup {
|
|
731
|
+
position: relative;
|
|
732
|
+
display: flex;
|
|
733
|
+
flex-direction: column;
|
|
734
|
+
width: 100px;
|
|
735
|
+
height: auto;
|
|
736
|
+
padding: 24px;
|
|
737
|
+
}
|
|
738
|
+
.trek-departure-popup img {
|
|
739
|
+
border-radius: 8px;
|
|
740
|
+
box-shadow: 4px 8px 24px rgba(0, 0, 0, 0.25);
|
|
741
|
+
}
|
|
742
|
+
.trek-departure-popup .trek-name {
|
|
743
|
+
color: var(--color-primary);
|
|
744
|
+
font-weight: bold;
|
|
745
|
+
font-size: 12px;
|
|
746
|
+
}
|
|
747
|
+
.trek-departure-popup .trek-name-margin-top {
|
|
748
|
+
margin-top: 12px;
|
|
749
|
+
}
|
|
750
|
+
|
|
751
|
+
.poi-tooltip .poi-name,
|
|
752
|
+
.poi-tooltip .information-desks-name,
|
|
753
|
+
.poi-tooltip .sensitive-area-name,
|
|
754
|
+
.information-desks-tooltip .poi-name,
|
|
755
|
+
.information-desks-tooltip .information-desks-name,
|
|
756
|
+
.information-desks-tooltip .sensitive-area-name,
|
|
757
|
+
.sensitive-area-tooltip .poi-name,
|
|
758
|
+
.sensitive-area-tooltip .information-desks-name,
|
|
759
|
+
.sensitive-area-tooltip .sensitive-area-name {
|
|
760
|
+
color: var(--color-primary);
|
|
761
|
+
font-weight: bold;
|
|
762
|
+
font-size: 12px;
|
|
763
|
+
}
|
|
764
|
+
|
|
765
|
+
.sensitiveAreasCheckboxContainer {
|
|
766
|
+
display: flex;
|
|
767
|
+
justify-content: center;
|
|
768
|
+
align-items: center;
|
|
769
|
+
background-color: #ffffff;
|
|
770
|
+
padding: 8px;
|
|
771
|
+
border-radius: 8px;
|
|
772
|
+
user-select: none;
|
|
773
|
+
}
|
|
774
|
+
.sensitiveAreasCheckboxContainer input,
|
|
775
|
+
.sensitiveAreasCheckboxContainer label {
|
|
776
|
+
cursor: pointer;
|
|
777
|
+
}
|
|
778
|
+
.sensitiveAreasCheckboxContainer input {
|
|
779
|
+
margin: 0;
|
|
780
|
+
}
|
|
781
|
+
.sensitiveAreasCheckboxContainer label {
|
|
782
|
+
padding-left: 8px;
|
|
783
|
+
}
|
|
784
|
+
|
|
785
|
+
.poi-icon,
|
|
786
|
+
.information-desks-icon {
|
|
787
|
+
background-color: var(--color-poi-icon);
|
|
788
|
+
border-radius: 50%;
|
|
789
|
+
display: flex;
|
|
790
|
+
justify-content: center;
|
|
791
|
+
align-items: center;
|
|
792
|
+
}
|
|
793
|
+
.poi-icon img,
|
|
794
|
+
.information-desks-icon img {
|
|
795
|
+
width: 36px !important;
|
|
796
|
+
}
|
|
797
|
+
|
|
798
|
+
.parking-icon {
|
|
799
|
+
background-color: #0000ff;
|
|
800
|
+
border-radius: 50%;
|
|
801
|
+
display: flex;
|
|
802
|
+
justify-content: center;
|
|
803
|
+
align-items: center;
|
|
804
|
+
width: 48px;
|
|
805
|
+
height: 48px;
|
|
806
|
+
font-size: 24px;
|
|
807
|
+
color: #ffffff;
|
|
808
|
+
}
|
|
809
|
+
|
|
810
|
+
.point-reference-icon {
|
|
811
|
+
background-color: #ff0000;
|
|
812
|
+
border: 1px solid #ffffff;
|
|
813
|
+
border-radius: 50%;
|
|
814
|
+
display: flex;
|
|
815
|
+
justify-content: center;
|
|
816
|
+
align-items: center;
|
|
817
|
+
width: 24px;
|
|
818
|
+
height: 24px;
|
|
819
|
+
font-size: 18px;
|
|
820
|
+
color: #ffffff;
|
|
722
821
|
}
|