@geotrekce/geotrek-rando-widget 0.0.2 → 0.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (98) hide show
  1. package/dist/cjs/geotrek-rando-widget.cjs.js +2 -2
  2. package/dist/cjs/grw-app.cjs.entry.js +93 -0
  3. package/dist/cjs/{grw-app_7.cjs.entry.js → grw-filter_6.cjs.entry.js} +424 -384
  4. package/dist/cjs/grw-information-desk-detail_3.cjs.entry.js +52 -0
  5. package/dist/cjs/grw-trek-card.cjs.entry.js +47 -0
  6. package/dist/cjs/{index-c6f73e30.js → index-c2c4531d.js} +46 -1
  7. package/dist/cjs/length-d315d156.js +34 -0
  8. package/dist/cjs/loader.cjs.js +2 -2
  9. package/dist/cjs/store-972b8d2a.js +209 -0
  10. package/dist/collection/collection-manifest.json +4 -0
  11. package/dist/collection/components/grw-app/grw-app.css +70 -5
  12. package/dist/collection/components/grw-app/grw-app.js +139 -33
  13. package/dist/collection/components/grw-filter/grw-filter.css +29 -0
  14. package/dist/collection/components/grw-filter/grw-filter.js +132 -0
  15. package/dist/collection/components/grw-information-desk-detail/grw-information-desk-detail.css +31 -0
  16. package/dist/collection/components/grw-information-desk-detail/grw-information-desk-detail.js +53 -0
  17. package/dist/collection/components/grw-map/grw-map.css +99 -0
  18. package/dist/collection/components/grw-map/grw-map.js +315 -42
  19. package/dist/collection/components/grw-poi-detail/grw-poi-detail.css +31 -0
  20. package/dist/collection/components/grw-poi-detail/grw-poi-detail.js +41 -0
  21. package/dist/collection/components/grw-sensitive-area-detail/grw-sensitive-area-detail.css +39 -0
  22. package/dist/collection/components/grw-sensitive-area-detail/grw-sensitive-area-detail.js +52 -0
  23. package/dist/collection/components/grw-trek-card/grw-trek-card.css +67 -30
  24. package/dist/collection/components/grw-trek-card/grw-trek-card.js +37 -13
  25. package/dist/collection/components/grw-trek-detail/grw-trek-detail.css +160 -1
  26. package/dist/collection/components/grw-trek-detail/grw-trek-detail.js +123 -8
  27. package/dist/collection/components/grw-treks-list/grw-treks-list.css +17 -3
  28. package/dist/collection/components/grw-treks-list/grw-treks-list.js +29 -7
  29. package/dist/collection/store/grw-trek-provider.js +36 -8
  30. package/dist/collection/store/grw-treks-provider.js +16 -7
  31. package/dist/collection/store/store.js +10 -0
  32. package/dist/collection/stories/App.js +22 -16
  33. package/dist/collection/stories/App.stories.js +14 -9
  34. package/dist/collection/stories/TrekCard.js +2 -1
  35. package/dist/collection/stories/TrekCard.stories.js +4 -3
  36. package/dist/collection/stories/TrekDetail.js +3 -1
  37. package/dist/collection/stories/TrekDetail.stories.js +5 -3
  38. package/dist/collection/stories/TrekMap.js +6 -4
  39. package/dist/collection/stories/TrekMap.stories.js +10 -7
  40. package/dist/collection/stories/TreksList.js +10 -9
  41. package/dist/collection/stories/TreksList.stories.js +4 -3
  42. package/dist/collection/stories/TreksMap.stories.js +6 -5
  43. package/dist/collection/utils/utils.js +2 -2
  44. package/dist/components/grw-app.js +76 -11
  45. package/dist/components/grw-filter.d.ts +11 -0
  46. package/dist/components/grw-filter.js +6 -0
  47. package/dist/components/grw-filter2.js +95 -0
  48. package/dist/components/grw-information-desk-detail.d.ts +11 -0
  49. package/dist/components/grw-information-desk-detail.js +6 -0
  50. package/dist/components/grw-information-desk-detail2.js +34 -0
  51. package/dist/components/grw-map2.js +263 -39
  52. package/dist/components/grw-poi-detail.d.ts +11 -0
  53. package/dist/components/grw-poi-detail.js +6 -0
  54. package/dist/components/grw-poi-detail2.js +32 -0
  55. package/dist/components/grw-sensitive-area-detail.d.ts +11 -0
  56. package/dist/components/grw-sensitive-area-detail.js +6 -0
  57. package/dist/components/grw-sensitive-area-detail2.js +37 -0
  58. package/dist/components/grw-trek-card2.js +11 -6
  59. package/dist/components/grw-trek-detail2.js +40 -7
  60. package/dist/components/grw-trek-provider2.js +36 -8
  61. package/dist/components/grw-treks-list2.js +10 -7
  62. package/dist/components/grw-treks-provider2.js +16 -7
  63. package/dist/components/length.js +2 -2
  64. package/dist/components/store.js +10 -0
  65. package/dist/esm/geotrek-rando-widget.js +2 -2
  66. package/dist/esm/grw-app.entry.js +89 -0
  67. package/dist/esm/{grw-app_7.entry.js → grw-filter_6.entry.js} +398 -357
  68. package/dist/esm/grw-information-desk-detail_3.entry.js +46 -0
  69. package/dist/esm/grw-trek-card.entry.js +43 -0
  70. package/dist/esm/{index-7aa9e822.js → index-192d910f.js} +47 -2
  71. package/dist/esm/length-d82189db.js +27 -0
  72. package/dist/esm/loader.js +2 -2
  73. package/dist/esm/store-5a42b5d8.js +206 -0
  74. package/dist/geotrek-rando-widget/geotrek-rando-widget.css +1 -1
  75. package/dist/geotrek-rando-widget/geotrek-rando-widget.esm.js +1 -1
  76. package/dist/geotrek-rando-widget/p-206a52d9.entry.js +1 -0
  77. package/dist/geotrek-rando-widget/p-2d9ae918.entry.js +1 -0
  78. package/dist/geotrek-rando-widget/p-6dce5e6c.js +2 -0
  79. package/dist/geotrek-rando-widget/p-8cfa03c0.entry.js +1 -0
  80. package/dist/geotrek-rando-widget/p-d3aa9819.entry.js +1 -0
  81. package/dist/geotrek-rando-widget/p-e63213a9.js +1 -0
  82. package/dist/geotrek-rando-widget/p-f3f7d6be.js +1 -0
  83. package/dist/types/components/grw-app/grw-app.d.ts +13 -2
  84. package/dist/types/components/grw-filter/grw-filter.d.ts +9 -0
  85. package/dist/types/components/grw-information-desk-detail/grw-information-desk-detail.d.ts +5 -0
  86. package/dist/types/components/grw-map/grw-map.d.ts +14 -4
  87. package/dist/types/components/grw-poi-detail/grw-poi-detail.d.ts +5 -0
  88. package/dist/types/components/grw-sensitive-area-detail/grw-sensitive-area-detail.d.ts +5 -0
  89. package/dist/types/components/grw-trek-card/grw-trek-card.d.ts +6 -4
  90. package/dist/types/components/grw-trek-detail/grw-trek-detail.d.ts +10 -4
  91. package/dist/types/components/grw-treks-list/grw-treks-list.d.ts +1 -0
  92. package/dist/types/components.d.ts +88 -3
  93. package/dist/types/store/store.d.ts +21 -1
  94. package/dist/types/types/types.d.ts +119 -3
  95. package/package.json +9 -10
  96. package/readme.md +19 -1
  97. package/dist/geotrek-rando-widget/p-332ba9ab.js +0 -2
  98. package/dist/geotrek-rando-widget/p-b7c66d2d.entry.js +0 -1
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- const index = require('./index-c6f73e30.js');
3
+ const index = require('./index-c2c4531d.js');
4
4
 
5
5
  /*
6
6
  Stencil Client Patch Browser v2.16.1 | MIT Licensed | https://stenciljs.com
@@ -15,5 +15,5 @@ const patchBrowser = () => {
15
15
  };
16
16
 
17
17
  patchBrowser().then(options => {
18
- return index.bootstrapLazy([["grw-app_7.cjs",[[1,"grw-app",{"api":[1],"inBbox":[1,"in-bbox"],"cities":[1],"districts":[1],"structures":[1],"themes":[1],"portals":[1],"routes":[1],"practices":[1],"appName":[1,"app-name"],"urlLayer":[1,"url-layer"],"center":[1],"zoom":[8],"attribution":[1],"colorPrimary":[1,"color-primary"],"colorPrimaryTint":[1,"color-primary-tint"],"colorTrekLine":[1,"color-trek-line"],"colorDepartureIcon":[1,"color-departure-icon"],"colorArrivalIcon":[1,"color-arrival-icon"],"showTrek":[32],"showMap":[32],"isLargeView":[32],"currentTrekId":[32]},[[0,"trekCardPress","onTrekCardPress"],[9,"resize","onWindowResize"]]],[1,"grw-treks-list",{"colorPrimary":[1,"color-primary"],"colorPrimaryTint":[1,"color-primary-tint"],"treksToDisplay":[32]}],[0,"grw-map",{"urlLayer":[1,"url-layer"],"attribution":[1],"center":[1],"zoom":[2],"colorTrekLine":[1,"color-trek-line"],"colorDepartureIcon":[1,"color-departure-icon"],"colorArrivalIcon":[1,"color-arrival-icon"],"colorPrimary":[1,"color-primary"],"colorPrimaryTint":[1,"color-primary-tint"],"mapIsReady":[32]}],[1,"grw-trek-detail",{"trek":[16],"colorPrimary":[1,"color-primary"],"colorPrimaryTint":[1,"color-primary-tint"],"currentTrek":[32],"difficulty":[32],"route":[32],"practice":[32]}],[1,"grw-trek-provider",{"language":[1],"api":[1],"trekId":[1,"trek-id"]}],[1,"grw-treks-provider",{"language":[1],"api":[1],"inBbox":[1,"in-bbox"],"cities":[1],"districts":[1],"structures":[1],"themes":[1],"portals":[1],"routes":[1],"practices":[1]}],[1,"grw-trek-card",{"trek":[16],"colorPrimary":[1,"color-primary"],"colorPrimaryTint":[1,"color-primary-tint"],"currentTrek":[32],"difficulty":[32],"route":[32],"practice":[32]}]]]], options);
18
+ return index.bootstrapLazy([["grw-trek-card.cjs",[[1,"grw-trek-card",{"trek":[16],"colorPrimary":[1,"color-primary"],"colorPrimaryTint":[1,"color-primary-tint"],"isLargeView":[4,"is-large-view"],"currentTrek":[32],"difficulty":[32],"route":[32],"practice":[32],"themes":[32]}]]],["grw-information-desk-detail_3.cjs",[[1,"grw-information-desk-detail",{"informationDesk":[16]}],[1,"grw-poi-detail",{"poi":[16]}],[1,"grw-sensitive-area-detail",{"sensitiveArea":[16]}]]],["grw-filter_6.cjs",[[1,"grw-trek-detail",{"trek":[16],"colorPrimary":[1,"color-primary"],"colorPrimaryShade":[1,"color-primary-shade"],"colorPrimaryTint":[1,"color-primary-tint"],"difficulty":[32],"route":[32],"practice":[32],"themes":[32],"labels":[32],"sources":[32],"accessibilities":[32],"accessibilityLevel":[32],"currentTrek":[32]}],[1,"grw-treks-list",{"colorPrimary":[1,"color-primary"],"colorPrimaryTint":[1,"color-primary-tint"],"isLargeView":[4,"is-large-view"],"treksToDisplay":[32]}],[1,"grw-filter",{"filterType":[1,"filter-type"],"filterName":[1,"filter-name"],"filterNameProperty":[1,"filter-name-property"]}],[0,"grw-map",{"urlLayer":[1,"url-layer"],"attribution":[1],"center":[1],"zoom":[2],"colorPrimary":[1,"color-primary"],"colorPrimaryTint":[1,"color-primary-tint"],"colorTrekLine":[1,"color-trek-line"],"colorDepartureIcon":[1,"color-departure-icon"],"colorArrivalIcon":[1,"color-arrival-icon"],"colorSensitiveArea":[1,"color-sensitive-area"],"colorPoiIcon":[1,"color-poi-icon"],"mapIsReady":[32]}],[1,"grw-trek-provider",{"language":[1],"api":[1],"trekId":[1,"trek-id"]}],[1,"grw-treks-provider",{"language":[1],"api":[1],"inBbox":[1,"in-bbox"],"cities":[1],"districts":[1],"structures":[1],"themes":[1],"portals":[1],"routes":[1],"practices":[1]}]]],["grw-app.cjs",[[1,"grw-app",{"api":[1],"language":[1],"inBbox":[1,"in-bbox"],"cities":[1],"districts":[1],"structures":[1],"themes":[1],"portals":[1],"routes":[1],"practices":[1],"urlLayer":[1,"url-layer"],"center":[1],"zoom":[8],"attribution":[1],"colorPrimary":[1,"color-primary"],"colorPrimaryShade":[1,"color-primary-shade"],"colorPrimaryTint":[1,"color-primary-tint"],"colorTrekLine":[1,"color-trek-line"],"colorDepartureIcon":[1,"color-departure-icon"],"colorArrivalIcon":[1,"color-arrival-icon"],"colorSensitiveArea":[1,"color-sensitive-area"],"colorPoiIcon":[1,"color-poi-icon"],"showTrek":[32],"showTreksMap":[32],"showTrekMap":[32],"showFilters":[32],"isLargeView":[32],"currentTrekId":[32]},[[0,"trekCardPress","onTrekCardPress"],[9,"resize","onWindowResize"]]]]]], options);
19
19
  });
@@ -0,0 +1,93 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ const index = require('./index-c2c4531d.js');
6
+ const store = require('./store-972b8d2a.js');
7
+
8
+ const arrowBackImage = `<svg xmlns="http://www.w3.org/2000/svg" width="512" height="512" viewBox="0 0 512 512"><polyline points="244 400 100 256 244 112" style="fill:none;stroke:#ffffff;stroke-linecap:round;stroke-linejoin:round;stroke-width:48px"/><line x1="120" y1="256" x2="412" y2="256" style="fill:none;stroke:#ffffff;stroke-linecap:round;stroke-linejoin:round;stroke-width:48px"/></svg>`;
9
+
10
+ const grwAppCss = ".app-container{position:relative;height:100%;max-height:100vh;font-family:\"Roboto\"}.header-container,.large-view-header-container{display:flex;align-items:center;background-color:var(--color-primary);height:64px}.header-container .arrow-back-icon,.large-view-header-container .arrow-back-icon{width:48px;height:auto;margin-left:24px}.header-container .arrow-back-icon svg,.large-view-header-container .arrow-back-icon svg{cursor:pointer;width:48px;height:auto}.header-container .handle-filters-button,.large-view-header-container .handle-filters-button{user-select:none;cursor:pointer;color:var(--color-primary);background-color:#ffffff;margin-left:36px;border-radius:8px;padding:8px}.header-container .attribution-container,.large-view-header-container .attribution-container{position:absolute;right:24px}.header-container .attribution-container a,.large-view-header-container .attribution-container a{color:#ffffff;text-decoration:none}.options-container{height:calc(100% - 64px);position:absolute;width:100%;z-index:1100;top:64px}.filters-container{position:absolute;width:100%;background-color:#ffffff;padding:36px 0px;z-index:1100}.filters-container .close-filters-button{cursor:pointer;font-weight:bold;position:absolute;top:12px;right:12px;padding:12px;border-radius:12px;color:var(--color-primary);border:1px var(--color-primary) solid}.filters-container .close-filters-button:hover{background-color:var(--color-primary);color:#ffffff}.filters-container .filter-margin-top{margin-top:24px}.filters-container .current-treks-length{margin:0px 0px 32px 8px;color:var(--color-primary);font-size:24px;font-weight:bold}.back-filters-container{background-color:rgba(0, 0, 0, 0.5);width:100%;height:calc(100% - 64px);position:absolute;z-index:1099;top:64px}.loader-container,.large-view-loader-container{display:flex;justify-content:center;align-items:center;height:100%}.loader-container .loader,.large-view-loader-container .loader{width:48px;height:48px;border:5px solid var(--color-primary-tint);border-bottom-color:var(--color-primary);border-radius:50%;display:inline-block;box-sizing:border-box;animation:rotation 1s linear infinite}@keyframes rotation{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}.content-container{position:relative;display:flex;height:calc(100% - 64px)}.app-treks-list-container,.app-trek-detail-container,.large-view-app-treks-list-container,.large-view-app-trek-detail-container{height:100%}.app-map-container,.large-view-app-map-container{width:100%;height:100%}.map-visibility-button{cursor:pointer;display:flex;justify-content:center;align-items:center;position:absolute;bottom:24px;width:100%;z-index:400;user-select:none}.map-visibility-button div{background-color:var(--color-primary);color:#ffffff;padding:12px;border-radius:24px;width:120px;text-align:center}.header-container .title{font-size:24px}.loader-container{position:absolute;width:100%}.app-treks-list-container,.app-trek-detail-container{width:100%}.app-map-container{position:relative;width:100%;position:absolute}.large-view-header-container .title{font-size:32px}.large-view-loader-container{position:relative;width:50%}.large-view-app-treks-list-container,.large-view-app-trek-detail-container{width:50%}.large-view-app-map-container{position:relative;width:50%}";
11
+
12
+ const GrwApp = class {
13
+ constructor(hostRef) {
14
+ index.registerInstance(this, hostRef);
15
+ this.showTrek = false;
16
+ this.showTreksMap = false;
17
+ this.showTrekMap = false;
18
+ this.showFilters = false;
19
+ this.isLargeView = false;
20
+ this.language = 'fr';
21
+ this.colorPrimary = '#6b0030';
22
+ this.colorPrimaryShade = '#4a0021';
23
+ this.colorPrimaryTint = '#974c6e';
24
+ this.colorTrekLine = '#6b0030';
25
+ this.colorDepartureIcon = '#006b3b';
26
+ this.colorArrivalIcon = '#85003b';
27
+ this.colorSensitiveArea = '#4974a5';
28
+ this.colorPoiIcon = '#974c6e';
29
+ this.handlePopStateBind = this.handlePopState.bind(this);
30
+ this.largeViewSize = 1024;
31
+ }
32
+ onTrekCardPress(event) {
33
+ this.currentTrekId = event.detail;
34
+ this.showTrek = !this.showTrek;
35
+ const url = new URL(window.location.toString());
36
+ url.searchParams.set('trek', this.currentTrekId.toString());
37
+ window.history.pushState({}, '', url);
38
+ }
39
+ onWindowResize() {
40
+ this.handleView();
41
+ }
42
+ watchPropHandler() {
43
+ window.dispatchEvent(new window.Event('resize'));
44
+ }
45
+ componentDidLoad() {
46
+ this.handleView();
47
+ window.addEventListener('popstate', this.handlePopStateBind, false);
48
+ }
49
+ onTrekDetailsClose() {
50
+ this.forwardTrekId = this.currentTrekId;
51
+ this.currentTrekId = null;
52
+ this.showTrek = !this.showTrek;
53
+ }
54
+ handleView() {
55
+ this.isLargeView = this.element.getBoundingClientRect().width >= this.largeViewSize;
56
+ this.showTreksMap = this.isLargeView;
57
+ this.showTrekMap = this.isLargeView;
58
+ }
59
+ handleFilters() {
60
+ this.showFilters = !this.showFilters;
61
+ }
62
+ handlePopState() {
63
+ if (this.showTrek) {
64
+ this.onTrekDetailsClose();
65
+ }
66
+ else if (this.forwardTrekId) {
67
+ this.currentTrekId = this.forwardTrekId;
68
+ this.forwardTrekId = null;
69
+ this.showTrek = !this.showTrek;
70
+ }
71
+ }
72
+ handleShowMap() {
73
+ if (this.currentTrekId) {
74
+ this.showTrekMap = !this.showTrekMap;
75
+ }
76
+ else {
77
+ this.showTreksMap = !this.showTreksMap;
78
+ }
79
+ }
80
+ disconnectedCallback() {
81
+ window.removeEventListener('popstate', this.handlePopStateBind);
82
+ }
83
+ render() {
84
+ return (index.h(index.Host, { style: { '--color-primary': this.colorPrimary, '--color-primary-tint': this.colorPrimaryTint, '--color-primary-shade': this.colorPrimaryShade } }, index.h("grw-treks-provider", { api: this.api, language: this.language, "in-bbox": this.inBbox, cities: this.cities, districts: this.districts, structures: this.structures, themes: this.themes, portals: this.portals, routes: this.routes, practices: this.practices }), this.showTrek && this.currentTrekId && index.h("grw-trek-provider", { api: store.state.api, language: this.language, "trek-id": this.currentTrekId }), index.h("div", { class: "app-container" }, index.h("div", { class: this.isLargeView ? 'large-view-header-container' : 'header-container' }, this.showTrek ? (index.h("div", { onClick: () => window.history.back(), class: "arrow-back-icon", innerHTML: arrowBackImage })) : (index.h("div", { onClick: () => this.handleFilters(), class: "handle-filters-button" }, "FILTRER")), !this.showTrek && this.showFilters && (index.h("div", { class: "options-container" }, index.h("div", { class: "filters-container" }, index.h("div", { class: "current-treks-length" }, `${store.state.currentTreks.length} résultat${store.state.currentTreks.length > 1 ? 's' : ''}`), index.h("div", { onClick: () => this.handleFilters(), class: "close-filters-button" }, "X"), index.h("div", null, index.h("grw-filter", { filterName: "Pratique", filterType: "practices", filterNameProperty: "name" })), index.h("div", { class: "filter-margin-top" }, index.h("grw-filter", { filterName: "Difficult\u00E9", filterType: "difficulties", filterNameProperty: "label" })), index.h("div", { class: "filter-margin-top" }, index.h("grw-filter", { filterName: "Dur\u00E9e", filterType: "durations", filterNameProperty: "name" }))), index.h("div", { onClick: () => this.handleFilters(), class: "back-filters-container" }))), index.h("div", { class: "attribution-container" }, index.h("a", { target: "_blank", href: "https://geotrek.fr" }, "GEOTREK"))), index.h("div", { class: "content-container" }, index.h("div", { class: this.isLargeView ? 'large-view-app-treks-list-container' : 'app-treks-list-container', style: { display: this.showTrek ? 'none' : 'flex', position: this.showTrek ? 'absolute' : 'relative' } }, index.h("grw-treks-list", { "is-large-view": this.isLargeView, "color-primary": this.colorPrimary, "color-primary-tint": this.colorPrimaryTint })), this.showTrek && !store.state.currentTrek && (index.h("div", { class: this.isLargeView ? 'large-view-loader-container' : 'loader-container' }, index.h("span", { class: "loader" }))), store.state.currentTrek && (index.h("div", { class: this.isLargeView ? 'large-view-app-trek-detail-container' : 'app-trek-detail-container' }, index.h("grw-trek-detail", { "color-primary": this.colorPrimary, "color-primary-shade": this.colorPrimaryShade, "color-primary-tint": this.colorPrimaryTint }))), index.h("grw-map", { class: this.isLargeView ? 'large-view-app-map-container' : 'app-map-container', style: { visibility: (this.showTreksMap && !this.showTrek) || (this.showTrekMap && this.showTrek) ? 'visible' : 'hidden' }, "url-layer": this.urlLayer, center: this.center, zoom: this.zoom, attribution: this.attribution, "color-primary": this.colorPrimary, "color-primary-tint": this.colorPrimaryTint, "color-trek-line": this.colorTrekLine, "color-departure-icon": this.colorDepartureIcon, "color-arrival-icon": this.colorArrivalIcon, "color-sensitive-area": this.colorSensitiveArea, "color-poi-icon": this.colorPoiIcon })), index.h("div", { class: "map-visibility-button", style: { display: this.isLargeView ? 'none' : 'flex' } }, index.h("div", { onClick: () => this.handleShowMap() }, this.showTreksMap || this.showTrekMap ? (this.showTrek ? 'Voir la fiche' : 'Voir la liste') : 'Voir la carte')))));
85
+ }
86
+ get element() { return index.getElement(this); }
87
+ static get watchers() { return {
88
+ "isLargeView": ["watchPropHandler"]
89
+ }; }
90
+ };
91
+ GrwApp.style = grwAppCss;
92
+
93
+ exports.grw_app = GrwApp;