@geotrekce/geotrek-rando-widget 0.18.0 → 0.18.2

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 (206) hide show
  1. package/dist/cjs/grw-app.cjs.entry.js +5 -5
  2. package/dist/cjs/grw-app.cjs.entry.js.br +0 -0
  3. package/dist/cjs/grw-app.cjs.entry.js.gz +0 -0
  4. package/dist/cjs/grw-app.cjs.entry.js.map +1 -1
  5. package/dist/cjs/grw-common-button_27.cjs.entry.js +496 -374
  6. package/dist/cjs/grw-common-button_27.cjs.entry.js.br +0 -0
  7. package/dist/cjs/grw-common-button_27.cjs.entry.js.gz +0 -0
  8. package/dist/cjs/grw-common-button_27.cjs.entry.js.map +1 -1
  9. package/dist/cjs/grw-information-desk_3.cjs.entry.js +1 -1
  10. package/dist/cjs/grw-information-desk_3.cjs.entry.js.br +0 -0
  11. package/dist/cjs/grw-information-desk_3.cjs.entry.js.gz +0 -0
  12. package/dist/cjs/grw-poi_3.cjs.entry.js +58 -38
  13. package/dist/cjs/grw-poi_3.cjs.entry.js.br +0 -0
  14. package/dist/cjs/grw-poi_3.cjs.entry.js.gz +0 -0
  15. package/dist/cjs/grw-poi_3.cjs.entry.js.map +1 -1
  16. package/dist/cjs/{i18n-2df02bcf.js → i18n-736691e8.js} +5 -1
  17. package/dist/cjs/i18n-736691e8.js.br +0 -0
  18. package/dist/cjs/i18n-736691e8.js.gz +0 -0
  19. package/dist/cjs/i18n-736691e8.js.map +1 -0
  20. package/dist/collection/components/grw-app/grw-app.js +4 -4
  21. package/dist/collection/components/grw-app/grw-app.js.br +0 -0
  22. package/dist/collection/components/grw-app/grw-app.js.gz +0 -0
  23. package/dist/collection/components/grw-app/grw-app.js.map +1 -1
  24. package/dist/collection/components/grw-common-button/grw-common-button.css +1 -0
  25. package/dist/collection/components/grw-common-button/grw-common-button.css.br +0 -0
  26. package/dist/collection/components/grw-common-button/grw-common-button.css.gz +0 -0
  27. package/dist/collection/components/grw-outdoor-course-detail/grw-outdoor-course-detail.js +104 -77
  28. package/dist/collection/components/grw-outdoor-course-detail/grw-outdoor-course-detail.js.br +0 -0
  29. package/dist/collection/components/grw-outdoor-course-detail/grw-outdoor-course-detail.js.gz +0 -0
  30. package/dist/collection/components/grw-outdoor-course-detail/grw-outdoor-course-detail.js.map +1 -1
  31. package/dist/collection/components/grw-outdoor-site-detail/grw-outdoor-site-detail.js +185 -143
  32. package/dist/collection/components/grw-outdoor-site-detail/grw-outdoor-site-detail.js.br +0 -0
  33. package/dist/collection/components/grw-outdoor-site-detail/grw-outdoor-site-detail.js.gz +0 -0
  34. package/dist/collection/components/grw-outdoor-site-detail/grw-outdoor-site-detail.js.map +1 -1
  35. package/dist/collection/components/grw-poi-detail/grw-poi.js +31 -23
  36. package/dist/collection/components/grw-poi-detail/grw-poi.js.br +0 -0
  37. package/dist/collection/components/grw-poi-detail/grw-poi.js.gz +0 -0
  38. package/dist/collection/components/grw-poi-detail/grw-poi.js.map +1 -1
  39. package/dist/collection/components/grw-touristic-content-card/grw-touristic-content-card.js +13 -7
  40. package/dist/collection/components/grw-touristic-content-card/grw-touristic-content-card.js.br +0 -0
  41. package/dist/collection/components/grw-touristic-content-card/grw-touristic-content-card.js.gz +0 -0
  42. package/dist/collection/components/grw-touristic-content-card/grw-touristic-content-card.js.map +1 -1
  43. package/dist/collection/components/grw-touristic-content-detail/grw-touristic-content-detail.js +24 -16
  44. package/dist/collection/components/grw-touristic-content-detail/grw-touristic-content-detail.js.br +0 -0
  45. package/dist/collection/components/grw-touristic-content-detail/grw-touristic-content-detail.js.gz +0 -0
  46. package/dist/collection/components/grw-touristic-content-detail/grw-touristic-content-detail.js.map +1 -1
  47. package/dist/collection/components/grw-touristic-event-card/grw-touristic-event-card.js +13 -7
  48. package/dist/collection/components/grw-touristic-event-card/grw-touristic-event-card.js.br +0 -0
  49. package/dist/collection/components/grw-touristic-event-card/grw-touristic-event-card.js.gz +0 -0
  50. package/dist/collection/components/grw-touristic-event-card/grw-touristic-event-card.js.map +1 -1
  51. package/dist/collection/components/grw-touristic-event-detail/grw-touristic-event-detail.js +24 -16
  52. package/dist/collection/components/grw-touristic-event-detail/grw-touristic-event-detail.js.br +0 -0
  53. package/dist/collection/components/grw-touristic-event-detail/grw-touristic-event-detail.js.gz +0 -0
  54. package/dist/collection/components/grw-touristic-event-detail/grw-touristic-event-detail.js.map +1 -1
  55. package/dist/collection/components/grw-trek-detail/grw-trek-detail.js +157 -120
  56. package/dist/collection/components/grw-trek-detail/grw-trek-detail.js.br +0 -0
  57. package/dist/collection/components/grw-trek-detail/grw-trek-detail.js.gz +0 -0
  58. package/dist/collection/components/grw-trek-detail/grw-trek-detail.js.map +1 -1
  59. package/dist/collection/i18n/i18n.js +4 -0
  60. package/dist/collection/i18n/i18n.js.br +0 -0
  61. package/dist/collection/i18n/i18n.js.gz +0 -0
  62. package/dist/collection/i18n/i18n.js.map +1 -1
  63. package/dist/collection/stories/App.js +2 -1
  64. package/dist/collection/stories/App.js.br +0 -0
  65. package/dist/collection/stories/App.js.gz +0 -0
  66. package/dist/collection/stories/App.stories.js +1 -0
  67. package/dist/collection/stories/App.stories.js.br +0 -0
  68. package/dist/collection/stories/App.stories.js.gz +0 -0
  69. package/dist/esm/grw-app.entry.js +5 -5
  70. package/dist/esm/grw-app.entry.js.br +0 -0
  71. package/dist/esm/grw-app.entry.js.gz +0 -0
  72. package/dist/esm/grw-app.entry.js.map +1 -1
  73. package/dist/esm/grw-common-button_27.entry.js +496 -374
  74. package/dist/esm/grw-common-button_27.entry.js.br +0 -0
  75. package/dist/esm/grw-common-button_27.entry.js.gz +0 -0
  76. package/dist/esm/grw-common-button_27.entry.js.map +1 -1
  77. package/dist/esm/grw-information-desk_3.entry.js +1 -1
  78. package/dist/esm/grw-information-desk_3.entry.js.br +0 -0
  79. package/dist/esm/grw-information-desk_3.entry.js.gz +0 -0
  80. package/dist/esm/grw-poi_3.entry.js +58 -38
  81. package/dist/esm/grw-poi_3.entry.js.br +0 -0
  82. package/dist/esm/grw-poi_3.entry.js.gz +0 -0
  83. package/dist/esm/grw-poi_3.entry.js.map +1 -1
  84. package/dist/esm/{i18n-9a7ac609.js → i18n-84192695.js} +5 -1
  85. package/dist/esm/i18n-84192695.js.br +0 -0
  86. package/dist/esm/i18n-84192695.js.gz +0 -0
  87. package/dist/esm/i18n-84192695.js.map +1 -0
  88. package/dist/esm-es5/grw-app.entry.js +1 -1
  89. package/dist/esm-es5/grw-app.entry.js.br +0 -0
  90. package/dist/esm-es5/grw-app.entry.js.gz +0 -0
  91. package/dist/esm-es5/grw-app.entry.js.map +1 -1
  92. package/dist/esm-es5/grw-common-button_27.entry.js +3 -3
  93. package/dist/esm-es5/grw-common-button_27.entry.js.br +0 -0
  94. package/dist/esm-es5/grw-common-button_27.entry.js.gz +0 -0
  95. package/dist/esm-es5/grw-common-button_27.entry.js.map +1 -1
  96. package/dist/esm-es5/grw-information-desk_3.entry.js +1 -1
  97. package/dist/esm-es5/grw-information-desk_3.entry.js.br +0 -0
  98. package/dist/esm-es5/grw-information-desk_3.entry.js.gz +0 -0
  99. package/dist/esm-es5/grw-poi_3.entry.js +1 -1
  100. package/dist/esm-es5/grw-poi_3.entry.js.br +0 -0
  101. package/dist/esm-es5/grw-poi_3.entry.js.gz +0 -0
  102. package/dist/esm-es5/grw-poi_3.entry.js.map +1 -1
  103. package/dist/esm-es5/i18n-84192695.js +2 -0
  104. package/dist/esm-es5/i18n-84192695.js.br +0 -0
  105. package/dist/esm-es5/i18n-84192695.js.gz +0 -0
  106. package/dist/esm-es5/i18n-84192695.js.map +1 -0
  107. package/dist/geotrek-rando-widget/geotrek-rando-widget.esm.js +1 -1
  108. package/dist/geotrek-rando-widget/geotrek-rando-widget.esm.js.br +0 -0
  109. package/dist/geotrek-rando-widget/geotrek-rando-widget.esm.js.gz +0 -0
  110. package/dist/geotrek-rando-widget/{p-989276bc.entry.js → p-2ed1025e.entry.js} +2 -2
  111. package/dist/geotrek-rando-widget/p-2ed1025e.entry.js.br +0 -0
  112. package/dist/geotrek-rando-widget/p-2ed1025e.entry.js.gz +0 -0
  113. package/dist/geotrek-rando-widget/{p-6f7d6ea5.system.entry.js → p-3ea6b596.system.entry.js} +2 -2
  114. package/dist/geotrek-rando-widget/p-3ea6b596.system.entry.js.br +0 -0
  115. package/dist/geotrek-rando-widget/p-3ea6b596.system.entry.js.gz +0 -0
  116. package/dist/geotrek-rando-widget/p-45fc47d9.entry.js +10 -0
  117. package/dist/geotrek-rando-widget/p-45fc47d9.entry.js.br +0 -0
  118. package/dist/geotrek-rando-widget/p-45fc47d9.entry.js.gz +0 -0
  119. package/dist/geotrek-rando-widget/p-45fc47d9.entry.js.map +1 -0
  120. package/dist/geotrek-rando-widget/p-5d955904.system.js +2 -0
  121. package/dist/geotrek-rando-widget/p-5d955904.system.js.br +0 -0
  122. package/dist/geotrek-rando-widget/p-5d955904.system.js.gz +0 -0
  123. package/dist/geotrek-rando-widget/p-5d955904.system.js.map +1 -0
  124. package/dist/geotrek-rando-widget/p-6b64ae12.js +2 -0
  125. package/dist/geotrek-rando-widget/p-6b64ae12.js.br +0 -0
  126. package/dist/geotrek-rando-widget/p-6b64ae12.js.gz +0 -0
  127. package/dist/geotrek-rando-widget/p-6b64ae12.js.map +1 -0
  128. package/dist/geotrek-rando-widget/p-76e3667f.system.entry.js +2 -0
  129. package/dist/geotrek-rando-widget/p-76e3667f.system.entry.js.br +0 -0
  130. package/dist/geotrek-rando-widget/p-76e3667f.system.entry.js.gz +0 -0
  131. package/dist/geotrek-rando-widget/p-76e3667f.system.entry.js.map +1 -0
  132. package/dist/geotrek-rando-widget/p-775aaaa7.system.js +1 -1
  133. package/dist/geotrek-rando-widget/p-775aaaa7.system.js.br +0 -0
  134. package/dist/geotrek-rando-widget/p-775aaaa7.system.js.gz +0 -0
  135. package/dist/geotrek-rando-widget/{p-6ac9b3f1.entry.js → p-9d7b3f9a.entry.js} +2 -2
  136. package/dist/geotrek-rando-widget/p-9d7b3f9a.entry.js.br +0 -0
  137. package/dist/geotrek-rando-widget/p-9d7b3f9a.entry.js.gz +0 -0
  138. package/dist/geotrek-rando-widget/p-9d7b3f9a.entry.js.map +1 -0
  139. package/dist/geotrek-rando-widget/p-bee90815.system.entry.js +10 -0
  140. package/dist/geotrek-rando-widget/p-bee90815.system.entry.js.br +0 -0
  141. package/dist/geotrek-rando-widget/p-bee90815.system.entry.js.gz +0 -0
  142. package/dist/geotrek-rando-widget/p-bee90815.system.entry.js.map +1 -0
  143. package/dist/geotrek-rando-widget/p-c61ad2b7.entry.js +2 -0
  144. package/dist/geotrek-rando-widget/p-c61ad2b7.entry.js.br +0 -0
  145. package/dist/geotrek-rando-widget/p-c61ad2b7.entry.js.gz +0 -0
  146. package/dist/geotrek-rando-widget/p-c61ad2b7.entry.js.map +1 -0
  147. package/dist/geotrek-rando-widget/{p-01061bf4.system.entry.js → p-f3a9a20f.system.entry.js} +2 -2
  148. package/dist/geotrek-rando-widget/p-f3a9a20f.system.entry.js.br +0 -0
  149. package/dist/geotrek-rando-widget/p-f3a9a20f.system.entry.js.gz +0 -0
  150. package/dist/geotrek-rando-widget/p-f3a9a20f.system.entry.js.map +1 -0
  151. package/dist/types/components/grw-outdoor-course-detail/grw-outdoor-course-detail.d.ts +3 -0
  152. package/dist/types/components/grw-outdoor-site-detail/grw-outdoor-site-detail.d.ts +3 -0
  153. package/dist/types/components/grw-poi-detail/grw-poi.d.ts +2 -0
  154. package/dist/types/components/grw-touristic-content-card/grw-touristic-content-card.d.ts +2 -0
  155. package/dist/types/components/grw-touristic-content-detail/grw-touristic-content-detail.d.ts +2 -0
  156. package/dist/types/components/grw-touristic-event-card/grw-touristic-event-card.d.ts +2 -0
  157. package/dist/types/components/grw-touristic-event-detail/grw-touristic-event-detail.d.ts +2 -0
  158. package/dist/types/components/grw-trek-detail/grw-trek-detail.d.ts +1 -0
  159. package/dist/types/i18n/i18n.d.ts +2 -0
  160. package/package.json +1 -1
  161. package/dist/cjs/i18n-2df02bcf.js.br +0 -0
  162. package/dist/cjs/i18n-2df02bcf.js.gz +0 -0
  163. package/dist/cjs/i18n-2df02bcf.js.map +0 -1
  164. package/dist/esm/i18n-9a7ac609.js.br +0 -0
  165. package/dist/esm/i18n-9a7ac609.js.gz +0 -0
  166. package/dist/esm/i18n-9a7ac609.js.map +0 -1
  167. package/dist/esm-es5/i18n-9a7ac609.js +0 -2
  168. package/dist/esm-es5/i18n-9a7ac609.js.br +0 -0
  169. package/dist/esm-es5/i18n-9a7ac609.js.gz +0 -0
  170. package/dist/esm-es5/i18n-9a7ac609.js.map +0 -1
  171. package/dist/geotrek-rando-widget/p-01061bf4.system.entry.js.br +0 -0
  172. package/dist/geotrek-rando-widget/p-01061bf4.system.entry.js.gz +0 -0
  173. package/dist/geotrek-rando-widget/p-01061bf4.system.entry.js.map +0 -1
  174. package/dist/geotrek-rando-widget/p-105ea0c8.js +0 -2
  175. package/dist/geotrek-rando-widget/p-105ea0c8.js.br +0 -0
  176. package/dist/geotrek-rando-widget/p-105ea0c8.js.gz +0 -0
  177. package/dist/geotrek-rando-widget/p-105ea0c8.js.map +0 -1
  178. package/dist/geotrek-rando-widget/p-2b7b2f0b.entry.js +0 -2
  179. package/dist/geotrek-rando-widget/p-2b7b2f0b.entry.js.br +0 -0
  180. package/dist/geotrek-rando-widget/p-2b7b2f0b.entry.js.gz +0 -0
  181. package/dist/geotrek-rando-widget/p-2b7b2f0b.entry.js.map +0 -1
  182. package/dist/geotrek-rando-widget/p-6ac9b3f1.entry.js.br +0 -0
  183. package/dist/geotrek-rando-widget/p-6ac9b3f1.entry.js.gz +0 -0
  184. package/dist/geotrek-rando-widget/p-6ac9b3f1.entry.js.map +0 -1
  185. package/dist/geotrek-rando-widget/p-6f7d6ea5.system.entry.js.br +0 -0
  186. package/dist/geotrek-rando-widget/p-6f7d6ea5.system.entry.js.gz +0 -0
  187. package/dist/geotrek-rando-widget/p-7e28980f.system.entry.js +0 -10
  188. package/dist/geotrek-rando-widget/p-7e28980f.system.entry.js.br +0 -0
  189. package/dist/geotrek-rando-widget/p-7e28980f.system.entry.js.gz +0 -0
  190. package/dist/geotrek-rando-widget/p-7e28980f.system.entry.js.map +0 -1
  191. package/dist/geotrek-rando-widget/p-989276bc.entry.js.br +0 -0
  192. package/dist/geotrek-rando-widget/p-989276bc.entry.js.gz +0 -0
  193. package/dist/geotrek-rando-widget/p-a2af6c11.entry.js +0 -10
  194. package/dist/geotrek-rando-widget/p-a2af6c11.entry.js.br +0 -0
  195. package/dist/geotrek-rando-widget/p-a2af6c11.entry.js.gz +0 -0
  196. package/dist/geotrek-rando-widget/p-a2af6c11.entry.js.map +0 -1
  197. package/dist/geotrek-rando-widget/p-b4942f58.system.js +0 -2
  198. package/dist/geotrek-rando-widget/p-b4942f58.system.js.br +0 -0
  199. package/dist/geotrek-rando-widget/p-b4942f58.system.js.gz +0 -0
  200. package/dist/geotrek-rando-widget/p-b4942f58.system.js.map +0 -1
  201. package/dist/geotrek-rando-widget/p-c5a341b3.system.entry.js +0 -2
  202. package/dist/geotrek-rando-widget/p-c5a341b3.system.entry.js.br +0 -0
  203. package/dist/geotrek-rando-widget/p-c5a341b3.system.entry.js.gz +0 -0
  204. package/dist/geotrek-rando-widget/p-c5a341b3.system.entry.js.map +0 -1
  205. /package/dist/geotrek-rando-widget/{p-989276bc.entry.js.map → p-2ed1025e.entry.js.map} +0 -0
  206. /package/dist/geotrek-rando-widget/{p-6f7d6ea5.system.entry.js.map → p-3ea6b596.system.entry.js.map} +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"grw-poi.js","sourceRoot":"","sources":["../../../src/components/grw-poi-detail/grw-poi.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAC7F,OAAO,MAAM,EAAE,EAAE,UAAU,EAAE,UAAU,EAAE,QAAQ,EAAE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AwB,EAAC,OAAO,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,oBAAoB,EAAE,IACzG,IAAI,CAAC,wBAAwB,IAAI,CAAC,IAAI,CAAC,uBAAuB,CAAC,CAAC,CAAC,SAAS,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,QAAQ,CAAC,CACtI,CACF,CACD,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Host, h, Prop, State, Build, getAssetPath, Listen } from '@stencil/core';\nimport Swiper, { Navigation, Pagination, Keyboard } from 'swiper';\nimport state from 'store/store';\nimport { OutdoorSite, Poi, Trek } from 'types/types';\nimport { translate } from 'i18n/i18n';\nimport { getDataInStore } from 'services/grw-db.service';\n\n@Component({\n tag: 'grw-poi',\n styleUrl: 'grw-poi.scss',\n shadow: true,\n})\nexport class GrwPoiDetail {\n swiperPoi?: Swiper;\n swiperPoiRef?: HTMLDivElement;\n prevElPoiRef?: HTMLDivElement;\n nextElPoiRef?: HTMLDivElement;\n paginationElPoiRef?: HTMLDivElement;\n descriptionRef?: HTMLDivElement;\n\n @Prop() poi: Poi;\n @State() displayShortDescription = true;\n @State() showPoiDescriptionButton = false;\n @State() displayFullscreen = false;\n\n @State() offline = false;\n\n @Listen('trekDownloadedSuccessConfirm', { target: 'window' })\n onTrekDownloadedSuccessConfirm() {\n if (this.swiperPoi) {\n this.swiperPoi.slideTo(0);\n }\n this.offline = true;\n }\n\n @Listen('trekDeleteSuccessConfirm', { target: 'window' })\n onTrekDeleteSuccessConfirm() {\n this.offline = false;\n }\n\n componentDidLoad() {\n this.handleOffline();\n this.swiperPoi = new Swiper(this.swiperPoiRef, {\n modules: [Navigation, Pagination, Keyboard],\n navigation: {\n prevEl: this.prevElPoiRef,\n nextEl: this.nextElPoiRef,\n },\n pagination: { el: this.paginationElPoiRef },\n allowTouchMove: false,\n keyboard: false,\n loop: true,\n });\n this.swiperPoiRef.onfullscreenchange = () => {\n this.displayFullscreen = !this.displayFullscreen && !this.offline;\n if (this.displayFullscreen) {\n this.swiperPoi.keyboard.enable();\n } else {\n this.swiperPoi.keyboard.disable();\n }\n };\n this.showPoiDescriptionButton = this.descriptionRef.clientHeight < this.descriptionRef.scrollHeight;\n }\n\n handlePoiDescription() {\n this.displayShortDescription = !this.displayShortDescription;\n }\n\n handleFullscreen() {\n if (this.poi.attachments && this.poi.attachments[0] && this.poi.attachments[0].url) {\n this.swiperPoiRef.requestFullscreen();\n }\n }\n\n async handleOffline() {\n if (state.currentTrek) {\n const trekInStore: Trek = await getDataInStore('treks', state.currentTrek.id);\n const poiInStore: Poi = await getDataInStore('pois', this.poi.id);\n if (trekInStore && trekInStore.offline) {\n this.offline = Boolean(poiInStore);\n }\n } else if (state.currentOutdoorSite) {\n const outdoorSiteInStore: OutdoorSite = await getDataInStore('outdoorSites', state.currentOutdoorSite.id);\n if (outdoorSiteInStore && outdoorSiteInStore.offline) {\n const poiInStore: Poi = await getDataInStore('pois', this.poi.id);\n this.offline = Boolean(poiInStore);\n }\n }\n }\n\n render() {\n const defaultImageSrc = getAssetPath(`${Build.isDev ? '/' : ''}assets/default-image.svg`);\n return (\n <Host>\n <div part=\"poi-type-img-container\" class=\"poi-type-img-container\">\n <img part=\"poi-type\" class=\"poi-type\" src={`${state.poiTypes.find(poiType => poiType.id === this.poi.type)?.pictogram}`} alt=\"\" />\n <div part=\"swiper-poi\" class=\"swiper swiper-poi\" ref={el => (this.swiperPoiRef = el)}>\n <div part=\"swiper-wrapper\" class=\"swiper-wrapper\">\n {this.poi.attachments.filter(attachment => attachment.type === 'image').length > 0 ? (\n this.poi.attachments\n .filter(attachment => attachment.type === 'image')\n .map(attachment => (\n <div part=\"swiper-slide\" class=\"swiper-slide\">\n <img\n part=\"poi-iamg\"\n class={`poi-img${this.displayFullscreen ? ' img-fullscreen' : ''}`}\n src={this.displayFullscreen ? attachment.url : attachment.thumbnail}\n alt={attachment.legend}\n loading=\"lazy\"\n /* @ts-ignore */\n onerror={event => {\n event.target.onerror = null;\n event.target.className = 'default-poi-img';\n event.target.src = defaultImageSrc;\n }}\n onClick={() => this.handleFullscreen()}\n />\n </div>\n ))\n ) : (\n <div part=\"swiper-slide\" class=\"swiper-slide\">\n <img part=\"default-poi-img\" class=\"default-poi-img\" src={defaultImageSrc} alt=\"\" loading=\"lazy\" />\n </div>\n )}\n </div>\n <div\n style={{ display: this.offline || this.poi.attachments.filter(attachment => attachment.type === 'image').length <= 1 ? 'none' : 'block' }}\n part=\"swiper-pagination\"\n class=\"swiper-pagination\"\n ref={el => (this.paginationElPoiRef = el)}\n ></div>\n <div\n style={{ display: this.offline || this.poi.attachments.filter(attachment => attachment.type === 'image').length <= 1 ? 'none' : 'flex' }}\n part=\"swiper-button-prev\"\n class=\"swiper-button-prev\"\n ref={el => (this.prevElPoiRef = el)}\n ></div>\n <div\n style={{ display: this.offline || this.poi.attachments.filter(attachment => attachment.type === 'image').length <= 1 ? 'none' : 'flex' }}\n part=\"swiper-button-next\"\n class=\"swiper-button-next\"\n ref={el => (this.nextElPoiRef = el)}\n ></div>\n </div>\n </div>\n <div part=\"poi-sub-container\" class=\"poi-sub-container\">\n <div part=\"poi-name\" class=\"poi-name\">\n {this.poi.name}\n </div>\n <div\n part=\"poi-description\"\n class={this.displayShortDescription ? 'poi-description poi-description-short' : 'poi-description'}\n innerHTML={this.poi.description}\n ref={el => (this.descriptionRef = el)}\n ></div>\n <div part=\"handle-poi-description\" class=\"handle-poi-description\" onClick={() => this.handlePoiDescription()}>\n {this.showPoiDescriptionButton && (this.displayShortDescription ? translate[state.language].readMore : translate[state.language].readLess)}\n </div>\n </div>\n </Host>\n );\n }\n}\n"]}
1
+ {"version":3,"file":"grw-poi.js","sourceRoot":"","sources":["../../../src/components/grw-poi-detail/grw-poi.tsx"],"names":[],"mappings":"AAAA,OA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AAwB,EAAC,OAAO,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,oBAAoB,EAAE,IACzG,IAAI,CAAC,wBAAwB,IAAI,CAAC,IAAI,CAAC,uBAAuB,CAAC,CAAC,CAAC,SAAS,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,QAAQ,CAAC,CACtI,CACF,CACD,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Host, h, Prop, State, Build, getAssetPath, Listen } from '@stencil/core';\nimport Swiper, { Navigation, Pagination, Keyboard } from 'swiper';\nimport state from 'store/store';\nimport { OutdoorSite, Poi, Trek } from 'types/types';\nimport { translate } from 'i18n/i18n';\nimport { getDataInStore } from 'services/grw-db.service';\n\n@Component({\n tag: 'grw-poi',\n styleUrl: 'grw-poi.scss',\n shadow: true,\n})\nexport class GrwPoiDetail {\n swiperPoi?: Swiper;\n swiperPoiRef?: HTMLDivElement;\n prevElPoiRef?: HTMLDivElement;\n nextElPoiRef?: HTMLDivElement;\n paginationElPoiRef?: HTMLDivElement;\n descriptionRef?: HTMLDivElement;\n\n @Prop() poi: Poi;\n @State() displayShortDescription = true;\n @State() showPoiDescriptionButton = false;\n @State() displayFullscreen = false;\n\n @State() offline = false;\n\n @Listen('trekDownloadedSuccessConfirm', { target: 'window' })\n onTrekDownloadedSuccessConfirm() {\n if (this.swiperPoi) {\n this.swiperPoi.slideTo(0);\n }\n this.offline = true;\n }\n\n @Listen('trekDeleteSuccessConfirm', { target: 'window' })\n onTrekDeleteSuccessConfirm() {\n this.offline = false;\n }\n\n handleSwipers() {\n if (this.swiperPoiRef && !this.swiperPoi) {\n this.swiperPoi = new Swiper(this.swiperPoiRef, {\n modules: [Navigation, Pagination, Keyboard],\n navigation: {\n prevEl: this.prevElPoiRef,\n nextEl: this.nextElPoiRef,\n },\n pagination: { el: this.paginationElPoiRef },\n allowTouchMove: false,\n keyboard: false,\n loop: true,\n });\n this.swiperPoiRef.onfullscreenchange = () => {\n this.displayFullscreen = !this.displayFullscreen && !this.offline;\n if (this.displayFullscreen) {\n this.swiperPoi.keyboard.enable();\n } else {\n this.swiperPoi.keyboard.disable();\n }\n };\n this.showPoiDescriptionButton = this.descriptionRef.clientHeight < this.descriptionRef.scrollHeight;\n }\n }\n\n componentDidUpdate() {\n this.handleSwipers();\n }\n\n componentDidLoad() {\n this.handleOffline();\n this.handleSwipers();\n }\n\n handlePoiDescription() {\n this.displayShortDescription = !this.displayShortDescription;\n }\n\n handleFullscreen() {\n if (this.poi.attachments && this.poi.attachments[0] && this.poi.attachments[0].url) {\n this.swiperPoiRef.requestFullscreen();\n }\n }\n\n async handleOffline() {\n if (state.currentTrek) {\n const trekInStore: Trek = await getDataInStore('treks', state.currentTrek.id);\n const poiInStore: Poi = await getDataInStore('pois', this.poi.id);\n if (trekInStore && trekInStore.offline) {\n this.offline = Boolean(poiInStore);\n }\n } else if (state.currentOutdoorSite) {\n const outdoorSiteInStore: OutdoorSite = await getDataInStore('outdoorSites', state.currentOutdoorSite.id);\n if (outdoorSiteInStore && outdoorSiteInStore.offline) {\n const poiInStore: Poi = await getDataInStore('pois', this.poi.id);\n this.offline = Boolean(poiInStore);\n }\n }\n }\n\n render() {\n const defaultImageSrc = getAssetPath(`${Build.isDev ? '/' : ''}assets/default-image.svg`);\n return (\n <Host>\n <div part=\"poi-type-img-container\" class=\"poi-type-img-container\">\n <img part=\"poi-type\" class=\"poi-type\" src={`${state.poiTypes.find(poiType => poiType.id === this.poi.type)?.pictogram}`} alt=\"\" />\n <div part=\"swiper-poi\" class=\"swiper swiper-poi\" ref={el => (this.swiperPoiRef = el)}>\n <div part=\"swiper-wrapper\" class=\"swiper-wrapper\">\n {this.poi.attachments.filter(attachment => attachment.type === 'image').length > 0 ? (\n this.poi.attachments\n .filter(attachment => attachment.type === 'image')\n .map(attachment => (\n <div part=\"swiper-slide\" class=\"swiper-slide\">\n <img\n part=\"poi-iamg\"\n class={`poi-img${this.displayFullscreen ? ' img-fullscreen' : ''}`}\n src={this.displayFullscreen ? attachment.url : attachment.thumbnail}\n alt={attachment.legend}\n loading=\"lazy\"\n /* @ts-ignore */\n onerror={event => {\n event.target.onerror = null;\n event.target.className = 'default-poi-img';\n event.target.src = defaultImageSrc;\n }}\n onClick={() => this.handleFullscreen()}\n />\n </div>\n ))\n ) : (\n <div part=\"swiper-slide\" class=\"swiper-slide\">\n <img part=\"default-poi-img\" class=\"default-poi-img\" src={defaultImageSrc} alt=\"\" loading=\"lazy\" />\n </div>\n )}\n </div>\n <div style={{ display: this.offline ? 'none' : 'block' }} part=\"swiper-pagination\" class=\"swiper-pagination\" ref={el => (this.paginationElPoiRef = el)}></div>\n <div style={{ display: this.offline ? 'none' : 'flex' }} part=\"swiper-button-prev\" class=\"swiper-button-prev\" ref={el => (this.prevElPoiRef = el)}></div>\n <div style={{ display: this.offline ? 'none' : 'flex' }} part=\"swiper-button-next\" class=\"swiper-button-next\" ref={el => (this.nextElPoiRef = el)}></div>\n </div>\n </div>\n <div part=\"poi-sub-container\" class=\"poi-sub-container\">\n <div part=\"poi-name\" class=\"poi-name\">\n {this.poi.name}\n </div>\n <div\n part=\"poi-description\"\n class={this.displayShortDescription ? 'poi-description poi-description-short' : 'poi-description'}\n innerHTML={this.poi.description}\n ref={el => (this.descriptionRef = el)}\n ></div>\n <div part=\"handle-poi-description\" class=\"handle-poi-description\" onClick={() => this.handlePoiDescription()}>\n {this.showPoiDescriptionButton && (this.displayShortDescription ? translate[state.language].readMore : translate[state.language].readLess)}\n </div>\n </div>\n </Host>\n );\n }\n}\n"]}
@@ -20,9 +20,8 @@ export class GrwTouristicContentCard {
20
20
  onTrekDeleteSuccessConfirm() {
21
21
  this.offline = false;
22
22
  }
23
- componentDidLoad() {
24
- this.handleOffline();
25
- if (this.swiperTouristicContentRef) {
23
+ handleSwipers() {
24
+ if (this.swiperTouristicContentRef && !this.swiperTouristicContent) {
26
25
  this.swiperTouristicContent = new Swiper(this.swiperTouristicContentRef, {
27
26
  modules: [Navigation, Pagination, Keyboard],
28
27
  navigation: {
@@ -45,6 +44,13 @@ export class GrwTouristicContentCard {
45
44
  };
46
45
  }
47
46
  }
47
+ componentDidUpdate() {
48
+ this.handleSwipers();
49
+ }
50
+ componentDidLoad() {
51
+ this.handleOffline();
52
+ this.handleSwipers();
53
+ }
48
54
  async handleOffline() {
49
55
  if (state.currentTrek) {
50
56
  const trekInStore = await getDataInStore('treks', state.currentTrek.id);
@@ -75,16 +81,16 @@ export class GrwTouristicContentCard {
75
81
  render() {
76
82
  const defaultImageSrc = getAssetPath(`${Build.isDev ? '/' : ''}assets/default-image.svg`);
77
83
  const touristicContentCategory = state.touristicContentCategories.find(touristicContentCategory => touristicContentCategory.id === this.touristicContent.category);
78
- return (h(Host, { key: '0c9f15a500e4f900e652ea6c2af729999d995fb2', style: {
84
+ return (h(Host, { key: 'fae16e24fd7f9b2ae395c4393d3a9fb26acc18db', style: {
79
85
  '--font-family': this.fontFamily,
80
86
  'width': this.isLargeView ? '100%' : 'auto',
81
- } }, h("div", { key: '075f7dbdbde68395fd130333c0494ce90ec41a10', part: "touristic-content-card", class: this.isLargeView
87
+ } }, h("div", { key: 'cc30449024b21d5b474c596be39bf86247193b58', part: "touristic-content-card", class: this.isLargeView
82
88
  ? `touristic-content-card touristic-content-card-large-view-container${state.selectedTouristicContentId === this.touristicContent.id ? ' selected-touristic-content-card' : ''}${!this.isInsideHorizontalList ? ' is-inside-vertical-list' : ''}`
83
89
  : `touristic-content-card touristic-content-card-container${state.selectedTouristicContentId === this.touristicContent.id ? ' selected-touristic-content-card' : ''}${!this.isInsideHorizontalList ? ' is-inside-vertical-list' : ''}`, onClick: () => {
84
90
  if (!this.isInsideHorizontalList) {
85
91
  this.touristicContentCardPress.emit(this.touristicContent.id);
86
92
  }
87
- } }, h("div", { key: '4a1a376ae5ea555155c67182796da351d3b1fa99', part: "touristic-content-img-container", class: "touristic-content-img-container" }, this.isInsideHorizontalList ? (h("div", { part: "swiper-touristic-content", class: "swiper swiper-touristic-content", ref: el => (this.swiperTouristicContentRef = el) }, h("div", { part: "swiper-wrapper", class: "swiper-wrapper" }, this.touristicContent.attachments.filter(attachment => attachment.type === 'image').length > 0 ? (this.touristicContent.attachments
93
+ } }, h("div", { key: 'be3b7a0d92aacbb446edfb1fd0411677b95413d2', part: "touristic-content-img-container", class: "touristic-content-img-container" }, this.isInsideHorizontalList ? (h("div", { part: "swiper-touristic-content", class: "swiper swiper-touristic-content", ref: el => (this.swiperTouristicContentRef = el) }, h("div", { part: "swiper-wrapper", class: "swiper-wrapper" }, this.touristicContent.attachments.filter(attachment => attachment.type === 'image').length > 0 ? (this.touristicContent.attachments
88
94
  .filter(attachment => attachment.type === 'image')
89
95
  .map(attachment => (h("div", { part: "swiper-slide", class: "swiper-slide" }, h("img", { part: "touristic-content-img", class: `touristic-content-img${this.displayFullscreen ? ' img-fullscreen' : ''}`, src: this.displayFullscreen ? (this.offline ? attachment.thumbnail : attachment.url) : attachment.thumbnail, loading: "lazy",
90
96
  /* @ts-ignore */
@@ -92,7 +98,7 @@ export class GrwTouristicContentCard {
92
98
  event.target.onerror = null;
93
99
  event.target.className = 'default-touristic-content-img';
94
100
  event.target.src = defaultImageSrc;
95
- }, onClick: () => this.handleFullscreen(), alt: attachment.legend }))))) : (h("div", { part: "swiper-slide", class: "swiper-slide" }, h("img", { part: "default-touristic-content-img", src: defaultImageSrc, class: "default-touristic-content-img", alt: "", loading: "lazy" })))), h("div", { style: { display: this.offline || this.touristicContent.attachments.filter(attachment => attachment.type === 'image').length <= 1 ? 'none' : 'block' }, part: "swiper-pagination", class: "swiper-pagination", ref: el => (this.paginationElTouristicContentRef = el) }), h("div", { style: { display: this.offline || this.touristicContent.attachments.filter(attachment => attachment.type === 'image').length <= 1 ? 'none' : 'block' }, part: "swiper-button-prev", class: "swiper-button-prev", ref: el => (this.prevElTouristicContentRef = el) }), h("div", { style: { display: this.offline || this.touristicContent.attachments.filter(attachment => attachment.type === 'image').length <= 1 ? 'none' : 'block' }, part: "swiper-button-next", class: "swiper-button-next", ref: el => (this.nextElTouristicContentRef = el) }))) : this.touristicContent.attachments.filter(attachment => attachment.type === 'image').length > 0 ? (h("img", { part: "touristic-content-img", class: "touristic-content-img", src: `${this.touristicContent.attachments.filter(attachment => attachment.type === 'image')[0].thumbnail}`, alt: `${this.touristicContent.attachments.filter(attachment => attachment.type === 'image')[0].legend}`, loading: "lazy" })) : (h("img", { class: "image default-touristic-content-img", src: defaultImageSrc, loading: "lazy", alt: "" }))), h("div", { key: 'ef813da044c9f3b59278369bcc60a6e8dca83382', part: "touristic-content-sub-container", class: "touristic-content-sub-container" }, h("div", { key: 'd825be6661fe819df3f7cb8eb4c94e627db7add5', part: "touristic-content-category-container", class: "touristic-content-category-container" }, touristicContentCategory && touristicContentCategory.pictogram && (h("img", { part: "touristic-content-category-img", class: "touristic-content-category-img", src: touristicContentCategory.pictogram, alt: "" })), h("div", { key: '050a482f39a43905513701c7851a63b4620b7487', part: "touristic-content-category-name", class: "touristic-content-category-name" }, touristicContentCategory.label)), h("div", { key: 'aa423019b5a54b6a5e53a296dec2c93a0b5c097f', part: "touristic-content-name", class: "touristic-content-name" }, this.touristicContent.name)), this.isInsideHorizontalList && (h("div", { part: "touristic-content-more-detail-container", class: "touristic-content-more-detail-container" }, h("button", { part: "more-details-button", class: "more-details-button", onClick: () => this.touristicContentCardPress.emit(this.touristicContent.id) }, "Plus de d\u00E9tails"))))));
101
+ }, onClick: () => this.handleFullscreen(), alt: attachment.legend }))))) : (h("div", { part: "swiper-slide", class: "swiper-slide" }, h("img", { part: "default-touristic-content-img", src: defaultImageSrc, class: "default-touristic-content-img", alt: "", loading: "lazy" })))), h("div", { style: { display: this.offline ? 'none' : 'block' }, part: "swiper-pagination", class: "swiper-pagination", ref: el => (this.paginationElTouristicContentRef = el) }), h("div", { style: { display: this.offline ? 'none' : 'flex' }, part: "swiper-button-prev", class: "swiper-button-prev", ref: el => (this.prevElTouristicContentRef = el) }), h("div", { style: { display: this.offline ? 'none' : 'flex' }, part: "swiper-button-next", class: "swiper-button-next", ref: el => (this.nextElTouristicContentRef = el) }))) : this.touristicContent.attachments.filter(attachment => attachment.type === 'image').length > 0 ? (h("img", { part: "touristic-content-img", class: "touristic-content-img", src: `${this.touristicContent.attachments.filter(attachment => attachment.type === 'image')[0].thumbnail}`, alt: `${this.touristicContent.attachments.filter(attachment => attachment.type === 'image')[0].legend}`, loading: "lazy" })) : (h("img", { class: "image default-touristic-content-img", src: defaultImageSrc, loading: "lazy", alt: "" }))), h("div", { key: 'f9238be9feb7faff38f04d4a367ebaf7df83522e', part: "touristic-content-sub-container", class: "touristic-content-sub-container" }, h("div", { key: '9eada8f244529c1fa64b9162185a315b89634802', part: "touristic-content-category-container", class: "touristic-content-category-container" }, touristicContentCategory && touristicContentCategory.pictogram && (h("img", { part: "touristic-content-category-img", class: "touristic-content-category-img", src: touristicContentCategory.pictogram, alt: "" })), h("div", { key: '7f371b852730cddde844e5c7255c67a84b43e2aa', part: "touristic-content-category-name", class: "touristic-content-category-name" }, touristicContentCategory.label)), h("div", { key: 'ac31930c2f67b4f4f253e02da4db8e43188fe1bb', part: "touristic-content-name", class: "touristic-content-name" }, this.touristicContent.name)), this.isInsideHorizontalList && (h("div", { part: "touristic-content-more-detail-container", class: "touristic-content-more-detail-container" }, h("button", { part: "more-details-button", class: "more-details-button", onClick: () => this.touristicContentCardPress.emit(this.touristicContent.id) }, "Plus de d\u00E9tails"))))));
96
102
  }
97
103
  static get is() { return "grw-touristic-content-card"; }
98
104
  static get encapsulation() { return "shadow"; }
@@ -1 +1 @@
1
- {"version":3,"file":"grw-touristic-content-card.js","sourceRoot":"","sources":["../../../src/components/grw-touristic-content-card/grw-touristic-content-card.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,IAAI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;;;;;;;;;;;;CACF","sourcesContent":["import { Build, Component, Host, getAssetPath, h, State, Prop, Event, EventEmitter, Listen } from '@stencil/core';\nimport { getDataInStore } from 'services/grw-db.service';\nimport state from 'store/store';\nimport Swiper, { Keyboard, Navigation, Pagination } from 'swiper';\nimport { OutdoorSite, TouristicContent, Trek } from 'types/types';\n\n@Component({\n tag: 'grw-touristic-content-card',\n styleUrl: 'grw-touristic-content-card.scss',\n shadow: true,\n})\nexport class GrwTouristicContentCard {\n @Event() touristicContentCardPress: EventEmitter<number>;\n swiperTouristicContent?: Swiper;\n swiperTouristicContentRef?: HTMLDivElement;\n prevElTouristicContentRef?: HTMLDivElement;\n nextElTouristicContentRef?: HTMLDivElement;\n paginationElTouristicContentRef?: HTMLDivElement;\n\n @Prop() fontFamily = 'Roboto';\n\n @Prop() touristicContent: TouristicContent;\n @Prop() isLargeView = false;\n @Prop() isInsideHorizontalList = false;\n @State() displayFullscreen = false;\n\n @Event() cardTouristicContentMouseOver: EventEmitter<number>;\n @Event() cardTouristicContentMouseLeave: EventEmitter;\n\n @State() offline = false;\n\n @Listen('trekDownloadedSuccessConfirm', { target: 'window' })\n onTrekDownloadedSuccessConfirm() {\n if (this.swiperTouristicContent) {\n this.swiperTouristicContent.slideTo(0);\n }\n this.offline = true;\n }\n\n @Listen('trekDeleteSuccessConfirm', { target: 'window' })\n onTrekDeleteSuccessConfirm() {\n this.offline = false;\n }\n\n componentDidLoad() {\n this.handleOffline();\n if (this.swiperTouristicContentRef) {\n this.swiperTouristicContent = new Swiper(this.swiperTouristicContentRef, {\n modules: [Navigation, Pagination, Keyboard],\n navigation: {\n prevEl: this.prevElTouristicContentRef,\n nextEl: this.nextElTouristicContentRef,\n },\n pagination: { el: this.paginationElTouristicContentRef },\n allowTouchMove: false,\n keyboard: false,\n loop: true,\n });\n this.swiperTouristicContentRef.onfullscreenchange = () => {\n this.displayFullscreen = !this.displayFullscreen && !this.offline;\n if (this.displayFullscreen) {\n this.swiperTouristicContent.keyboard.enable();\n } else {\n this.swiperTouristicContent.keyboard.disable();\n }\n };\n }\n }\n\n async handleOffline() {\n if (state.currentTrek) {\n const trekInStore: Trek = await getDataInStore('treks', state.currentTrek.id);\n if (trekInStore && trekInStore.offline) {\n const touristicContentInStore: TouristicContent = await getDataInStore('touristicContents', this.touristicContent.id);\n this.offline = touristicContentInStore && touristicContentInStore.offline;\n }\n } else if (state.currentOutdoorSite) {\n const outdoorSiteInStore: OutdoorSite = await getDataInStore('outdoorSites', state.currentOutdoorSite.id);\n if (outdoorSiteInStore && outdoorSiteInStore.offline) {\n const touristicContentInStore: TouristicContent = await getDataInStore('touristicContents', this.touristicContent.id);\n this.offline = touristicContentInStore && touristicContentInStore.offline;\n }\n }\n }\n\n handleFullscreen() {\n if (this.touristicContent.attachments && this.touristicContent.attachments[0] && this.touristicContent.attachments[0].url) {\n this.swiperTouristicContentRef.requestFullscreen();\n }\n }\n\n @Listen('mouseover')\n handleMouseOver() {\n this.cardTouristicContentMouseOver.emit(this.touristicContent.id);\n }\n\n @Listen('mouseleave')\n handleMouseLeave() {\n this.cardTouristicContentMouseLeave.emit();\n }\n\n render() {\n const defaultImageSrc = getAssetPath(`${Build.isDev ? '/' : ''}assets/default-image.svg`);\n const touristicContentCategory = state.touristicContentCategories.find(touristicContentCategory => touristicContentCategory.id === this.touristicContent.category);\n return (\n <Host\n style={{\n '--font-family': this.fontFamily,\n 'width': this.isLargeView ? '100%' : 'auto',\n }}\n >\n <div\n part=\"touristic-content-card\"\n class={\n this.isLargeView\n ? `touristic-content-card touristic-content-card-large-view-container${\n state.selectedTouristicContentId === this.touristicContent.id ? ' selected-touristic-content-card' : ''\n }${!this.isInsideHorizontalList ? ' is-inside-vertical-list' : ''}`\n : `touristic-content-card touristic-content-card-container${state.selectedTouristicContentId === this.touristicContent.id ? ' selected-touristic-content-card' : ''}${\n !this.isInsideHorizontalList ? ' is-inside-vertical-list' : ''\n }`\n }\n onClick={() => {\n if (!this.isInsideHorizontalList) {\n this.touristicContentCardPress.emit(this.touristicContent.id);\n }\n }}\n >\n <div part=\"touristic-content-img-container\" class=\"touristic-content-img-container\">\n {this.isInsideHorizontalList ? (\n <div part=\"swiper-touristic-content\" class=\"swiper swiper-touristic-content\" ref={el => (this.swiperTouristicContentRef = el)}>\n <div part=\"swiper-wrapper\" class=\"swiper-wrapper\">\n {this.touristicContent.attachments.filter(attachment => attachment.type === 'image').length > 0 ? (\n this.touristicContent.attachments\n .filter(attachment => attachment.type === 'image')\n .map(attachment => (\n <div part=\"swiper-slide\" class=\"swiper-slide\">\n <img\n part=\"touristic-content-img\"\n class={`touristic-content-img${this.displayFullscreen ? ' img-fullscreen' : ''}`}\n src={this.displayFullscreen ? (this.offline ? attachment.thumbnail : attachment.url) : attachment.thumbnail}\n loading=\"lazy\"\n /* @ts-ignore */\n onerror={event => {\n event.target.onerror = null;\n event.target.className = 'default-touristic-content-img';\n event.target.src = defaultImageSrc;\n }}\n onClick={() => this.handleFullscreen()}\n alt={attachment.legend}\n />\n </div>\n ))\n ) : (\n <div part=\"swiper-slide\" class=\"swiper-slide\">\n <img part=\"default-touristic-content-img\" src={defaultImageSrc} class=\"default-touristic-content-img\" alt=\"\" loading=\"lazy\" />\n </div>\n )}\n </div>\n <div\n style={{ display: this.offline || this.touristicContent.attachments.filter(attachment => attachment.type === 'image').length <= 1 ? 'none' : 'block' }}\n part=\"swiper-pagination\"\n class=\"swiper-pagination\"\n ref={el => (this.paginationElTouristicContentRef = el)}\n ></div>\n <div\n style={{ display: this.offline || this.touristicContent.attachments.filter(attachment => attachment.type === 'image').length <= 1 ? 'none' : 'block' }}\n part=\"swiper-button-prev\"\n class=\"swiper-button-prev\"\n ref={el => (this.prevElTouristicContentRef = el)}\n ></div>\n <div\n style={{ display: this.offline || this.touristicContent.attachments.filter(attachment => attachment.type === 'image').length <= 1 ? 'none' : 'block' }}\n part=\"swiper-button-next\"\n class=\"swiper-button-next\"\n ref={el => (this.nextElTouristicContentRef = el)}\n ></div>\n </div>\n ) : this.touristicContent.attachments.filter(attachment => attachment.type === 'image').length > 0 ? (\n <img\n part=\"touristic-content-img\"\n class=\"touristic-content-img\"\n src={`${this.touristicContent.attachments.filter(attachment => attachment.type === 'image')[0].thumbnail}`}\n alt={`${this.touristicContent.attachments.filter(attachment => attachment.type === 'image')[0].legend}`}\n loading=\"lazy\"\n />\n ) : (\n <img class=\"image default-touristic-content-img\" src={defaultImageSrc} loading=\"lazy\" alt=\"\" />\n )}\n </div>\n <div part=\"touristic-content-sub-container\" class=\"touristic-content-sub-container\">\n <div part=\"touristic-content-category-container\" class=\"touristic-content-category-container\">\n {touristicContentCategory && touristicContentCategory.pictogram && (\n <img part=\"touristic-content-category-img\" class=\"touristic-content-category-img\" src={touristicContentCategory.pictogram} alt=\"\" />\n )}\n <div part=\"touristic-content-category-name\" class=\"touristic-content-category-name\">\n {touristicContentCategory.label}\n </div>\n </div>\n <div part=\"touristic-content-name\" class=\"touristic-content-name\">\n {this.touristicContent.name}\n </div>\n </div>\n {this.isInsideHorizontalList && (\n <div part=\"touristic-content-more-detail-container\" class=\"touristic-content-more-detail-container\">\n <button part=\"more-details-button\" class=\"more-details-button\" onClick={() => this.touristicContentCardPress.emit(this.touristicContent.id)}>\n Plus de détails\n </button>\n </div>\n )}\n </div>\n </Host>\n );\n }\n}\n"]}
1
+ {"version":3,"file":"grw-touristic-content-card.js","sourceRoot":"","sources":["../../../src/components/grw-touristic-content-card/grw-touristic-content-card.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,IAAI,EAAE,YAAY,EAAE,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAgB,MAAM,EAAE,MAAM,eAAe,CAAC;AAClH,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AACzD,OAAO,KAAK,MAAM,aAAa,CAAC;AAChC,OAAO,MAAM,EAAE,EAAE,QAAQ,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,QAAQ,CAA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AI,EAAC,iCAAiC,EAAC,KAAK,EAAC,iCAAiC,IAChF,wBAAwB,CAAC,KAAK,CAC3B,CACF;oBACN,4DAAK,IAAI,EAAC,wBAAwB,EAAC,KAAK,EAAC,wBAAwB,IAC9D,IAAI,CAAC,gBAAgB,CAAC,IAAI,CACvB,CACF;gBACL,IAAI,CAAC,sBAAsB,IAAI,CAC9B,WAAK,IAAI,EAAC,yCAAyC,EAAC,KAAK,EAAC,yCAAyC;oBACjG,cAAQ,IAAI,EAAC,qBAAqB,EAAC,KAAK,EAAC,qBAAqB,EAAC,OAAO,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,yBAAyB,CAAC,IAAI,CAAC,IAAI,CAAC,gBAAgB,CAAC,EAAE,CAAC,2BAElI,CACL,CACP,CACG,CACD,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Build, Component, Host, getAssetPath, h, State, Prop, Event, EventEmitter, Listen } from '@stencil/core';\nimport { getDataInStore } from 'services/grw-db.service';\nimport state from 'store/store';\nimport Swiper, { Keyboard, Navigation, Pagination } from 'swiper';\nimport { OutdoorSite, TouristicContent, Trek } from 'types/types';\n\n@Component({\n tag: 'grw-touristic-content-card',\n styleUrl: 'grw-touristic-content-card.scss',\n shadow: true,\n})\nexport class GrwTouristicContentCard {\n @Event() touristicContentCardPress: EventEmitter<number>;\n swiperTouristicContent?: Swiper;\n swiperTouristicContentRef?: HTMLDivElement;\n prevElTouristicContentRef?: HTMLDivElement;\n nextElTouristicContentRef?: HTMLDivElement;\n paginationElTouristicContentRef?: HTMLDivElement;\n\n @Prop() fontFamily = 'Roboto';\n\n @Prop() touristicContent: TouristicContent;\n @Prop() isLargeView = false;\n @Prop() isInsideHorizontalList = false;\n @State() displayFullscreen = false;\n\n @Event() cardTouristicContentMouseOver: EventEmitter<number>;\n @Event() cardTouristicContentMouseLeave: EventEmitter;\n\n @State() offline = false;\n\n @Listen('trekDownloadedSuccessConfirm', { target: 'window' })\n onTrekDownloadedSuccessConfirm() {\n if (this.swiperTouristicContent) {\n this.swiperTouristicContent.slideTo(0);\n }\n this.offline = true;\n }\n\n @Listen('trekDeleteSuccessConfirm', { target: 'window' })\n onTrekDeleteSuccessConfirm() {\n this.offline = false;\n }\n\n handleSwipers() {\n if (this.swiperTouristicContentRef && !this.swiperTouristicContent) {\n this.swiperTouristicContent = new Swiper(this.swiperTouristicContentRef, {\n modules: [Navigation, Pagination, Keyboard],\n navigation: {\n prevEl: this.prevElTouristicContentRef,\n nextEl: this.nextElTouristicContentRef,\n },\n pagination: { el: this.paginationElTouristicContentRef },\n allowTouchMove: false,\n keyboard: false,\n loop: true,\n });\n this.swiperTouristicContentRef.onfullscreenchange = () => {\n this.displayFullscreen = !this.displayFullscreen && !this.offline;\n if (this.displayFullscreen) {\n this.swiperTouristicContent.keyboard.enable();\n } else {\n this.swiperTouristicContent.keyboard.disable();\n }\n };\n }\n }\n\n componentDidUpdate() {\n this.handleSwipers();\n }\n\n componentDidLoad() {\n this.handleOffline();\n this.handleSwipers();\n }\n\n async handleOffline() {\n if (state.currentTrek) {\n const trekInStore: Trek = await getDataInStore('treks', state.currentTrek.id);\n if (trekInStore && trekInStore.offline) {\n const touristicContentInStore: TouristicContent = await getDataInStore('touristicContents', this.touristicContent.id);\n this.offline = touristicContentInStore && touristicContentInStore.offline;\n }\n } else if (state.currentOutdoorSite) {\n const outdoorSiteInStore: OutdoorSite = await getDataInStore('outdoorSites', state.currentOutdoorSite.id);\n if (outdoorSiteInStore && outdoorSiteInStore.offline) {\n const touristicContentInStore: TouristicContent = await getDataInStore('touristicContents', this.touristicContent.id);\n this.offline = touristicContentInStore && touristicContentInStore.offline;\n }\n }\n }\n\n handleFullscreen() {\n if (this.touristicContent.attachments && this.touristicContent.attachments[0] && this.touristicContent.attachments[0].url) {\n this.swiperTouristicContentRef.requestFullscreen();\n }\n }\n\n @Listen('mouseover')\n handleMouseOver() {\n this.cardTouristicContentMouseOver.emit(this.touristicContent.id);\n }\n\n @Listen('mouseleave')\n handleMouseLeave() {\n this.cardTouristicContentMouseLeave.emit();\n }\n\n render() {\n const defaultImageSrc = getAssetPath(`${Build.isDev ? '/' : ''}assets/default-image.svg`);\n const touristicContentCategory = state.touristicContentCategories.find(touristicContentCategory => touristicContentCategory.id === this.touristicContent.category);\n return (\n <Host\n style={{\n '--font-family': this.fontFamily,\n 'width': this.isLargeView ? '100%' : 'auto',\n }}\n >\n <div\n part=\"touristic-content-card\"\n class={\n this.isLargeView\n ? `touristic-content-card touristic-content-card-large-view-container${\n state.selectedTouristicContentId === this.touristicContent.id ? ' selected-touristic-content-card' : ''\n }${!this.isInsideHorizontalList ? ' is-inside-vertical-list' : ''}`\n : `touristic-content-card touristic-content-card-container${state.selectedTouristicContentId === this.touristicContent.id ? ' selected-touristic-content-card' : ''}${\n !this.isInsideHorizontalList ? ' is-inside-vertical-list' : ''\n }`\n }\n onClick={() => {\n if (!this.isInsideHorizontalList) {\n this.touristicContentCardPress.emit(this.touristicContent.id);\n }\n }}\n >\n <div part=\"touristic-content-img-container\" class=\"touristic-content-img-container\">\n {this.isInsideHorizontalList ? (\n <div part=\"swiper-touristic-content\" class=\"swiper swiper-touristic-content\" ref={el => (this.swiperTouristicContentRef = el)}>\n <div part=\"swiper-wrapper\" class=\"swiper-wrapper\">\n {this.touristicContent.attachments.filter(attachment => attachment.type === 'image').length > 0 ? (\n this.touristicContent.attachments\n .filter(attachment => attachment.type === 'image')\n .map(attachment => (\n <div part=\"swiper-slide\" class=\"swiper-slide\">\n <img\n part=\"touristic-content-img\"\n class={`touristic-content-img${this.displayFullscreen ? ' img-fullscreen' : ''}`}\n src={this.displayFullscreen ? (this.offline ? attachment.thumbnail : attachment.url) : attachment.thumbnail}\n loading=\"lazy\"\n /* @ts-ignore */\n onerror={event => {\n event.target.onerror = null;\n event.target.className = 'default-touristic-content-img';\n event.target.src = defaultImageSrc;\n }}\n onClick={() => this.handleFullscreen()}\n alt={attachment.legend}\n />\n </div>\n ))\n ) : (\n <div part=\"swiper-slide\" class=\"swiper-slide\">\n <img part=\"default-touristic-content-img\" src={defaultImageSrc} class=\"default-touristic-content-img\" alt=\"\" loading=\"lazy\" />\n </div>\n )}\n </div>\n <div\n style={{ display: this.offline ? 'none' : 'block' }}\n part=\"swiper-pagination\"\n class=\"swiper-pagination\"\n ref={el => (this.paginationElTouristicContentRef = el)}\n ></div>\n <div\n style={{ display: this.offline ? 'none' : 'flex' }}\n part=\"swiper-button-prev\"\n class=\"swiper-button-prev\"\n ref={el => (this.prevElTouristicContentRef = el)}\n ></div>\n <div\n style={{ display: this.offline ? 'none' : 'flex' }}\n part=\"swiper-button-next\"\n class=\"swiper-button-next\"\n ref={el => (this.nextElTouristicContentRef = el)}\n ></div>\n </div>\n ) : this.touristicContent.attachments.filter(attachment => attachment.type === 'image').length > 0 ? (\n <img\n part=\"touristic-content-img\"\n class=\"touristic-content-img\"\n src={`${this.touristicContent.attachments.filter(attachment => attachment.type === 'image')[0].thumbnail}`}\n alt={`${this.touristicContent.attachments.filter(attachment => attachment.type === 'image')[0].legend}`}\n loading=\"lazy\"\n />\n ) : (\n <img class=\"image default-touristic-content-img\" src={defaultImageSrc} loading=\"lazy\" alt=\"\" />\n )}\n </div>\n <div part=\"touristic-content-sub-container\" class=\"touristic-content-sub-container\">\n <div part=\"touristic-content-category-container\" class=\"touristic-content-category-container\">\n {touristicContentCategory && touristicContentCategory.pictogram && (\n <img part=\"touristic-content-category-img\" class=\"touristic-content-category-img\" src={touristicContentCategory.pictogram} alt=\"\" />\n )}\n <div part=\"touristic-content-category-name\" class=\"touristic-content-category-name\">\n {touristicContentCategory.label}\n </div>\n </div>\n <div part=\"touristic-content-name\" class=\"touristic-content-name\">\n {this.touristicContent.name}\n </div>\n </div>\n {this.isInsideHorizontalList && (\n <div part=\"touristic-content-more-detail-container\" class=\"touristic-content-more-detail-container\">\n <button part=\"more-details-button\" class=\"more-details-button\" onClick={() => this.touristicContentCardPress.emit(this.touristicContent.id)}>\n Plus de détails\n </button>\n </div>\n )}\n </div>\n </Host>\n );\n }\n}\n"]}
@@ -19,23 +19,31 @@ export class GrwTouristicContentDetail {
19
19
  this.colorBackground = '#fef7ff';
20
20
  this.isLargeView = false;
21
21
  }
22
+ handleSwipers() {
23
+ if (this.swiperImagesRef && !this.swiperImages) {
24
+ this.swiperImages = new Swiper(this.swiperImagesRef, {
25
+ modules: [Navigation, Pagination, Keyboard, FreeMode, Mousewheel],
26
+ navigation: {
27
+ prevEl: this.prevElImagesRef,
28
+ nextEl: this.nextElImagesRef,
29
+ },
30
+ pagination: { el: this.paginationElImagesRef },
31
+ allowTouchMove: false,
32
+ keyboard: false,
33
+ loop: true,
34
+ });
35
+ this.swiperImagesRef.onfullscreenchange = () => {
36
+ this.displayFullscreen = !this.displayFullscreen;
37
+ this.displayFullscreen && !this.offline ? this.swiperImages.keyboard.enable() : this.swiperImages.keyboard.disable();
38
+ };
39
+ }
40
+ }
41
+ componentDidUpdate() {
42
+ this.handleSwipers();
43
+ }
22
44
  componentDidLoad() {
23
- this.swiperImages = new Swiper(this.swiperImagesRef, {
24
- modules: [Navigation, Pagination, Keyboard, FreeMode, Mousewheel],
25
- navigation: {
26
- prevEl: this.prevElImagesRef,
27
- nextEl: this.nextElImagesRef,
28
- },
29
- pagination: { el: this.paginationElImagesRef },
30
- allowTouchMove: false,
31
- keyboard: false,
32
- loop: true,
33
- });
34
- this.swiperImagesRef.onfullscreenchange = () => {
35
- this.displayFullscreen = !this.displayFullscreen;
36
- this.displayFullscreen && !this.offline ? this.swiperImages.keyboard.enable() : this.swiperImages.keyboard.disable();
37
- };
38
45
  this.offline = state.currentTouristicContent.offline;
46
+ this.handleSwipers();
39
47
  }
40
48
  handleFullscreen(close = false) {
41
49
  if (!close) {
@@ -53,7 +61,7 @@ export class GrwTouristicContentDetail {
53
61
  state.currentTouristicContent &&
54
62
  state.touristicContentCategories.find(touristicContentCategory => touristicContentCategory.id === state.currentTouristicContent.category);
55
63
  const cities = state.currentTouristicContent && state.currentTouristicContent.cities.map(currentCity => { var _a; return (_a = state.cities.find(city => city.id === currentCity)) === null || _a === void 0 ? void 0 : _a.name; });
56
- return (h(Host, { key: '7750c701df76bba15232f1f4b0315d1f8ebb9055', style: {
64
+ return (h(Host, { key: '341d76d558e5ea5d22099e949d79dd2d2c4b2471', style: {
57
65
  '--font-family': this.fontFamily,
58
66
  '--color-primary-app': this.colorPrimaryApp,
59
67
  '--color-on-surface': this.colorOnSurface,
@@ -1 +1 @@
1
- {"version":3,"file":"grw-touristic-content-detail.js","sourceRoot":"","sources":["../../../src/components/grw-touristic-content-detail/grw-touristic-content-detail.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,YAAY,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AACrF,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,KAAK,MAAM,aAAa,CAAC;AAChC,OAAO,MAAM,EAAE,EAAE,QAAQ,EAAE,QAAQ,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AACxF,OAAO,SAAS,MAAM,wBAAwB,CAAC;AAC/C,OAAO,YAAY,MAAM,2BAA2B,CAAC;AAOrD,MAAM,OAAO,yBAAyB;;iCAQP,KAAK;uBACf,KAAK;0BAEH,QAAQ;+BACH,SAAS;8BACV,SAAS;qCACF,SAAS;uCACP,SAAS;uCACT,SAAS;yCACP,SAAS;wCACV,SAAS;+BAClB,SAAS;2BACb,KAAK;;IAK3B,gBAAgB;QACd,IAAI,CAAC,YAAY,GAAG,IAAI,MAAM,CAAC,IAAI,CAAC,eAAe,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,EAAC,KAAK,EAAC,OAAO,EAAC,SAAS,EAAE,KAAK,CAAC,uBAAuB,CAAC,KAAK,GAAM,CACrI,CACP;oBACA,KAAK,CAAC,uBAAuB,CAAC,OAAO,IAAI,CACxC,WAAK,IAAI,EAAC,mBAAmB,EAAC,KAAK,EAAC,mBAAmB;wBACrD,WAAK,IAAI,EAAC,eAAe,EAAC,KAAK,EAAC,eAAe;4BAC5C,SAAS,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,OAAO;uCAC9B;wBACN,SAAG,IAAI,EAAE,KAAK,CAAC,uBAAuB,CAAC,OAAO,EAAE,IAAI,EAAC,SAAS,EAAC,KAAK,EAAC,SAAS,EAAC,SAAS,EAAE,KAAK,CAAC,uBAAuB,CAAC,OAAO,GAAM,CACjI,CACP,CACG,CACF,CACP;YACD,WAAK,IAAI,EAAC,qBAAqB,EAAC,KAAK,EAAC,qBAAqB,GAAO,CAC9D,CACP,CACI,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Build, Component, Host, Prop, State, getAssetPath, h } from '@stencil/core';\nimport { translate } from 'i18n/i18n';\nimport state from 'store/store';\nimport Swiper, { FreeMode, Keyboard, Mousewheel, Navigation, Pagination } from 'swiper';\nimport CloseIcon from '../../assets/close.svg';\nimport DownloadIcon from '../../assets/download.svg';\n\n@Component({\n tag: 'grw-touristic-content-detail',\n styleUrl: 'grw-touristic-content-detail.scss',\n shadow: true,\n})\nexport class GrwTouristicContentDetail {\n swiperImages?: Swiper;\n swiperImagesRef?: HTMLDivElement;\n prevElImagesRef?: HTMLDivElement;\n nextElImagesRef?: HTMLDivElement;\n paginationElImagesRef?: HTMLDivElement;\n presentationRef?: HTMLDivElement;\n\n @State() displayFullscreen = false;\n @State() offline = false;\n\n @Prop() fontFamily = 'Roboto';\n @Prop() colorPrimaryApp = '#6b0030';\n @Prop() colorOnSurface = '#49454e';\n @Prop() colorPrimaryContainer = '#eaddff';\n @Prop() colorOnPrimaryContainer = '#21005e';\n @Prop() colorSecondaryContainer = '#e8def8';\n @Prop() colorOnSecondaryContainer = '#1d192b';\n @Prop() colorSurfaceContainerLow = '#f7f2fa';\n @Prop() colorBackground = '#fef7ff';\n @Prop() isLargeView = false;\n\n descriptionRef?: HTMLDivElement;\n touristicContentDetailContainerRef?: HTMLElement;\n\n componentDidLoad() {\n this.swiperImages = new Swiper(this.swiperImagesRef, {\n modules: [Navigation, Pagination, Keyboard, FreeMode, Mousewheel],\n navigation: {\n prevEl: this.prevElImagesRef,\n nextEl: this.nextElImagesRef,\n },\n pagination: { el: this.paginationElImagesRef },\n allowTouchMove: false,\n keyboard: false,\n loop: true,\n });\n this.swiperImagesRef.onfullscreenchange = () => {\n this.displayFullscreen = !this.displayFullscreen;\n this.displayFullscreen && !this.offline ? this.swiperImages.keyboard.enable() : this.swiperImages.keyboard.disable();\n };\n this.offline = state.currentTouristicContent.offline;\n }\n\n handleFullscreen(close: boolean = false) {\n if (!close) {\n if (state.currentTouristicContent.attachments && state.currentTouristicContent.attachments[0] && state.currentTouristicContent.attachments[0].url) {\n this.swiperImagesRef.requestFullscreen();\n }\n } else {\n (document as any).exitFullscreen();\n }\n }\n\n render() {\n const defaultImageSrc = getAssetPath(`${Build.isDev ? '/' : ''}assets/default-image.svg`);\n const touristicContentCategory =\n state.touristicContentCategories &&\n state.currentTouristicContent &&\n state.touristicContentCategories.find(touristicContentCategory => touristicContentCategory.id === state.currentTouristicContent.category);\n const cities = state.currentTouristicContent && state.currentTouristicContent.cities.map(currentCity => state.cities.find(city => city.id === currentCity)?.name);\n return (\n <Host\n style={{\n '--font-family': this.fontFamily,\n '--color-primary-app': this.colorPrimaryApp,\n '--color-on-surface': this.colorOnSurface,\n '--color-primary-container': this.colorPrimaryContainer,\n '--color-on-primary-container': this.colorOnPrimaryContainer,\n '--color-secondary-container': this.colorSecondaryContainer,\n '--color-on-secondary-container': this.colorOnSecondaryContainer,\n '--color-background': this.colorBackground,\n '--detail-bottom-space-height': this.isLargeView\n ? state.languages && state.languages.length > 1\n ? '44px'\n : '12px'\n : state.languages && state.languages.length > 1\n ? '204px'\n : '164px',\n }}\n >\n {state.currentTouristicContent && (\n <div part=\"touristic-content-detail-container\" class=\"touristic-content-detail-container\" ref={el => (this.touristicContentDetailContainerRef = el)}>\n <div part=\"images-container\" class=\"images-container\" ref={el => (this.presentationRef = el)}>\n <div part=\"swiper-images\" class=\"swiper swiper-images\" ref={el => (this.swiperImagesRef = el)}>\n <div part=\"swiper-wrapper\" class=\"swiper-wrapper\">\n {state.currentTouristicContent.attachments.filter(attachment => attachment.type === 'image').length > 0 ? (\n state.currentTouristicContent.attachments\n .filter(attachment => attachment.type === 'image')\n .map(attachment => {\n const legend = [attachment.legend, attachment.author].filter(Boolean).join(' - ');\n return (\n <div part=\"swiper-slide\" class=\"swiper-slide\">\n {this.displayFullscreen && (\n <div part=\"close-fullscreen-button\" class=\"close-fullscreen-button\" onClick={() => this.handleFullscreen(true)}>\n <span part=\"icon\" class=\"icon\" innerHTML={CloseIcon}></span>\n </div>\n )}\n <div part=\"legend-container\" class=\"legend-container\">\n {legend}\n </div>\n <img\n part=\"image\"\n class=\"image\"\n src={this.offline ? attachment.thumbnail : attachment.url}\n loading=\"lazy\"\n onClick={() => this.handleFullscreen()}\n alt={attachment.legend}\n />\n </div>\n );\n })\n ) : (\n <div part=\"swiper-slide\" class=\"swiper-slide\">\n <img part=\"default-poi-img\" class=\"default-poi-img\" src={defaultImageSrc} alt=\"\" loading=\"lazy\" />\n </div>\n )}\n </div>\n <div style={{ display: this.offline ? 'none' : 'block' }} part=\"swiper-pagination\" class=\"swiper-pagination\" ref={el => (this.paginationElImagesRef = el)}></div>\n <div style={{ display: this.offline ? 'none' : 'flex' }} part=\"swiper-button-prev\" class=\"swiper-button-prev\" ref={el => (this.prevElImagesRef = el)}></div>\n <div style={{ display: this.offline ? 'none' : 'flex' }} part=\"swiper-button-next\" class=\"swiper-button-next\" ref={el => (this.nextElImagesRef = el)}></div>\n </div>\n </div>\n <div part=\"touristic-content-category-container\" class=\"touristic-content-category-container\">\n <img\n part=\"touristic-content-category-img\"\n class=\"touristic-content-category-img\"\n /* @ts-ignore */\n\n src={touristicContentCategory.pictogram}\n alt=\"\"\n />\n <div part=\"touristic-content-category-name\" class=\"touristic-content-category-name\">\n {touristicContentCategory.label}\n </div>\n </div>\n <div part=\"name\" class=\"name\">\n {state.currentTouristicContent.name}\n </div>\n <div part=\"divider\" class=\"divider\"></div>\n <div part=\"downloads-container\" class=\"downloads-container\">\n <div part=\"download-title\" class=\"download-title\">\n {translate[state.language].download}\n </div>\n <div part=\"links-container\" class=\"links-container\">\n <a part=\"link-container\" class=\"link-container\" href={`${state.currentTouristicContent.pdf}`} target=\"_blank\" rel=\"noopener noreferrer\">\n <span part=\"icon\" class=\"icon\" innerHTML={DownloadIcon}></span>\n <span part=\"label\" class=\"\">\n PDF\n </span>\n </a>\n </div>\n </div>\n {state.currentTouristicContent.description_teaser && (\n <div>\n <div part=\"divider\" class=\"divider\"></div>\n <div part=\"description-teaser\" class=\"description-teaser\" innerHTML={state.currentTouristicContent.description_teaser}></div>\n </div>\n )}\n <div part=\"divider\" class=\"divider\"></div>\n {state.currentTouristicContent.practical_info && (\n <div part=\"description-container\" class=\"description-container\" ref={el => (this.descriptionRef = el)}>\n <div part=\"description-title\" class=\"description-title\">\n {translate[state.language].description}\n </div>\n <div part=\"description\" class=\"description\" innerHTML={state.currentTouristicContent.description}></div>\n </div>\n )}\n {cities && cities.length > 0 && (\n <div part=\"cities-container\" class=\"cities-container\">\n <div part=\"cities-title\" class=\"cities-title\">\n {translate[state.language].city} :&nbsp;\n </div>\n <div part=\"cities\" class=\"cities\" innerHTML={cities.join(', ')}></div>\n </div>\n )}\n {state.currentTouristicContent.practical_info && (\n <div>\n <div part=\"divider\" class=\"divider\"></div>\n <div part=\"useful-information-container\" class=\"useful-information-container\">\n <div part=\"useful-information-title\" class=\"useful-information-title\">\n {translate[state.language].usefulInformation} :&nbsp;\n </div>\n <div part=\"useful-information\" innerHTML={state.currentTouristicContent.practical_info}></div>\n </div>\n </div>\n )}\n {(state.currentTouristicContent.contact || state.currentTouristicContent.email || state.currentTouristicContent.website) && (\n <div>\n <div part=\"divider\" class=\"divider\"></div>\n <div part=\"contact-container\" class=\"contact-container\">\n <div part=\"contact-title\" class=\"contact-title\">\n {translate[state.language].contact} :&nbsp;\n </div>\n {state.currentTouristicContent.contact && <div part=\"contact\" class=\"contact\" innerHTML={state.currentTouristicContent.contact}></div>}\n {state.currentTouristicContent.email && (\n <div part=\"email-container\" class=\"email-container\">\n <div part=\"email-title\" class=\"email-title\">\n {translate[state.language].email} :&nbsp;\n </div>\n <a href={'mailto:' + state.currentTouristicContent.email} part=\"email\" class=\"email\" innerHTML={state.currentTouristicContent.email}></a>\n </div>\n )}\n {state.currentTouristicContent.website && (\n <div part=\"website-container\" class=\"website-container\">\n <div part=\"website-title\" class=\"website-title\">\n {translate[state.language].website} :&nbsp;\n </div>\n <a href={state.currentTouristicContent.website} part=\"website\" class=\"website\" innerHTML={state.currentTouristicContent.website}></a>\n </div>\n )}\n </div>\n </div>\n )}\n <div part=\"detail-bottom-space\" class=\"detail-bottom-space\"></div>\n </div>\n )}\n </Host>\n );\n }\n}\n"]}
1
+ {"version":3,"file":"grw-touristic-content-detail.js","sourceRoot":"","sources":["../../../src/components/grw-touristic-content-detail/grw-touristic-content-detail.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,YAAY,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AACrF,OAAO,EAA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,CACP;YACD,WAAK,IAAI,EAAC,qBAAqB,EAAC,KAAK,EAAC,qBAAqB,GAAO,CAC9D,CACP,CACI,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Build, Component, Host, Prop, State, getAssetPath, h } from '@stencil/core';\nimport { translate } from 'i18n/i18n';\nimport state from 'store/store';\nimport Swiper, { FreeMode, Keyboard, Mousewheel, Navigation, Pagination } from 'swiper';\nimport CloseIcon from '../../assets/close.svg';\nimport DownloadIcon from '../../assets/download.svg';\n\n@Component({\n tag: 'grw-touristic-content-detail',\n styleUrl: 'grw-touristic-content-detail.scss',\n shadow: true,\n})\nexport class GrwTouristicContentDetail {\n swiperImages?: Swiper;\n swiperImagesRef?: HTMLDivElement;\n prevElImagesRef?: HTMLDivElement;\n nextElImagesRef?: HTMLDivElement;\n paginationElImagesRef?: HTMLDivElement;\n presentationRef?: HTMLDivElement;\n\n @State() displayFullscreen = false;\n @State() offline = false;\n\n @Prop() fontFamily = 'Roboto';\n @Prop() colorPrimaryApp = '#6b0030';\n @Prop() colorOnSurface = '#49454e';\n @Prop() colorPrimaryContainer = '#eaddff';\n @Prop() colorOnPrimaryContainer = '#21005e';\n @Prop() colorSecondaryContainer = '#e8def8';\n @Prop() colorOnSecondaryContainer = '#1d192b';\n @Prop() colorSurfaceContainerLow = '#f7f2fa';\n @Prop() colorBackground = '#fef7ff';\n @Prop() isLargeView = false;\n\n descriptionRef?: HTMLDivElement;\n touristicContentDetailContainerRef?: HTMLElement;\n\n handleSwipers() {\n if (this.swiperImagesRef && !this.swiperImages) {\n this.swiperImages = new Swiper(this.swiperImagesRef, {\n modules: [Navigation, Pagination, Keyboard, FreeMode, Mousewheel],\n navigation: {\n prevEl: this.prevElImagesRef,\n nextEl: this.nextElImagesRef,\n },\n pagination: { el: this.paginationElImagesRef },\n allowTouchMove: false,\n keyboard: false,\n loop: true,\n });\n this.swiperImagesRef.onfullscreenchange = () => {\n this.displayFullscreen = !this.displayFullscreen;\n this.displayFullscreen && !this.offline ? this.swiperImages.keyboard.enable() : this.swiperImages.keyboard.disable();\n };\n }\n }\n\n componentDidUpdate() {\n this.handleSwipers();\n }\n\n componentDidLoad() {\n this.offline = state.currentTouristicContent.offline;\n this.handleSwipers();\n }\n\n handleFullscreen(close: boolean = false) {\n if (!close) {\n if (state.currentTouristicContent.attachments && state.currentTouristicContent.attachments[0] && state.currentTouristicContent.attachments[0].url) {\n this.swiperImagesRef.requestFullscreen();\n }\n } else {\n (document as any).exitFullscreen();\n }\n }\n\n render() {\n const defaultImageSrc = getAssetPath(`${Build.isDev ? '/' : ''}assets/default-image.svg`);\n const touristicContentCategory =\n state.touristicContentCategories &&\n state.currentTouristicContent &&\n state.touristicContentCategories.find(touristicContentCategory => touristicContentCategory.id === state.currentTouristicContent.category);\n const cities = state.currentTouristicContent && state.currentTouristicContent.cities.map(currentCity => state.cities.find(city => city.id === currentCity)?.name);\n return (\n <Host\n style={{\n '--font-family': this.fontFamily,\n '--color-primary-app': this.colorPrimaryApp,\n '--color-on-surface': this.colorOnSurface,\n '--color-primary-container': this.colorPrimaryContainer,\n '--color-on-primary-container': this.colorOnPrimaryContainer,\n '--color-secondary-container': this.colorSecondaryContainer,\n '--color-on-secondary-container': this.colorOnSecondaryContainer,\n '--color-background': this.colorBackground,\n '--detail-bottom-space-height': this.isLargeView\n ? state.languages && state.languages.length > 1\n ? '44px'\n : '12px'\n : state.languages && state.languages.length > 1\n ? '204px'\n : '164px',\n }}\n >\n {state.currentTouristicContent && (\n <div part=\"touristic-content-detail-container\" class=\"touristic-content-detail-container\" ref={el => (this.touristicContentDetailContainerRef = el)}>\n <div part=\"images-container\" class=\"images-container\" ref={el => (this.presentationRef = el)}>\n <div part=\"swiper-images\" class=\"swiper swiper-images\" ref={el => (this.swiperImagesRef = el)}>\n <div part=\"swiper-wrapper\" class=\"swiper-wrapper\">\n {state.currentTouristicContent.attachments.filter(attachment => attachment.type === 'image').length > 0 ? (\n state.currentTouristicContent.attachments\n .filter(attachment => attachment.type === 'image')\n .map(attachment => {\n const legend = [attachment.legend, attachment.author].filter(Boolean).join(' - ');\n return (\n <div part=\"swiper-slide\" class=\"swiper-slide\">\n {this.displayFullscreen && (\n <div part=\"close-fullscreen-button\" class=\"close-fullscreen-button\" onClick={() => this.handleFullscreen(true)}>\n <span part=\"icon\" class=\"icon\" innerHTML={CloseIcon}></span>\n </div>\n )}\n <div part=\"legend-container\" class=\"legend-container\">\n {legend}\n </div>\n <img\n part=\"image\"\n class=\"image\"\n src={this.offline ? attachment.thumbnail : attachment.url}\n loading=\"lazy\"\n onClick={() => this.handleFullscreen()}\n alt={attachment.legend}\n />\n </div>\n );\n })\n ) : (\n <div part=\"swiper-slide\" class=\"swiper-slide\">\n <img part=\"default-poi-img\" class=\"default-poi-img\" src={defaultImageSrc} alt=\"\" loading=\"lazy\" />\n </div>\n )}\n </div>\n <div style={{ display: this.offline ? 'none' : 'block' }} part=\"swiper-pagination\" class=\"swiper-pagination\" ref={el => (this.paginationElImagesRef = el)}></div>\n <div style={{ display: this.offline ? 'none' : 'flex' }} part=\"swiper-button-prev\" class=\"swiper-button-prev\" ref={el => (this.prevElImagesRef = el)}></div>\n <div style={{ display: this.offline ? 'none' : 'flex' }} part=\"swiper-button-next\" class=\"swiper-button-next\" ref={el => (this.nextElImagesRef = el)}></div>\n </div>\n </div>\n <div part=\"touristic-content-category-container\" class=\"touristic-content-category-container\">\n <img\n part=\"touristic-content-category-img\"\n class=\"touristic-content-category-img\"\n /* @ts-ignore */\n\n src={touristicContentCategory.pictogram}\n alt=\"\"\n />\n <div part=\"touristic-content-category-name\" class=\"touristic-content-category-name\">\n {touristicContentCategory.label}\n </div>\n </div>\n <div part=\"name\" class=\"name\">\n {state.currentTouristicContent.name}\n </div>\n <div part=\"divider\" class=\"divider\"></div>\n <div part=\"downloads-container\" class=\"downloads-container\">\n <div part=\"download-title\" class=\"download-title\">\n {translate[state.language].download}\n </div>\n <div part=\"links-container\" class=\"links-container\">\n <a part=\"link-container\" class=\"link-container\" href={`${state.currentTouristicContent.pdf}`} target=\"_blank\" rel=\"noopener noreferrer\">\n <span part=\"icon\" class=\"icon\" innerHTML={DownloadIcon}></span>\n <span part=\"label\" class=\"\">\n PDF\n </span>\n </a>\n </div>\n </div>\n {state.currentTouristicContent.description_teaser && (\n <div>\n <div part=\"divider\" class=\"divider\"></div>\n <div part=\"description-teaser\" class=\"description-teaser\" innerHTML={state.currentTouristicContent.description_teaser}></div>\n </div>\n )}\n <div part=\"divider\" class=\"divider\"></div>\n {state.currentTouristicContent.practical_info && (\n <div part=\"description-container\" class=\"description-container\" ref={el => (this.descriptionRef = el)}>\n <div part=\"description-title\" class=\"description-title\">\n {translate[state.language].description}\n </div>\n <div part=\"description\" class=\"description\" innerHTML={state.currentTouristicContent.description}></div>\n </div>\n )}\n {cities && cities.length > 0 && (\n <div part=\"cities-container\" class=\"cities-container\">\n <div part=\"cities-title\" class=\"cities-title\">\n {translate[state.language].city} :&nbsp;\n </div>\n <div part=\"cities\" class=\"cities\" innerHTML={cities.join(', ')}></div>\n </div>\n )}\n {state.currentTouristicContent.practical_info && (\n <div>\n <div part=\"divider\" class=\"divider\"></div>\n <div part=\"useful-information-container\" class=\"useful-information-container\">\n <div part=\"useful-information-title\" class=\"useful-information-title\">\n {translate[state.language].usefulInformation} :&nbsp;\n </div>\n <div part=\"useful-information\" innerHTML={state.currentTouristicContent.practical_info}></div>\n </div>\n </div>\n )}\n {(state.currentTouristicContent.contact || state.currentTouristicContent.email || state.currentTouristicContent.website) && (\n <div>\n <div part=\"divider\" class=\"divider\"></div>\n <div part=\"contact-container\" class=\"contact-container\">\n <div part=\"contact-title\" class=\"contact-title\">\n {translate[state.language].contact} :&nbsp;\n </div>\n {state.currentTouristicContent.contact && <div part=\"contact\" class=\"contact\" innerHTML={state.currentTouristicContent.contact}></div>}\n {state.currentTouristicContent.email && (\n <div part=\"email-container\" class=\"email-container\">\n <div part=\"email-title\" class=\"email-title\">\n {translate[state.language].email} :&nbsp;\n </div>\n <a href={'mailto:' + state.currentTouristicContent.email} part=\"email\" class=\"email\" innerHTML={state.currentTouristicContent.email}></a>\n </div>\n )}\n {state.currentTouristicContent.website && (\n <div part=\"website-container\" class=\"website-container\">\n <div part=\"website-title\" class=\"website-title\">\n {translate[state.language].website} :&nbsp;\n </div>\n <a href={state.currentTouristicContent.website} part=\"website\" class=\"website\" innerHTML={state.currentTouristicContent.website}></a>\n </div>\n )}\n </div>\n </div>\n )}\n <div part=\"detail-bottom-space\" class=\"detail-bottom-space\"></div>\n </div>\n )}\n </Host>\n );\n }\n}\n"]}
@@ -21,9 +21,8 @@ export class GrwTouristicEvent {
21
21
  onTrekDeleteSuccessConfirm() {
22
22
  this.offline = false;
23
23
  }
24
- componentDidLoad() {
25
- this.handleOffline();
26
- if (this.swiperTouristicEventRef) {
24
+ handleSwipers() {
25
+ if (this.swiperTouristicEventRef && !this.swiperTouristicEvent) {
27
26
  this.swiperTouristicEvent = new Swiper(this.swiperTouristicEventRef, {
28
27
  modules: [Navigation, Pagination, Keyboard],
29
28
  navigation: {
@@ -46,6 +45,13 @@ export class GrwTouristicEvent {
46
45
  };
47
46
  }
48
47
  }
48
+ componentDidUpdate() {
49
+ this.handleSwipers();
50
+ }
51
+ componentDidLoad() {
52
+ this.handleOffline();
53
+ this.handleSwipers();
54
+ }
49
55
  async handleOffline() {
50
56
  if (state.currentTrek) {
51
57
  const trekInStore = await getDataInStore('treks', state.currentTrek.id);
@@ -76,16 +82,16 @@ export class GrwTouristicEvent {
76
82
  render() {
77
83
  const defaultImageSrc = getAssetPath(`${Build.isDev ? '/' : ''}assets/default-image.svg`);
78
84
  const touristicEventType = state.touristicEventTypes.find(touristicEventType => touristicEventType.id === this.touristicEvent.type);
79
- return (h(Host, { key: 'bb6d391500656bb34042982e7f0ab3c00ab8c400', style: {
85
+ return (h(Host, { key: 'f45a2624a4fc98418107d15d27c1eca21a3c2b08', style: {
80
86
  '--font-family': this.fontFamily,
81
87
  'width': this.isLargeView ? '100%' : 'auto',
82
- } }, h("div", { key: '6d3df55874f39991a4e6595623619132edc26396', part: "touristic-event-card", class: this.isLargeView
88
+ } }, h("div", { key: 'e88664547e283bc7fc4f3b1c1712886d942753bd', part: "touristic-event-card", class: this.isLargeView
83
89
  ? `touristic-event-card touristic-event-card-large-view-container${state.selectedTouristicEventId === this.touristicEvent.id ? ' selected-touristic-event-card' : ''}${!this.isInsideHorizontalList ? ' is-inside-vertical-list' : ''}`
84
90
  : ` touristic-event-card touristic-event-card-container${state.selectedTouristicEventId === this.touristicEvent.id ? ' selected-touristic-event-card' : ''}${!this.isInsideHorizontalList ? ' is-inside-vertical-list' : ''}`, onClick: () => {
85
91
  if (!this.isInsideHorizontalList) {
86
92
  this.touristicEventCardPress.emit(this.touristicEvent.id);
87
93
  }
88
- } }, h("div", { key: 'c3cd1db41d1ee8eb9ac220ff3799e66a6038a6a6', part: "touristic-event-img-container", class: "touristic-event-img-container" }, this.isInsideHorizontalList ? (h("div", { part: "swiper-touristic-event", class: "swiper swiper-touristic-event", ref: el => (this.swiperTouristicEventRef = el) }, h("div", { part: "swiper-wrapper", class: "swiper-wrapper" }, this.touristicEvent.attachments.filter(attachment => attachment.type === 'image').length > 0 ? (this.touristicEvent.attachments
94
+ } }, h("div", { key: '82e1fe19a6f8a5885e59521f798813555f1dc604', part: "touristic-event-img-container", class: "touristic-event-img-container" }, this.isInsideHorizontalList ? (h("div", { part: "swiper-touristic-event", class: "swiper swiper-touristic-event", ref: el => (this.swiperTouristicEventRef = el) }, h("div", { part: "swiper-wrapper", class: "swiper-wrapper" }, this.touristicEvent.attachments.filter(attachment => attachment.type === 'image').length > 0 ? (this.touristicEvent.attachments
89
95
  .filter(attachment => attachment.type === 'image')
90
96
  .map(attachment => (h("div", { part: "swiper-slide", class: "swiper-slide" }, h("img", { part: "touristic-event-img", class: `touristic-event-img${this.displayFullscreen ? ' img-fullscreen' : ''}`, src: this.displayFullscreen ? (this.offline ? attachment.thumbnail : attachment.url) : attachment.thumbnail, loading: "lazy",
91
97
  /* @ts-ignore */
@@ -93,7 +99,7 @@ export class GrwTouristicEvent {
93
99
  event.target.onerror = null;
94
100
  event.target.className = 'default-touristic-event-img';
95
101
  event.target.src = defaultImageSrc;
96
- }, onClick: () => this.handleFullscreen(), alt: attachment.legend }))))) : (h("div", { part: "swiper-slide", class: "swiper-slide" }, h("img", { part: "default-touristic-event-img", class: "default-touristic-event-img", src: defaultImageSrc, alt: "", loading: "lazy" })))), h("div", { style: { display: this.offline || this.touristicEvent.attachments.filter(attachment => attachment.type === 'image').length <= 1 ? 'none' : 'block' }, part: "swiper-pagination", class: "swiper-pagination", ref: el => (this.paginationElTouristicEventRef = el) }), h("div", { style: { display: this.offline || this.touristicEvent.attachments.filter(attachment => attachment.type === 'image').length <= 1 ? 'none' : 'block' }, part: "swiper-button-prev", class: "swiper-button-prev", ref: el => (this.prevElTouristicEventRef = el) }), h("div", { style: { display: this.offline || this.touristicEvent.attachments.filter(attachment => attachment.type === 'image').length <= 1 ? 'none' : 'block' }, part: "swiper-button-next", class: "swiper-button-next", ref: el => (this.nextElTouristicEventRef = el) }))) : this.touristicEvent.attachments.filter(attachment => attachment.type === 'image').length > 0 ? (h("img", { part: "touristic-event-img", class: "touristic-event-img", src: `${this.touristicEvent.attachments.filter(attachment => attachment.type === 'image')[0].thumbnail}`, alt: `${this.touristicEvent.attachments.filter(attachment => attachment.type === 'image')[0].legend}`, loading: "lazy" })) : (h("img", { class: "image default-touristic-event-img", src: defaultImageSrc, alt: "", loading: "lazy" }))), h("div", { key: '6ea27dab0fce05bdd3b4530595552ef58faa67bd', part: "touristic-event-sub-container", class: "touristic-event-sub-container" }, h("div", { key: '2b72dc4c90f34976c31b306b9bc67689bb5a09e7', part: "touristic-event-type-container", class: "touristic-event-type-container" }, touristicEventType && touristicEventType.pictogram && (h("img", { part: "touristic-event-type-img", class: "touristic-event-type-img", src: touristicEventType.pictogram, alt: "" })), touristicEventType && touristicEventType.type && (h("div", { part: "touristic-event-type-name", class: "touristic-event-type-name" }, touristicEventType.type))), h("div", { key: '5c11f5db2a0bdd4f4bff1328fee6e90b3bafa498', part: "touristic-event-name", class: "touristic-event-name" }, this.touristicEvent.name), (this.touristicEvent.begin_date || this.touristicEvent.end_date) && (h("div", { part: "touristic-event-date-container", class: "touristic-event-date-container" }, this.touristicEvent.begin_date === this.touristicEvent.end_date && (h("div", { part: "touristic-event-date", class: "touristic-event-date" }, translate[state.language].date, " : ", this.touristicEvent.begin_date)), this.touristicEvent.begin_date && this.touristicEvent.begin_date !== this.touristicEvent.end_date && (h("div", { part: "touristic-event-date", class: "touristic-event-date" }, translate[state.language].startDate, " : ", this.touristicEvent.begin_date)), this.touristicEvent.end_date && this.touristicEvent.begin_date !== this.touristicEvent.end_date && (h("div", { part: "touristic-event-date", class: "touristic-event-date" }, translate[state.language].endDate, " : ", this.touristicEvent.end_date))))), this.isInsideHorizontalList && (h("div", { part: "touristic-event-more-detail-container", class: "touristic-event-more-detail-container" }, h("button", { part: "more-details-button", class: "more-details-button", onClick: () => this.touristicEventCardPress.emit(this.touristicEvent.id) }, "Plus de d\u00E9tails"))))));
102
+ }, onClick: () => this.handleFullscreen(), alt: attachment.legend }))))) : (h("div", { part: "swiper-slide", class: "swiper-slide" }, h("img", { part: "default-touristic-event-img", class: "default-touristic-event-img", src: defaultImageSrc, alt: "", loading: "lazy" })))), h("div", { style: { display: this.offline ? 'none' : 'block' }, part: "swiper-pagination", class: "swiper-pagination", ref: el => (this.paginationElTouristicEventRef = el) }), h("div", { style: { display: this.offline ? 'none' : 'flex' }, part: "swiper-button-prev", class: "swiper-button-prev", ref: el => (this.prevElTouristicEventRef = el) }), h("div", { style: { display: this.offline ? 'none' : 'flex' }, part: "swiper-button-next", class: "swiper-button-next", ref: el => (this.nextElTouristicEventRef = el) }))) : this.touristicEvent.attachments.filter(attachment => attachment.type === 'image').length > 0 ? (h("img", { part: "touristic-event-img", class: "touristic-event-img", src: `${this.touristicEvent.attachments.filter(attachment => attachment.type === 'image')[0].thumbnail}`, alt: `${this.touristicEvent.attachments.filter(attachment => attachment.type === 'image')[0].legend}`, loading: "lazy" })) : (h("img", { class: "image default-touristic-event-img", src: defaultImageSrc, alt: "", loading: "lazy" }))), h("div", { key: '2c8301acd32a3b4d39fa0fa979afdffd1b8c9376', part: "touristic-event-sub-container", class: "touristic-event-sub-container" }, h("div", { key: 'f8a15aa9cd7f2682cc91065a2a486425d5c68f1f', part: "touristic-event-type-container", class: "touristic-event-type-container" }, touristicEventType && touristicEventType.pictogram && (h("img", { part: "touristic-event-type-img", class: "touristic-event-type-img", src: touristicEventType.pictogram, alt: "" })), touristicEventType && touristicEventType.type && (h("div", { part: "touristic-event-type-name", class: "touristic-event-type-name" }, touristicEventType.type))), h("div", { key: '86ebde91c4e37899e74b30549cc0721ea49706fb', part: "touristic-event-name", class: "touristic-event-name" }, this.touristicEvent.name), (this.touristicEvent.begin_date || this.touristicEvent.end_date) && (h("div", { part: "touristic-event-date-container", class: "touristic-event-date-container" }, this.touristicEvent.begin_date === this.touristicEvent.end_date && (h("div", { part: "touristic-event-date", class: "touristic-event-date" }, translate[state.language].date, " : ", this.touristicEvent.begin_date)), this.touristicEvent.begin_date && this.touristicEvent.begin_date !== this.touristicEvent.end_date && (h("div", { part: "touristic-event-date", class: "touristic-event-date" }, translate[state.language].startDate, " : ", this.touristicEvent.begin_date)), this.touristicEvent.end_date && this.touristicEvent.begin_date !== this.touristicEvent.end_date && (h("div", { part: "touristic-event-date", class: "touristic-event-date" }, translate[state.language].endDate, " : ", this.touristicEvent.end_date))))), this.isInsideHorizontalList && (h("div", { part: "touristic-event-more-detail-container", class: "touristic-event-more-detail-container" }, h("button", { part: "more-details-button", class: "more-details-button", onClick: () => this.touristicEventCardPress.emit(this.touristicEvent.id) }, "Plus de d\u00E9tails"))))));
97
103
  }
98
104
  static get is() { return "grw-touristic-event-card"; }
99
105
  static get encapsulation() { return "shadow"; }
@@ -1 +1 @@
1
- {"version":3,"file":"grw-touristic-event-card.js","sourceRoot":"","sources":["../../../src/components/grw-touristic-event-card/grw-touristic-event-card.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,IAAI,EAAE,YAAY,EAAE,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAgB,MAAM,EAAE,MAAM,eAAe,CAAC;AAClH,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AACzD,OAAO,KAAK,MAAM,aAAa,CAAC;AAChC,OAAO,MAAM,EAAE,EAAE,QAAQ,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AAQlE,MAAM,OAAO,iBAAiB;;0BAQP,QAAQ;;2BAGP,KAAK;sCACM,KAAK;iCACT,KAAK;uBAKf,KAAK;;IAGxB,8BAA8B;QAC5B,IAAI,IAAI,CAAC,oBAAoB,EAAE,CAAC;YAC9B,IAAI,CAAC,oBAAoB,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;QACvC,CAAC;QACD,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC;IACtB,CAAC;IAGD,0BAA0B;QACxB,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC;IACvB,CAAC;IAED,gBAAgB;QACd,IAAI,CAAC,aAAa,EAAE,CAAC;QACrB,IAAI,IAAI,CAAC,uBAAuB,EAAE,CAAC;YACjC,IAAI,CAAC,oBAAoB,GAAG,IAAI,MAAM,CAAC,IAAI,CAAC,uBAAuB,EAAE;gBACnE,OAAO,EAAE,CAAC,UAAU,EAAE,UAAU,EA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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Build, Component, Host, getAssetPath, h, State, Prop, Event, EventEmitter, Listen } from '@stencil/core';\nimport { translate } from 'i18n/i18n';\nimport { getDataInStore } from 'services/grw-db.service';\nimport state from 'store/store';\nimport Swiper, { Keyboard, Navigation, Pagination } from 'swiper';\nimport { OutdoorSite, TouristicEvent, Trek } from 'types/types';\n\n@Component({\n tag: 'grw-touristic-event-card',\n styleUrl: 'grw-touristic-event-card.scss',\n shadow: true,\n})\nexport class GrwTouristicEvent {\n @Event() touristicEventCardPress: EventEmitter<number>;\n swiperTouristicEvent?: Swiper;\n swiperTouristicEventRef?: HTMLDivElement;\n prevElTouristicEventRef?: HTMLDivElement;\n nextElTouristicEventRef?: HTMLDivElement;\n paginationElTouristicEventRef?: HTMLDivElement;\n\n @Prop() fontFamily = 'Roboto';\n\n @Prop() touristicEvent: TouristicEvent;\n @Prop() isLargeView = false;\n @Prop() isInsideHorizontalList = false;\n @State() displayFullscreen = false;\n\n @Event() cardTouristicEventMouseOver: EventEmitter<number>;\n @Event() cardTouristicEventMouseLeave: EventEmitter;\n\n @State() offline = false;\n\n @Listen('trekDownloadedSuccessConfirm', { target: 'window' })\n onTrekDownloadedSuccessConfirm() {\n if (this.swiperTouristicEvent) {\n this.swiperTouristicEvent.slideTo(0);\n }\n this.offline = true;\n }\n\n @Listen('trekDeleteSuccessConfirm', { target: 'window' })\n onTrekDeleteSuccessConfirm() {\n this.offline = false;\n }\n\n componentDidLoad() {\n this.handleOffline();\n if (this.swiperTouristicEventRef) {\n this.swiperTouristicEvent = new Swiper(this.swiperTouristicEventRef, {\n modules: [Navigation, Pagination, Keyboard],\n navigation: {\n prevEl: this.prevElTouristicEventRef,\n nextEl: this.nextElTouristicEventRef,\n },\n pagination: { el: this.paginationElTouristicEventRef },\n allowTouchMove: false,\n keyboard: false,\n loop: true,\n });\n this.swiperTouristicEventRef.onfullscreenchange = () => {\n this.displayFullscreen = !this.displayFullscreen && !this.offline;\n if (this.displayFullscreen) {\n this.swiperTouristicEvent.keyboard.enable();\n } else {\n this.swiperTouristicEvent.keyboard.disable();\n }\n };\n }\n }\n\n async handleOffline() {\n if (state.currentTrek) {\n const trekInStore: Trek = await getDataInStore('treks', state.currentTrek.id);\n if (trekInStore && trekInStore.offline) {\n const touristicEventInStore: TouristicEvent = await getDataInStore('touristicEvents', this.touristicEvent.id);\n this.offline = trekInStore && trekInStore.offline && touristicEventInStore && touristicEventInStore.offline;\n }\n } else if (state.currentOutdoorSite) {\n const outdoorSiteInStore: OutdoorSite = await getDataInStore('outdoorSites', state.currentOutdoorSite.id);\n if (outdoorSiteInStore && outdoorSiteInStore.offline) {\n const touristicEventInStore: TouristicEvent = await getDataInStore('touristicEvents', this.touristicEvent.id);\n this.offline = touristicEventInStore && touristicEventInStore.offline;\n }\n }\n }\n\n handleFullscreen() {\n if (this.touristicEvent.attachments && this.touristicEvent.attachments[0] && this.touristicEvent.attachments[0].url) {\n this.swiperTouristicEventRef.requestFullscreen();\n }\n }\n\n @Listen('mouseover')\n handleMouseOver() {\n this.cardTouristicEventMouseOver.emit(this.touristicEvent.id);\n }\n\n @Listen('mouseleave')\n handleMouseLeave() {\n this.cardTouristicEventMouseLeave.emit();\n }\n\n render() {\n const defaultImageSrc = getAssetPath(`${Build.isDev ? '/' : ''}assets/default-image.svg`);\n const touristicEventType = state.touristicEventTypes.find(touristicEventType => touristicEventType.id === this.touristicEvent.type);\n return (\n <Host\n style={{\n '--font-family': this.fontFamily,\n 'width': this.isLargeView ? '100%' : 'auto',\n }}\n >\n <div\n part=\"touristic-event-card\"\n class={\n this.isLargeView\n ? `touristic-event-card touristic-event-card-large-view-container${\n state.selectedTouristicEventId === this.touristicEvent.id ? ' selected-touristic-event-card' : ''\n }${!this.isInsideHorizontalList ? ' is-inside-vertical-list' : ''}`\n : ` touristic-event-card touristic-event-card-container${state.selectedTouristicEventId === this.touristicEvent.id ? ' selected-touristic-event-card' : ''}${\n !this.isInsideHorizontalList ? ' is-inside-vertical-list' : ''\n }`\n }\n onClick={() => {\n if (!this.isInsideHorizontalList) {\n this.touristicEventCardPress.emit(this.touristicEvent.id);\n }\n }}\n >\n <div part=\"touristic-event-img-container\" class=\"touristic-event-img-container\">\n {this.isInsideHorizontalList ? (\n <div part=\"swiper-touristic-event\" class=\"swiper swiper-touristic-event\" ref={el => (this.swiperTouristicEventRef = el)}>\n <div part=\"swiper-wrapper\" class=\"swiper-wrapper\">\n {this.touristicEvent.attachments.filter(attachment => attachment.type === 'image').length > 0 ? (\n this.touristicEvent.attachments\n .filter(attachment => attachment.type === 'image')\n .map(attachment => (\n <div part=\"swiper-slide\" class=\"swiper-slide\">\n <img\n part=\"touristic-event-img\"\n class={`touristic-event-img${this.displayFullscreen ? ' img-fullscreen' : ''}`}\n src={this.displayFullscreen ? (this.offline ? attachment.thumbnail : attachment.url) : attachment.thumbnail}\n loading=\"lazy\"\n /* @ts-ignore */\n onerror={event => {\n event.target.onerror = null;\n event.target.className = 'default-touristic-event-img';\n event.target.src = defaultImageSrc;\n }}\n onClick={() => this.handleFullscreen()}\n alt={attachment.legend}\n />\n </div>\n ))\n ) : (\n <div part=\"swiper-slide\" class=\"swiper-slide\">\n <img part=\"default-touristic-event-img\" class=\"default-touristic-event-img\" src={defaultImageSrc} alt=\"\" loading=\"lazy\" />\n </div>\n )}\n </div>\n <div\n style={{ display: this.offline || this.touristicEvent.attachments.filter(attachment => attachment.type === 'image').length <= 1 ? 'none' : 'block' }}\n part=\"swiper-pagination\"\n class=\"swiper-pagination\"\n ref={el => (this.paginationElTouristicEventRef = el)}\n ></div>\n <div\n style={{ display: this.offline || this.touristicEvent.attachments.filter(attachment => attachment.type === 'image').length <= 1 ? 'none' : 'block' }}\n part=\"swiper-button-prev\"\n class=\"swiper-button-prev\"\n ref={el => (this.prevElTouristicEventRef = el)}\n ></div>\n <div\n style={{ display: this.offline || this.touristicEvent.attachments.filter(attachment => attachment.type === 'image').length <= 1 ? 'none' : 'block' }}\n part=\"swiper-button-next\"\n class=\"swiper-button-next\"\n ref={el => (this.nextElTouristicEventRef = el)}\n ></div>\n </div>\n ) : this.touristicEvent.attachments.filter(attachment => attachment.type === 'image').length > 0 ? (\n <img\n part=\"touristic-event-img\"\n class=\"touristic-event-img\"\n src={`${this.touristicEvent.attachments.filter(attachment => attachment.type === 'image')[0].thumbnail}`}\n alt={`${this.touristicEvent.attachments.filter(attachment => attachment.type === 'image')[0].legend}`}\n loading=\"lazy\"\n />\n ) : (\n <img class=\"image default-touristic-event-img\" src={defaultImageSrc} alt=\"\" loading=\"lazy\" />\n )}\n </div>\n <div part=\"touristic-event-sub-container\" class=\"touristic-event-sub-container\">\n <div part=\"touristic-event-type-container\" class=\"touristic-event-type-container\">\n {touristicEventType && touristicEventType.pictogram && (\n <img part=\"touristic-event-type-img\" class=\"touristic-event-type-img\" src={touristicEventType.pictogram} alt=\"\" />\n )}\n {touristicEventType && touristicEventType.type && (\n <div part=\"touristic-event-type-name\" class=\"touristic-event-type-name\">\n {touristicEventType.type}\n </div>\n )}\n </div>\n <div part=\"touristic-event-name\" class=\"touristic-event-name\">\n {this.touristicEvent.name}\n </div>\n {(this.touristicEvent.begin_date || this.touristicEvent.end_date) && (\n <div part=\"touristic-event-date-container\" class=\"touristic-event-date-container\">\n {this.touristicEvent.begin_date === this.touristicEvent.end_date && (\n <div part=\"touristic-event-date\" class=\"touristic-event-date\">\n {translate[state.language].date} : {this.touristicEvent.begin_date}\n </div>\n )}\n {this.touristicEvent.begin_date && this.touristicEvent.begin_date !== this.touristicEvent.end_date && (\n <div part=\"touristic-event-date\" class=\"touristic-event-date\">\n {translate[state.language].startDate} : {this.touristicEvent.begin_date}\n </div>\n )}\n {this.touristicEvent.end_date && this.touristicEvent.begin_date !== this.touristicEvent.end_date && (\n <div part=\"touristic-event-date\" class=\"touristic-event-date\">\n {translate[state.language].endDate} : {this.touristicEvent.end_date}\n </div>\n )}\n </div>\n )}\n </div>\n\n {this.isInsideHorizontalList && (\n <div part=\"touristic-event-more-detail-container\" class=\"touristic-event-more-detail-container\">\n <button part=\"more-details-button\" class=\"more-details-button\" onClick={() => this.touristicEventCardPress.emit(this.touristicEvent.id)}>\n Plus de détails\n </button>\n </div>\n )}\n </div>\n </Host>\n );\n }\n}\n"]}
1
+ {"version":3,"file":"grw-touristic-event-card.js","sourceRoot":"","sources":["../../../src/components/grw-touristic-event-card/grw-touristic-event-card.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,IAAI,EAAE,YAAY,EAAE,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAgB,MAAM,EAAE,MAAM,eAAe,CAAC;AAClH,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AACzD,OAAO,KAAK,MAAM,aAAa,CAAC;AAChC,OAAO,MAAM,EAAE,EAAE,QAAQ,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AAQlE,MAAM,OAAO,iBAAiB;;0BAQP,QAAQ;;2BAGP,KAAK;sCACM,KAAK;iCACT,KAAK;uBAKf,KAAK;;IAGxB,8BAA8B;QAC5B,IAAI,IAAI,CAAC,oBAAoB,EAAE,CAAC;YAC9B,IAAI,CAAC,oBAAoB,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;QACvC,CAAC;QACD,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC;IACtB,CAAC;IAGD,0BAA0B;QACxB,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC;IACvB,CAAC;IAED,aAAa;QACX,IAAI,IAAI,CAAC,uBAAuB,IAAI,CAAC,IAAI,CAAC,oB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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Build, Component, Host, getAssetPath, h, State, Prop, Event, EventEmitter, Listen } from '@stencil/core';\nimport { translate } from 'i18n/i18n';\nimport { getDataInStore } from 'services/grw-db.service';\nimport state from 'store/store';\nimport Swiper, { Keyboard, Navigation, Pagination } from 'swiper';\nimport { OutdoorSite, TouristicEvent, Trek } from 'types/types';\n\n@Component({\n tag: 'grw-touristic-event-card',\n styleUrl: 'grw-touristic-event-card.scss',\n shadow: true,\n})\nexport class GrwTouristicEvent {\n @Event() touristicEventCardPress: EventEmitter<number>;\n swiperTouristicEvent?: Swiper;\n swiperTouristicEventRef?: HTMLDivElement;\n prevElTouristicEventRef?: HTMLDivElement;\n nextElTouristicEventRef?: HTMLDivElement;\n paginationElTouristicEventRef?: HTMLDivElement;\n\n @Prop() fontFamily = 'Roboto';\n\n @Prop() touristicEvent: TouristicEvent;\n @Prop() isLargeView = false;\n @Prop() isInsideHorizontalList = false;\n @State() displayFullscreen = false;\n\n @Event() cardTouristicEventMouseOver: EventEmitter<number>;\n @Event() cardTouristicEventMouseLeave: EventEmitter;\n\n @State() offline = false;\n\n @Listen('trekDownloadedSuccessConfirm', { target: 'window' })\n onTrekDownloadedSuccessConfirm() {\n if (this.swiperTouristicEvent) {\n this.swiperTouristicEvent.slideTo(0);\n }\n this.offline = true;\n }\n\n @Listen('trekDeleteSuccessConfirm', { target: 'window' })\n onTrekDeleteSuccessConfirm() {\n this.offline = false;\n }\n\n handleSwipers() {\n if (this.swiperTouristicEventRef && !this.swiperTouristicEvent) {\n this.swiperTouristicEvent = new Swiper(this.swiperTouristicEventRef, {\n modules: [Navigation, Pagination, Keyboard],\n navigation: {\n prevEl: this.prevElTouristicEventRef,\n nextEl: this.nextElTouristicEventRef,\n },\n pagination: { el: this.paginationElTouristicEventRef },\n allowTouchMove: false,\n keyboard: false,\n loop: true,\n });\n this.swiperTouristicEventRef.onfullscreenchange = () => {\n this.displayFullscreen = !this.displayFullscreen && !this.offline;\n if (this.displayFullscreen) {\n this.swiperTouristicEvent.keyboard.enable();\n } else {\n this.swiperTouristicEvent.keyboard.disable();\n }\n };\n }\n }\n\n componentDidUpdate() {\n this.handleSwipers();\n }\n\n componentDidLoad() {\n this.handleOffline();\n this.handleSwipers();\n }\n\n async handleOffline() {\n if (state.currentTrek) {\n const trekInStore: Trek = await getDataInStore('treks', state.currentTrek.id);\n if (trekInStore && trekInStore.offline) {\n const touristicEventInStore: TouristicEvent = await getDataInStore('touristicEvents', this.touristicEvent.id);\n this.offline = trekInStore && trekInStore.offline && touristicEventInStore && touristicEventInStore.offline;\n }\n } else if (state.currentOutdoorSite) {\n const outdoorSiteInStore: OutdoorSite = await getDataInStore('outdoorSites', state.currentOutdoorSite.id);\n if (outdoorSiteInStore && outdoorSiteInStore.offline) {\n const touristicEventInStore: TouristicEvent = await getDataInStore('touristicEvents', this.touristicEvent.id);\n this.offline = touristicEventInStore && touristicEventInStore.offline;\n }\n }\n }\n\n handleFullscreen() {\n if (this.touristicEvent.attachments && this.touristicEvent.attachments[0] && this.touristicEvent.attachments[0].url) {\n this.swiperTouristicEventRef.requestFullscreen();\n }\n }\n\n @Listen('mouseover')\n handleMouseOver() {\n this.cardTouristicEventMouseOver.emit(this.touristicEvent.id);\n }\n\n @Listen('mouseleave')\n handleMouseLeave() {\n this.cardTouristicEventMouseLeave.emit();\n }\n\n render() {\n const defaultImageSrc = getAssetPath(`${Build.isDev ? '/' : ''}assets/default-image.svg`);\n const touristicEventType = state.touristicEventTypes.find(touristicEventType => touristicEventType.id === this.touristicEvent.type);\n return (\n <Host\n style={{\n '--font-family': this.fontFamily,\n 'width': this.isLargeView ? '100%' : 'auto',\n }}\n >\n <div\n part=\"touristic-event-card\"\n class={\n this.isLargeView\n ? `touristic-event-card touristic-event-card-large-view-container${\n state.selectedTouristicEventId === this.touristicEvent.id ? ' selected-touristic-event-card' : ''\n }${!this.isInsideHorizontalList ? ' is-inside-vertical-list' : ''}`\n : ` touristic-event-card touristic-event-card-container${state.selectedTouristicEventId === this.touristicEvent.id ? ' selected-touristic-event-card' : ''}${\n !this.isInsideHorizontalList ? ' is-inside-vertical-list' : ''\n }`\n }\n onClick={() => {\n if (!this.isInsideHorizontalList) {\n this.touristicEventCardPress.emit(this.touristicEvent.id);\n }\n }}\n >\n <div part=\"touristic-event-img-container\" class=\"touristic-event-img-container\">\n {this.isInsideHorizontalList ? (\n <div part=\"swiper-touristic-event\" class=\"swiper swiper-touristic-event\" ref={el => (this.swiperTouristicEventRef = el)}>\n <div part=\"swiper-wrapper\" class=\"swiper-wrapper\">\n {this.touristicEvent.attachments.filter(attachment => attachment.type === 'image').length > 0 ? (\n this.touristicEvent.attachments\n .filter(attachment => attachment.type === 'image')\n .map(attachment => (\n <div part=\"swiper-slide\" class=\"swiper-slide\">\n <img\n part=\"touristic-event-img\"\n class={`touristic-event-img${this.displayFullscreen ? ' img-fullscreen' : ''}`}\n src={this.displayFullscreen ? (this.offline ? attachment.thumbnail : attachment.url) : attachment.thumbnail}\n loading=\"lazy\"\n /* @ts-ignore */\n onerror={event => {\n event.target.onerror = null;\n event.target.className = 'default-touristic-event-img';\n event.target.src = defaultImageSrc;\n }}\n onClick={() => this.handleFullscreen()}\n alt={attachment.legend}\n />\n </div>\n ))\n ) : (\n <div part=\"swiper-slide\" class=\"swiper-slide\">\n <img part=\"default-touristic-event-img\" class=\"default-touristic-event-img\" src={defaultImageSrc} alt=\"\" loading=\"lazy\" />\n </div>\n )}\n </div>\n <div\n style={{ display: this.offline ? 'none' : 'block' }}\n part=\"swiper-pagination\"\n class=\"swiper-pagination\"\n ref={el => (this.paginationElTouristicEventRef = el)}\n ></div>\n <div style={{ display: this.offline ? 'none' : 'flex' }} part=\"swiper-button-prev\" class=\"swiper-button-prev\" ref={el => (this.prevElTouristicEventRef = el)}></div>\n <div style={{ display: this.offline ? 'none' : 'flex' }} part=\"swiper-button-next\" class=\"swiper-button-next\" ref={el => (this.nextElTouristicEventRef = el)}></div>\n </div>\n ) : this.touristicEvent.attachments.filter(attachment => attachment.type === 'image').length > 0 ? (\n <img\n part=\"touristic-event-img\"\n class=\"touristic-event-img\"\n src={`${this.touristicEvent.attachments.filter(attachment => attachment.type === 'image')[0].thumbnail}`}\n alt={`${this.touristicEvent.attachments.filter(attachment => attachment.type === 'image')[0].legend}`}\n loading=\"lazy\"\n />\n ) : (\n <img class=\"image default-touristic-event-img\" src={defaultImageSrc} alt=\"\" loading=\"lazy\" />\n )}\n </div>\n <div part=\"touristic-event-sub-container\" class=\"touristic-event-sub-container\">\n <div part=\"touristic-event-type-container\" class=\"touristic-event-type-container\">\n {touristicEventType && touristicEventType.pictogram && (\n <img part=\"touristic-event-type-img\" class=\"touristic-event-type-img\" src={touristicEventType.pictogram} alt=\"\" />\n )}\n {touristicEventType && touristicEventType.type && (\n <div part=\"touristic-event-type-name\" class=\"touristic-event-type-name\">\n {touristicEventType.type}\n </div>\n )}\n </div>\n <div part=\"touristic-event-name\" class=\"touristic-event-name\">\n {this.touristicEvent.name}\n </div>\n {(this.touristicEvent.begin_date || this.touristicEvent.end_date) && (\n <div part=\"touristic-event-date-container\" class=\"touristic-event-date-container\">\n {this.touristicEvent.begin_date === this.touristicEvent.end_date && (\n <div part=\"touristic-event-date\" class=\"touristic-event-date\">\n {translate[state.language].date} : {this.touristicEvent.begin_date}\n </div>\n )}\n {this.touristicEvent.begin_date && this.touristicEvent.begin_date !== this.touristicEvent.end_date && (\n <div part=\"touristic-event-date\" class=\"touristic-event-date\">\n {translate[state.language].startDate} : {this.touristicEvent.begin_date}\n </div>\n )}\n {this.touristicEvent.end_date && this.touristicEvent.begin_date !== this.touristicEvent.end_date && (\n <div part=\"touristic-event-date\" class=\"touristic-event-date\">\n {translate[state.language].endDate} : {this.touristicEvent.end_date}\n </div>\n )}\n </div>\n )}\n </div>\n\n {this.isInsideHorizontalList && (\n <div part=\"touristic-event-more-detail-container\" class=\"touristic-event-more-detail-container\">\n <button part=\"more-details-button\" class=\"more-details-button\" onClick={() => this.touristicEventCardPress.emit(this.touristicEvent.id)}>\n Plus de détails\n </button>\n </div>\n )}\n </div>\n </Host>\n );\n }\n}\n"]}