@geotrekce/geotrek-rando-widget 0.0.13 → 0.0.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (94) hide show
  1. package/dist/cjs/{css-shim-6f592941.js → css-shim-06c204c1.js} +1 -1
  2. package/dist/cjs/{dom-d5e52c7e.js → dom-874a1e39.js} +1 -1
  3. package/dist/cjs/geotrek-rando-widget.cjs.js +4 -4
  4. package/dist/cjs/grw-app.cjs.entry.js +4 -3
  5. package/dist/cjs/grw-filter_6.cjs.entry.js +14447 -14156
  6. package/dist/cjs/grw-information-desk-detail_3.cjs.entry.js +2 -2
  7. package/dist/cjs/grw-trek-card.cjs.entry.js +15 -7
  8. package/dist/cjs/{index-66d58516.js → index-c3fb4999.js} +219 -66
  9. package/dist/cjs/loader.cjs.js +4 -4
  10. package/dist/cjs/{shadow-css-cf936b02.js → shadow-css-a33dc836.js} +1 -1
  11. package/dist/cjs/{store-d301af22.js → store-5183d8f8.js} +4 -2
  12. package/dist/collection/collection-manifest.json +2 -2
  13. package/dist/collection/components/grw-app/grw-app.js +432 -450
  14. package/dist/collection/components/grw-filter/grw-filter.js +65 -61
  15. package/dist/collection/components/grw-information-desk-detail/grw-information-desk-detail.js +35 -44
  16. package/dist/collection/components/grw-map/grw-map.css +5 -4
  17. package/dist/collection/components/grw-map/grw-map.js +251 -217
  18. package/dist/collection/components/grw-poi-detail/grw-poi-detail.js +33 -32
  19. package/dist/collection/components/grw-sensitive-area-detail/grw-sensitive-area-detail.js +42 -47
  20. package/dist/collection/components/grw-trek-card/grw-trek-card.js +142 -129
  21. package/dist/collection/components/grw-trek-detail/grw-trek-detail.js +135 -208
  22. package/dist/collection/components/grw-treks-list/grw-treks-list.js +95 -65
  23. package/dist/collection/store/grw-trek-provider.js +61 -55
  24. package/dist/collection/store/grw-treks-provider.js +181 -177
  25. package/dist/collection/store/store.js +3 -2
  26. package/dist/components/grw-app.js +3 -2
  27. package/dist/components/grw-map2.js +14405 -14129
  28. package/dist/components/grw-trek-card2.js +17 -7
  29. package/dist/components/grw-trek-detail2.js +10 -3
  30. package/dist/components/grw-trek-provider2.js +6 -2
  31. package/dist/components/grw-treks-list2.js +7 -2
  32. package/dist/components/grw-treks-provider2.js +5 -3
  33. package/dist/components/store.js +3 -2
  34. package/dist/esm/{css-shim-2d0a698c.js → css-shim-bfa379cd.js} +1 -1
  35. package/dist/esm/{dom-9794f747.js → dom-104fb833.js} +1 -1
  36. package/dist/esm/geotrek-rando-widget.js +4 -4
  37. package/dist/esm/grw-app.entry.js +4 -3
  38. package/dist/esm/grw-filter_6.entry.js +14427 -14136
  39. package/dist/esm/grw-information-desk-detail_3.entry.js +2 -2
  40. package/dist/esm/grw-trek-card.entry.js +15 -7
  41. package/dist/esm/{index-899307bb.js → index-e834943f.js} +219 -66
  42. package/dist/esm/loader.js +4 -4
  43. package/dist/esm/{shadow-css-4cd4480f.js → shadow-css-4261c637.js} +1 -1
  44. package/dist/esm/{store-70461a28.js → store-c6ccb3db.js} +4 -3
  45. package/dist/esm-es5/{css-shim-2d0a698c.js → css-shim-bfa379cd.js} +0 -0
  46. package/dist/esm-es5/{dom-9794f747.js → dom-104fb833.js} +0 -0
  47. package/dist/esm-es5/geotrek-rando-widget.js +1 -1
  48. package/dist/esm-es5/grw-app.entry.js +1 -1
  49. package/dist/esm-es5/grw-filter_6.entry.js +4 -5
  50. package/dist/esm-es5/grw-information-desk-detail_3.entry.js +1 -1
  51. package/dist/esm-es5/grw-trek-card.entry.js +1 -1
  52. package/dist/esm-es5/{index-899307bb.js → index-e834943f.js} +1 -1
  53. package/dist/esm-es5/loader.js +1 -1
  54. package/dist/esm-es5/{shadow-css-4cd4480f.js → shadow-css-4261c637.js} +0 -0
  55. package/dist/esm-es5/{store-70461a28.js → store-c6ccb3db.js} +1 -1
  56. package/dist/geotrek-rando-widget/geotrek-rando-widget.esm.js +1 -1
  57. package/dist/geotrek-rando-widget/geotrek-rando-widget.js +1 -1
  58. package/dist/geotrek-rando-widget/p-392538a1.system.entry.js +1 -0
  59. package/dist/geotrek-rando-widget/{p-d1582cff.js → p-4c61dcad.js} +0 -0
  60. package/dist/geotrek-rando-widget/p-4e0fcbe6.js +1 -0
  61. package/dist/geotrek-rando-widget/p-6469fc8a.system.js +1 -0
  62. package/dist/geotrek-rando-widget/{p-c8c96517.system.js → p-6523a23b.system.js} +0 -0
  63. package/dist/geotrek-rando-widget/{p-32d97a4f.system.js → p-70ecdd1b.system.js} +0 -0
  64. package/dist/geotrek-rando-widget/{p-0c5b047c.js → p-88046639.js} +0 -0
  65. package/dist/geotrek-rando-widget/p-88e55e13.entry.js +1 -0
  66. package/dist/geotrek-rando-widget/p-93d51eaa.entry.js +1 -0
  67. package/dist/geotrek-rando-widget/p-95932d69.system.entry.js +5 -0
  68. package/dist/geotrek-rando-widget/{p-4690907e.js → p-9c0d229f.js} +1 -1
  69. package/dist/geotrek-rando-widget/{p-b1530d9c.system.js → p-a8de6293.system.js} +0 -0
  70. package/dist/geotrek-rando-widget/p-d56c1888.system.entry.js +1 -0
  71. package/dist/geotrek-rando-widget/{p-533fc2bb.entry.js → p-dce99cef.entry.js} +1 -1
  72. package/dist/geotrek-rando-widget/{p-8f9914f4.system.js → p-e2d589f8.system.js} +1 -1
  73. package/dist/geotrek-rando-widget/{p-82ca029f.system.js → p-e3c13365.system.js} +1 -1
  74. package/dist/geotrek-rando-widget/{p-2bd0278f.system.entry.js → p-e9f13f25.system.entry.js} +1 -1
  75. package/dist/geotrek-rando-widget/{p-4eaf20b7.js → p-ef5d4167.js} +0 -0
  76. package/dist/geotrek-rando-widget/p-fce69064.entry.js +1 -0
  77. package/dist/types/components/grw-map/grw-map.d.ts +3 -1
  78. package/dist/types/components/grw-trek-card/grw-trek-card.d.ts +4 -1
  79. package/dist/types/components/grw-trek-detail/grw-trek-detail.d.ts +3 -1
  80. package/dist/types/components/grw-treks-list/grw-treks-list.d.ts +1 -0
  81. package/dist/types/components.d.ts +8 -0
  82. package/dist/types/store/store.d.ts +5 -3
  83. package/dist/types/types/types.d.ts +6 -0
  84. package/loader/package.json +1 -0
  85. package/package.json +12 -12
  86. package/readme.md +4 -6
  87. package/dist/geotrek-rando-widget/p-067c02c4.system.js +0 -1
  88. package/dist/geotrek-rando-widget/p-18038011.js +0 -1
  89. package/dist/geotrek-rando-widget/p-2712caa8.system.entry.js +0 -6
  90. package/dist/geotrek-rando-widget/p-3ed52659.entry.js +0 -1
  91. package/dist/geotrek-rando-widget/p-48d5dde7.entry.js +0 -1
  92. package/dist/geotrek-rando-widget/p-e1431f36.system.entry.js +0 -1
  93. package/dist/geotrek-rando-widget/p-e38f4ff4.system.entry.js +0 -1
  94. package/dist/geotrek-rando-widget/p-f5d98aae.entry.js +0 -1
@@ -1,5 +1,5 @@
1
- import { Component, Host, h, Prop, State } from '@stencil/core';
2
- import state, { onChange } from 'store/store';
1
+ import { Host, h } from '@stencil/core';
2
+ import state, { onChange, reset } from 'store/store';
3
3
  import { formatDuration, formatLength, formatAscent } from 'utils/utils';
4
4
  import ascentImage from '../../assets/ascent.svg';
5
5
  import durationImage from '../../assets/duration.svg';
@@ -9,6 +9,7 @@ export class GrwTrekDetail {
9
9
  this.colorPrimary = '#6b0030';
10
10
  this.colorPrimaryShade = '#4a0021';
11
11
  this.colorPrimaryTint = '#974c6e';
12
+ this.resetStoreOnDisconnected = true;
12
13
  }
13
14
  connectedCallback() {
14
15
  this.currentTrek = this.trek ? this.trek : state.currentTrek;
@@ -40,221 +41,147 @@ export class GrwTrekDetail {
40
41
  }
41
42
  });
42
43
  }
44
+ disconnectedCallback() {
45
+ if (this.resetStoreOnDisconnected) {
46
+ reset();
47
+ }
48
+ }
43
49
  render() {
44
50
  var _a, _b, _c, _d, _e, _f, _g;
45
- return (h(Host, { style: { '--color-primary': this.colorPrimary, '--color-primary-shade': this.colorPrimaryShade, '--color-primary-tint': this.colorPrimaryTint } }, this.currentTrek && (h("div", { class: "trek-detail-container" },
46
- h("div", { class: "name" }, this.currentTrek.name),
47
- this.currentTrek.attachments && this.currentTrek.attachments[0] && this.currentTrek.attachments[0].url && (h("img", { class: "image", src: this.currentTrek.attachments[0].url, loading: "lazy" })),
48
- h("div", { class: "sub-container" },
49
- h("div", { class: "icons-labels-container" },
50
- h("div", { class: "row" },
51
- h("div", { class: "icon-label difficulty" },
52
- ((_a = this.difficulty) === null || _a === void 0 ? void 0 : _a.pictogram) && h("img", { src: this.difficulty.pictogram }), (_b = this.difficulty) === null || _b === void 0 ? void 0 :
53
- _b.label),
54
- h("div", { class: "icon-label duration" },
55
- h("div", { class: "svg-icon", innerHTML: durationImage }),
56
- formatDuration((_c = this.currentTrek) === null || _c === void 0 ? void 0 : _c.duration)),
57
- h("div", { class: "icon-label route" },
58
- ((_d = this.route) === null || _d === void 0 ? void 0 : _d.pictogram) && h("img", { src: this.route.pictogram }), (_e = this.route) === null || _e === void 0 ? void 0 :
59
- _e.route)),
60
- h("div", { class: "row" },
61
- h("div", { class: "icon-label length" },
62
- h("div", { class: "svg-icon", innerHTML: lengthImage }),
63
- formatLength(this.currentTrek.length_2d)),
64
- h("div", { class: "icon-label ascent" },
65
- h("div", { class: "svg-icon", innerHTML: ascentImage }),
66
- formatAscent(this.currentTrek.ascent)),
67
- h("div", { class: "icon-label practice" },
68
- ((_f = this.practice) === null || _f === void 0 ? void 0 : _f.pictogram) && h("img", { src: this.practice.pictogram }), (_g = this.practice) === null || _g === void 0 ? void 0 :
69
- _g.name)))),
70
- h("div", { class: "downloads-container" },
71
- h("div", { class: "download-title" }, "T\u00E9l\u00E9chargements"),
72
- h("div", { class: "links-container" },
73
- h("a", { href: `${this.currentTrek.gpx}` }, "GPX"),
74
- h("a", { href: `${this.currentTrek.kml}` }, "KML"),
75
- h("a", { href: `${this.currentTrek.pdf}` }, "PDF"))),
76
- this.themes.length > 0 && (h("div", { class: "themes-container" }, this.themes.map(theme => (h("div", { class: "theme" }, theme.label))))),
77
- this.currentTrek.description_teaser && h("div", { class: "description-teaser", innerHTML: this.currentTrek.description_teaser }),
78
- this.currentTrek.ambiance && h("div", { class: "ambiance", innerHTML: this.currentTrek.ambiance }),
79
- this.currentTrek.description && (h("div", { class: "description-container" },
80
- h("div", { class: "description-title" }, "Description"),
81
- h("div", { class: "description", innerHTML: this.currentTrek.description }))),
82
- this.currentTrek.departure && (h("div", { class: "departure-container" },
83
- h("div", { class: "departure-title" }, "D\u00E9part :\u00A0"),
84
- h("div", { innerHTML: this.currentTrek.departure }))),
85
- this.currentTrek.arrival && (h("div", { class: "arrival-container" },
86
- h("div", { class: "arrival-title" }, "Arriv\u00E9e :\u00A0"),
87
- h("div", { innerHTML: this.currentTrek.arrival }))),
88
- this.currentTrek.altimetric_profile && (h("div", { class: "altimetric-profile-container" },
89
- h("div", { class: "altimetric-profile-title" }, "Profil altim\u00E9trique"),
90
- h("img", { src: this.currentTrek.altimetric_profile.endsWith('.json')
91
- ? this.currentTrek.altimetric_profile.replace('.json', '.svg')
92
- : `${this.currentTrek.altimetric_profile}?format=svg` }))),
93
- this.currentTrek.access && (h("div", { class: "access-container" },
94
- h("div", { class: "access-title" }, "Acc\u00E8s routier"),
95
- h("div", { class: "access", innerHTML: this.currentTrek.access }))),
96
- this.currentTrek.public_transport && (h("div", { class: "public-transport-container" },
97
- h("div", { class: "public-transport-title" }, "Transport"),
98
- h("div", { class: "public-transport", innerHTML: this.currentTrek.public_transport }))),
99
- (this.currentTrek.advice || this.labels.length > 0) && (h("div", { class: "advice-container" },
100
- h("div", { class: "advice-title" }, "Recommandations"),
101
- this.currentTrek.advice && h("div", { class: "advice", innerHTML: this.currentTrek.advice }),
102
- this.labels.map(label => (h("div", { class: "label-container" },
103
- h("div", { class: "label-sub-container" },
104
- label.pictogram && h("img", { src: label.pictogram }),
105
- h("div", { class: "label-name", innerHTML: label.name })),
106
- h("div", { class: "label-advice", innerHTML: label.advice })))))),
107
- this.currentTrek.advised_parking && (h("div", { class: "advised-parking-container" },
108
- h("div", { class: "advised-parking-title" }, "Parking conseill\u00E9"),
109
- h("div", { class: "advised_parking", innerHTML: this.currentTrek.advised_parking }))),
110
- this.currentTrek.gear && (h("div", { class: "gear-container" },
111
- h("div", { class: "gear-title" }, "\u00C9quipements"),
112
- h("div", { class: "gear", innerHTML: this.currentTrek.gear }))),
113
- state.currentSensitiveAreas && state.currentSensitiveAreas.length > 0 && (h("div", { class: "sensitive-areas-container" },
114
- h("div", { class: "sensitive-areas-title" }, "Zones de sensibilit\u00E9 environnementale"),
115
- state.currentSensitiveAreas.map(sensitiveArea => (h("grw-sensitive-area-detail", { sensitiveArea: sensitiveArea }))))),
116
- state.currentInformationDesks && state.currentInformationDesks.length > 0 && (h("div", { class: "information-desks-container" },
117
- h("div", { class: "information-desks-title" }, "Lieux de renseignement"),
118
- state.currentInformationDesks.map(informationDesk => (h("grw-information-desk-detail", { informationDesk: informationDesk }))))),
119
- (this.currentTrek.disabled_infrastructure ||
120
- (this.accessibilities && this.accessibilities.length > 0) ||
121
- this.currentTrek.accessibility_level ||
122
- this.currentTrek.accessibility_slope ||
123
- this.currentTrek.accessibility_width ||
124
- this.currentTrek.accessibility_signage ||
125
- this.currentTrek.accessibility_covering ||
126
- this.currentTrek.accessibility_exposure ||
127
- this.currentTrek.accessibility_advice) && (h("div", { class: "accessibilities-container" },
128
- h("div", { class: "accessibilities-title" }, "Accessibilit\u00E9"),
129
- this.currentTrek.disabled_infrastructure && h("div", { innerHTML: this.currentTrek.disabled_infrastructure }),
130
- h("div", { class: "accessibilities-content-container" }, this.accessibilities.map(accessibility => (h("div", { class: "accessibility-content-container" },
131
- h("img", { src: accessibility.pictogram }),
132
- h("div", { innerHTML: accessibility.name }))))),
133
- this.currentTrek.accessibility_level && (h("div", { class: "accessibility-level-container" },
134
- h("div", { class: "accessibility-level-title" }, "Niveau d'accessibilit\u00E9"),
135
- h("div", { innerHTML: this.accessibilityLevel.name }))),
136
- this.currentTrek.accessibility_slope && (h("div", { class: "accessibility-slope-container" },
137
- h("div", { class: "accessibility-slope-title" }, "Pente"),
138
- h("div", { innerHTML: this.currentTrek.accessibility_slope }))),
139
- this.currentTrek.accessibility_width && (h("div", { class: "accessibility-width-container" },
140
- h("div", { class: "accessibility-width-title" }, "Largeur"),
141
- h("div", { innerHTML: this.currentTrek.accessibility_width }))),
142
- this.currentTrek.accessibility_signage && (h("div", { class: "accessibility-signage-container" },
143
- h("div", { class: "accessibility-signage-title" }, "Pente"),
144
- h("div", { innerHTML: this.currentTrek.accessibility_signage }))),
145
- this.currentTrek.accessibility_covering && (h("div", { class: "accessibility-covering-container" },
146
- h("div", { class: "accessibility-covering-title" }, "Rev\u00EAtement"),
147
- h("div", { innerHTML: this.currentTrek.accessibility_covering }))),
148
- this.currentTrek.accessibility_exposure && (h("div", { class: "accessibility-exposure-container" },
149
- h("div", { class: "accessibility-exposure-title" }, "Exposition"),
150
- h("div", { innerHTML: this.currentTrek.accessibility_exposure }))),
151
- this.currentTrek.accessibility_advice && (h("div", { class: "accessibility-advice-container" },
152
- h("div", { class: "accessibility-advice-title" }, "Conseils"),
153
- h("div", { innerHTML: this.currentTrek.accessibility_advice }))))),
154
- state.currentPois && state.currentPois.length > 0 && (h("div", { class: "pois-container" },
155
- h("div", { class: "pois-title" }, "Points d'int\u00E9r\u00EAts"),
156
- state.currentPois.map(poi => (h("grw-poi-detail", { poi: poi }))))),
157
- this.currentTrek.source && this.currentTrek.source.length > 0 && (h("div", { class: "source-container" },
158
- h("div", { class: "source-title" }, "Sources"),
159
- this.sources.map(source => (h("div", { class: "source-sub-container" },
160
- source.pictogram && h("img", { src: source.pictogram }),
161
- h("div", null,
162
- h("div", { class: "source-name", innerHTML: source.name }),
163
- h("a", { class: "source-advice", innerHTML: source.website })))))))))));
51
+ return (h(Host, { style: { '--color-primary': this.colorPrimary, '--color-primary-shade': this.colorPrimaryShade, '--color-primary-tint': this.colorPrimaryTint } }, this.currentTrek && (h("div", { class: "trek-detail-container" }, h("div", { class: "name" }, this.currentTrek.name), this.currentTrek.attachments && this.currentTrek.attachments[0] && this.currentTrek.attachments[0].url && (h("img", { class: "image", src: this.currentTrek.attachments[0].url, loading: "lazy" })), h("div", { class: "sub-container" }, h("div", { class: "icons-labels-container" }, h("div", { class: "row" }, h("div", { class: "icon-label difficulty" }, ((_a = this.difficulty) === null || _a === void 0 ? void 0 : _a.pictogram) && h("img", { src: this.difficulty.pictogram }), (_b = this.difficulty) === null || _b === void 0 ? void 0 :
52
+ _b.label), h("div", { class: "icon-label duration" }, h("div", { class: "svg-icon", innerHTML: durationImage }), formatDuration((_c = this.currentTrek) === null || _c === void 0 ? void 0 : _c.duration)), h("div", { class: "icon-label route" }, ((_d = this.route) === null || _d === void 0 ? void 0 : _d.pictogram) && h("img", { src: this.route.pictogram }), (_e = this.route) === null || _e === void 0 ? void 0 :
53
+ _e.route)), 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: "icon-label practice" }, ((_f = this.practice) === null || _f === void 0 ? void 0 : _f.pictogram) && h("img", { src: this.practice.pictogram }), (_g = this.practice) === null || _g === void 0 ? void 0 :
54
+ _g.name)))), h("div", { class: "downloads-container" }, h("div", { class: "download-title" }, "T\u00E9l\u00E9chargements"), h("div", { class: "links-container" }, h("a", { href: `${this.currentTrek.gpx}` }, "GPX"), h("a", { href: `${this.currentTrek.kml}` }, "KML"), h("a", { href: `${this.currentTrek.pdf}` }, "PDF"))), this.themes.length > 0 && (h("div", { class: "themes-container" }, this.themes.map(theme => (h("div", { class: "theme" }, theme.label))))), this.currentTrek.description_teaser && h("div", { class: "description-teaser", innerHTML: this.currentTrek.description_teaser }), this.currentTrek.ambiance && h("div", { class: "ambiance", innerHTML: this.currentTrek.ambiance }), this.currentTrek.description && (h("div", { class: "description-container" }, h("div", { class: "description-title" }, "Description"), h("div", { class: "description", innerHTML: this.currentTrek.description }))), this.currentTrek.departure && (h("div", { class: "departure-container" }, h("div", { class: "departure-title" }, "D\u00E9part :\u00A0"), h("div", { innerHTML: this.currentTrek.departure }))), this.currentTrek.arrival && (h("div", { class: "arrival-container" }, h("div", { class: "arrival-title" }, "Arriv\u00E9e :\u00A0"), h("div", { innerHTML: this.currentTrek.arrival }))), this.currentTrek.altimetric_profile && (h("div", { class: "altimetric-profile-container" }, h("div", { class: "altimetric-profile-title" }, "Profil altim\u00E9trique"), h("img", { src: this.currentTrek.altimetric_profile.endsWith('.json')
55
+ ? this.currentTrek.altimetric_profile.replace('.json', '.svg')
56
+ : `${this.currentTrek.altimetric_profile}?format=svg` }))), this.currentTrek.access && (h("div", { class: "access-container" }, h("div", { class: "access-title" }, "Acc\u00E8s routier"), h("div", { class: "access", innerHTML: this.currentTrek.access }))), this.currentTrek.public_transport && (h("div", { class: "public-transport-container" }, h("div", { class: "public-transport-title" }, "Transport"), h("div", { class: "public-transport", innerHTML: this.currentTrek.public_transport }))), (this.currentTrek.advice || this.labels.length > 0) && (h("div", { class: "advice-container" }, h("div", { class: "advice-title" }, "Recommandations"), this.currentTrek.advice && h("div", { class: "advice", innerHTML: this.currentTrek.advice }), this.labels.map(label => (h("div", { class: "label-container" }, h("div", { class: "label-sub-container" }, label.pictogram && h("img", { src: label.pictogram }), h("div", { class: "label-name", innerHTML: label.name })), h("div", { class: "label-advice", innerHTML: label.advice })))))), this.currentTrek.advised_parking && (h("div", { class: "advised-parking-container" }, h("div", { class: "advised-parking-title" }, "Parking conseill\u00E9"), h("div", { class: "advised_parking", innerHTML: this.currentTrek.advised_parking }))), this.currentTrek.gear && (h("div", { class: "gear-container" }, h("div", { class: "gear-title" }, "\u00C9quipements"), h("div", { class: "gear", innerHTML: this.currentTrek.gear }))), state.currentSensitiveAreas && state.currentSensitiveAreas.length > 0 && (h("div", { class: "sensitive-areas-container" }, h("div", { class: "sensitive-areas-title" }, "Zones de sensibilit\u00E9 environnementale"), state.currentSensitiveAreas.map(sensitiveArea => (h("grw-sensitive-area-detail", { sensitiveArea: sensitiveArea }))))), state.currentInformationDesks && state.currentInformationDesks.length > 0 && (h("div", { class: "information-desks-container" }, h("div", { class: "information-desks-title" }, "Lieux de renseignement"), state.currentInformationDesks.map(informationDesk => (h("grw-information-desk-detail", { informationDesk: informationDesk }))))), (this.currentTrek.disabled_infrastructure ||
57
+ (this.accessibilities && this.accessibilities.length > 0) ||
58
+ this.currentTrek.accessibility_level ||
59
+ this.currentTrek.accessibility_slope ||
60
+ this.currentTrek.accessibility_width ||
61
+ this.currentTrek.accessibility_signage ||
62
+ this.currentTrek.accessibility_covering ||
63
+ this.currentTrek.accessibility_exposure ||
64
+ this.currentTrek.accessibility_advice) && (h("div", { class: "accessibilities-container" }, h("div", { class: "accessibilities-title" }, "Accessibilit\u00E9"), this.currentTrek.disabled_infrastructure && h("div", { innerHTML: this.currentTrek.disabled_infrastructure }), h("div", { class: "accessibilities-content-container" }, this.accessibilities.map(accessibility => (h("div", { class: "accessibility-content-container" }, h("img", { src: accessibility.pictogram }), h("div", { innerHTML: accessibility.name }))))), this.currentTrek.accessibility_level && (h("div", { class: "accessibility-level-container" }, h("div", { class: "accessibility-level-title" }, "Niveau d'accessibilit\u00E9"), h("div", { innerHTML: this.accessibilityLevel.name }))), this.currentTrek.accessibility_slope && (h("div", { class: "accessibility-slope-container" }, h("div", { class: "accessibility-slope-title" }, "Pente"), h("div", { innerHTML: this.currentTrek.accessibility_slope }))), this.currentTrek.accessibility_width && (h("div", { class: "accessibility-width-container" }, h("div", { class: "accessibility-width-title" }, "Largeur"), h("div", { innerHTML: this.currentTrek.accessibility_width }))), this.currentTrek.accessibility_signage && (h("div", { class: "accessibility-signage-container" }, h("div", { class: "accessibility-signage-title" }, "Pente"), h("div", { innerHTML: this.currentTrek.accessibility_signage }))), this.currentTrek.accessibility_covering && (h("div", { class: "accessibility-covering-container" }, h("div", { class: "accessibility-covering-title" }, "Rev\u00EAtement"), h("div", { innerHTML: this.currentTrek.accessibility_covering }))), this.currentTrek.accessibility_exposure && (h("div", { class: "accessibility-exposure-container" }, h("div", { class: "accessibility-exposure-title" }, "Exposition"), h("div", { innerHTML: this.currentTrek.accessibility_exposure }))), this.currentTrek.accessibility_advice && (h("div", { class: "accessibility-advice-container" }, h("div", { class: "accessibility-advice-title" }, "Conseils"), h("div", { innerHTML: this.currentTrek.accessibility_advice }))))), state.currentPois && state.currentPois.length > 0 && (h("div", { class: "pois-container" }, h("div", { class: "pois-title" }, "Points d'int\u00E9r\u00EAts"), state.currentPois.map(poi => (h("grw-poi-detail", { poi: poi }))))), this.currentTrek.source && this.currentTrek.source.length > 0 && (h("div", { class: "source-container" }, h("div", { class: "source-title" }, "Sources"), this.sources.map(source => (h("div", { class: "source-sub-container" }, source.pictogram && h("img", { src: source.pictogram }), h("div", null, h("div", { class: "source-name", innerHTML: source.name }), h("a", { class: "source-advice", innerHTML: source.website })))))))))));
164
65
  }
165
66
  static get is() { return "grw-trek-detail"; }
166
67
  static get encapsulation() { return "shadow"; }
167
- static get originalStyleUrls() { return {
168
- "$": ["grw-trek-detail.scss"]
169
- }; }
170
- static get styleUrls() { return {
171
- "$": ["grw-trek-detail.css"]
172
- }; }
173
- static get properties() { return {
174
- "trek": {
175
- "type": "unknown",
176
- "mutable": false,
177
- "complexType": {
178
- "original": "Trek",
179
- "resolved": "{ id: number; name: string; attachments: Attachments; description?: string; description_teaser: string; difficulty: number; route: number; practice: number; themes: number[]; duration: number; length_2d: number; ascent: number; departure: string; arrival?: string; altimetric_profile?: string; geometry?: LineString; departure_geom?: Position; gpx?: string; kml?: string; pdf?: string; parking_location?: Position; ambiance?: string; access?: string; public_transport?: string; advice?: string; advised_parking?: string; gear?: string; labels?: number[]; points_reference?: MultiPoint; source?: number[]; structure?: number; disabled_infrastructure?: string; accessibilities?: number[]; accessibility_level?: number; accessibility_slope?: string; accessibility_width?: string; accessibility_signage?: string; accessibility_covering?: string; accessibility_exposure?: string; accessibility_advice?: string; }",
180
- "references": {
181
- "Trek": {
182
- "location": "import",
183
- "path": "types/types"
68
+ static get originalStyleUrls() {
69
+ return {
70
+ "$": ["grw-trek-detail.scss"]
71
+ };
72
+ }
73
+ static get styleUrls() {
74
+ return {
75
+ "$": ["grw-trek-detail.css"]
76
+ };
77
+ }
78
+ static get properties() {
79
+ return {
80
+ "trek": {
81
+ "type": "unknown",
82
+ "mutable": false,
83
+ "complexType": {
84
+ "original": "Trek",
85
+ "resolved": "{ id: number; name: string; attachments: Attachments; description?: string; description_teaser: string; difficulty: number; route: number; practice: number; themes: number[]; duration: number; length_2d: number; ascent: number; departure: string; departure_city: string; arrival?: string; altimetric_profile?: string; geometry?: LineString; departure_geom?: Position; gpx?: string; kml?: string; pdf?: string; parking_location?: Position; ambiance?: string; access?: string; public_transport?: string; advice?: string; advised_parking?: string; gear?: string; labels?: number[]; points_reference?: MultiPoint; source?: number[]; structure?: number; disabled_infrastructure?: string; accessibilities?: number[]; accessibility_level?: number; accessibility_slope?: string; accessibility_width?: string; accessibility_signage?: string; accessibility_covering?: string; accessibility_exposure?: string; accessibility_advice?: string; }",
86
+ "references": {
87
+ "Trek": {
88
+ "location": "import",
89
+ "path": "types/types"
90
+ }
184
91
  }
92
+ },
93
+ "required": false,
94
+ "optional": false,
95
+ "docs": {
96
+ "tags": [],
97
+ "text": ""
185
98
  }
186
99
  },
187
- "required": false,
188
- "optional": false,
189
- "docs": {
190
- "tags": [],
191
- "text": ""
192
- }
193
- },
194
- "colorPrimary": {
195
- "type": "string",
196
- "mutable": false,
197
- "complexType": {
198
- "original": "string",
199
- "resolved": "string",
200
- "references": {}
201
- },
202
- "required": false,
203
- "optional": false,
204
- "docs": {
205
- "tags": [],
206
- "text": ""
100
+ "colorPrimary": {
101
+ "type": "string",
102
+ "mutable": false,
103
+ "complexType": {
104
+ "original": "string",
105
+ "resolved": "string",
106
+ "references": {}
107
+ },
108
+ "required": false,
109
+ "optional": false,
110
+ "docs": {
111
+ "tags": [],
112
+ "text": ""
113
+ },
114
+ "attribute": "color-primary",
115
+ "reflect": false,
116
+ "defaultValue": "'#6b0030'"
207
117
  },
208
- "attribute": "color-primary",
209
- "reflect": false,
210
- "defaultValue": "'#6b0030'"
211
- },
212
- "colorPrimaryShade": {
213
- "type": "string",
214
- "mutable": false,
215
- "complexType": {
216
- "original": "string",
217
- "resolved": "string",
218
- "references": {}
118
+ "colorPrimaryShade": {
119
+ "type": "string",
120
+ "mutable": false,
121
+ "complexType": {
122
+ "original": "string",
123
+ "resolved": "string",
124
+ "references": {}
125
+ },
126
+ "required": false,
127
+ "optional": false,
128
+ "docs": {
129
+ "tags": [],
130
+ "text": ""
131
+ },
132
+ "attribute": "color-primary-shade",
133
+ "reflect": false,
134
+ "defaultValue": "'#4a0021'"
219
135
  },
220
- "required": false,
221
- "optional": false,
222
- "docs": {
223
- "tags": [],
224
- "text": ""
136
+ "colorPrimaryTint": {
137
+ "type": "string",
138
+ "mutable": false,
139
+ "complexType": {
140
+ "original": "string",
141
+ "resolved": "string",
142
+ "references": {}
143
+ },
144
+ "required": false,
145
+ "optional": false,
146
+ "docs": {
147
+ "tags": [],
148
+ "text": ""
149
+ },
150
+ "attribute": "color-primary-tint",
151
+ "reflect": false,
152
+ "defaultValue": "'#974c6e'"
225
153
  },
226
- "attribute": "color-primary-shade",
227
- "reflect": false,
228
- "defaultValue": "'#4a0021'"
229
- },
230
- "colorPrimaryTint": {
231
- "type": "string",
232
- "mutable": false,
233
- "complexType": {
234
- "original": "string",
235
- "resolved": "string",
236
- "references": {}
237
- },
238
- "required": false,
239
- "optional": false,
240
- "docs": {
241
- "tags": [],
242
- "text": ""
243
- },
244
- "attribute": "color-primary-tint",
245
- "reflect": false,
246
- "defaultValue": "'#974c6e'"
247
- }
248
- }; }
249
- static get states() { return {
250
- "difficulty": {},
251
- "route": {},
252
- "practice": {},
253
- "themes": {},
254
- "labels": {},
255
- "sources": {},
256
- "accessibilities": {},
257
- "accessibilityLevel": {},
258
- "currentTrek": {}
259
- }; }
154
+ "resetStoreOnDisconnected": {
155
+ "type": "boolean",
156
+ "mutable": false,
157
+ "complexType": {
158
+ "original": "boolean",
159
+ "resolved": "boolean",
160
+ "references": {}
161
+ },
162
+ "required": false,
163
+ "optional": false,
164
+ "docs": {
165
+ "tags": [],
166
+ "text": ""
167
+ },
168
+ "attribute": "reset-store-on-disconnected",
169
+ "reflect": false,
170
+ "defaultValue": "true"
171
+ }
172
+ };
173
+ }
174
+ static get states() {
175
+ return {
176
+ "currentTrek": {},
177
+ "difficulty": {},
178
+ "route": {},
179
+ "practice": {},
180
+ "themes": {},
181
+ "labels": {},
182
+ "sources": {},
183
+ "accessibilities": {},
184
+ "accessibilityLevel": {}
185
+ };
186
+ }
260
187
  }
@@ -1,11 +1,12 @@
1
- import { Component, Host, h, Element, State, Prop } from '@stencil/core';
2
- import state, { onChange } from 'store/store';
1
+ import { Host, h } from '@stencil/core';
2
+ import state, { onChange, reset } from 'store/store';
3
3
  export class GrwTreksList {
4
4
  constructor() {
5
5
  this.treksToDisplay = [];
6
6
  this.colorPrimary = '#6b0030';
7
7
  this.colorPrimaryTint = '#974c6e';
8
8
  this.isLargeView = false;
9
+ this.resetStoreOnDisconnected = true;
9
10
  this.step = 10;
10
11
  this.handleInfiniteScrollBind = this.handleInfiniteScroll.bind(this);
11
12
  this.shouldAddInfiniteScrollEvent = true;
@@ -53,77 +54,106 @@ export class GrwTreksList {
53
54
  }
54
55
  }
55
56
  disconnectedCallback() {
57
+ if (this.resetStoreOnDisconnected) {
58
+ reset();
59
+ }
56
60
  this.handleInfiniteScrollEvent(false);
57
61
  }
58
62
  render() {
59
- return (h(Host, { style: { '--color-primary': this.colorPrimary, '--color-primary-tint': this.colorPrimaryTint } }, this.treksToDisplay.map(trek => (h("grw-trek-card", { key: `trek-${trek.id}`, trek: trek, "is-large-view": this.isLargeView, "color-primary": this.colorPrimary, "color-primary-tint": this.colorPrimaryTint })))));
63
+ return (h(Host, { style: { '--color-primary': this.colorPrimary, '--color-primary-tint': this.colorPrimaryTint } }, this.treksToDisplay.map(trek => (h("grw-trek-card", { "reset-store-on-disconnected": "false", key: `trek-${trek.id}`, trek: trek, "is-large-view": this.isLargeView, "color-primary": this.colorPrimary, "color-primary-tint": this.colorPrimaryTint })))));
60
64
  }
61
65
  static get is() { return "grw-treks-list"; }
62
66
  static get encapsulation() { return "shadow"; }
63
- static get originalStyleUrls() { return {
64
- "$": ["grw-treks-list.scss"]
65
- }; }
66
- static get styleUrls() { return {
67
- "$": ["grw-treks-list.css"]
68
- }; }
69
- static get properties() { return {
70
- "colorPrimary": {
71
- "type": "string",
72
- "mutable": false,
73
- "complexType": {
74
- "original": "string",
75
- "resolved": "string",
76
- "references": {}
77
- },
78
- "required": false,
79
- "optional": false,
80
- "docs": {
81
- "tags": [],
82
- "text": ""
83
- },
84
- "attribute": "color-primary",
85
- "reflect": false,
86
- "defaultValue": "'#6b0030'"
87
- },
88
- "colorPrimaryTint": {
89
- "type": "string",
90
- "mutable": false,
91
- "complexType": {
92
- "original": "string",
93
- "resolved": "string",
94
- "references": {}
95
- },
96
- "required": false,
97
- "optional": false,
98
- "docs": {
99
- "tags": [],
100
- "text": ""
67
+ static get originalStyleUrls() {
68
+ return {
69
+ "$": ["grw-treks-list.scss"]
70
+ };
71
+ }
72
+ static get styleUrls() {
73
+ return {
74
+ "$": ["grw-treks-list.css"]
75
+ };
76
+ }
77
+ static get properties() {
78
+ return {
79
+ "colorPrimary": {
80
+ "type": "string",
81
+ "mutable": false,
82
+ "complexType": {
83
+ "original": "string",
84
+ "resolved": "string",
85
+ "references": {}
86
+ },
87
+ "required": false,
88
+ "optional": false,
89
+ "docs": {
90
+ "tags": [],
91
+ "text": ""
92
+ },
93
+ "attribute": "color-primary",
94
+ "reflect": false,
95
+ "defaultValue": "'#6b0030'"
101
96
  },
102
- "attribute": "color-primary-tint",
103
- "reflect": false,
104
- "defaultValue": "'#974c6e'"
105
- },
106
- "isLargeView": {
107
- "type": "boolean",
108
- "mutable": false,
109
- "complexType": {
110
- "original": "boolean",
111
- "resolved": "boolean",
112
- "references": {}
97
+ "colorPrimaryTint": {
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": "color-primary-tint",
112
+ "reflect": false,
113
+ "defaultValue": "'#974c6e'"
113
114
  },
114
- "required": false,
115
- "optional": false,
116
- "docs": {
117
- "tags": [],
118
- "text": ""
115
+ "isLargeView": {
116
+ "type": "boolean",
117
+ "mutable": false,
118
+ "complexType": {
119
+ "original": "boolean",
120
+ "resolved": "boolean",
121
+ "references": {}
122
+ },
123
+ "required": false,
124
+ "optional": false,
125
+ "docs": {
126
+ "tags": [],
127
+ "text": ""
128
+ },
129
+ "attribute": "is-large-view",
130
+ "reflect": false,
131
+ "defaultValue": "false"
119
132
  },
120
- "attribute": "is-large-view",
121
- "reflect": false,
122
- "defaultValue": "false"
123
- }
124
- }; }
125
- static get states() { return {
126
- "treksToDisplay": {}
127
- }; }
133
+ "resetStoreOnDisconnected": {
134
+ "type": "boolean",
135
+ "mutable": false,
136
+ "complexType": {
137
+ "original": "boolean",
138
+ "resolved": "boolean",
139
+ "references": {}
140
+ },
141
+ "required": false,
142
+ "optional": false,
143
+ "docs": {
144
+ "tags": [],
145
+ "text": ""
146
+ },
147
+ "attribute": "reset-store-on-disconnected",
148
+ "reflect": false,
149
+ "defaultValue": "true"
150
+ }
151
+ };
152
+ }
153
+ static get states() {
154
+ return {
155
+ "treksToDisplay": {}
156
+ };
157
+ }
128
158
  static get elementRef() { return "element"; }
129
159
  }