@geotrekce/geotrek-rando-widget 0.0.1 → 0.0.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.
- package/dist/cjs/geotrek-rando-widget.cjs.js +2 -2
- package/dist/cjs/grw-app_7.cjs.entry.js +137 -55
- package/dist/cjs/{index-31255e29.js → index-c6f73e30.js} +36 -0
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/collection/assets/departure-arrival.svg +1 -1
- package/dist/collection/components/grw-app/grw-app.css +60 -37
- package/dist/collection/components/grw-app/grw-app.js +277 -15
- package/dist/collection/components/grw-map/grw-map.css +36 -0
- package/dist/collection/components/grw-map/grw-map.js +157 -18
- package/dist/collection/components/grw-trek-card/grw-trek-card.js +87 -32
- package/dist/collection/components/grw-trek-detail/grw-trek-detail.css +1 -1
- package/dist/collection/components/grw-trek-detail/grw-trek-detail.js +87 -32
- package/dist/collection/components/grw-treks-list/grw-treks-list.css +3 -12
- package/dist/collection/components/grw-treks-list/grw-treks-list.js +46 -4
- package/dist/collection/store/grw-trek-provider.js +28 -6
- package/dist/collection/store/grw-treks-provider.js +155 -9
- package/dist/collection/stories/App.js +31 -1
- package/dist/collection/stories/App.stories.js +21 -1
- package/dist/collection/stories/TrekCard.js +8 -3
- package/dist/collection/stories/TrekCard.stories.js +2 -0
- package/dist/collection/stories/TrekDetail.js +8 -3
- package/dist/collection/stories/TrekDetail.stories.js +2 -0
- package/dist/collection/stories/TrekMap.js +10 -3
- package/dist/collection/stories/TrekMap.stories.js +13 -1
- package/dist/collection/stories/TreksList.js +16 -3
- package/dist/collection/stories/TreksList.stories.js +10 -0
- package/dist/collection/stories/TreksMap.js +12 -3
- package/dist/collection/stories/TreksMap.stories.js +15 -1
- package/dist/components/grw-app.js +39 -6
- package/dist/components/grw-map2.js +56 -20
- package/dist/components/grw-trek-card2.js +25 -7
- package/dist/components/grw-trek-detail2.js +26 -8
- package/dist/components/grw-trek-provider2.js +10 -7
- package/dist/components/grw-treks-list2.js +10 -4
- package/dist/components/grw-treks-provider2.js +26 -11
- package/dist/esm/geotrek-rando-widget.js +2 -2
- package/dist/esm/grw-app_7.entry.js +137 -55
- package/dist/esm/{index-b36f38f5.js → index-7aa9e822.js} +36 -0
- package/dist/esm/loader.js +2 -2
- package/dist/geotrek-rando-widget/geotrek-rando-widget.esm.js +1 -1
- package/dist/geotrek-rando-widget/p-332ba9ab.js +2 -0
- package/dist/geotrek-rando-widget/p-b7c66d2d.entry.js +1 -0
- package/dist/types/components/grw-app/grw-app.d.ts +21 -2
- package/dist/types/components/grw-map/grw-map.d.ts +8 -0
- package/dist/types/components/grw-trek-card/grw-trek-card.d.ts +3 -1
- package/dist/types/components/grw-trek-detail/grw-trek-detail.d.ts +2 -0
- package/dist/types/components/grw-treks-list/grw-treks-list.d.ts +2 -0
- package/dist/types/components.d.ts +70 -0
- package/dist/types/store/grw-trek-provider.d.ts +1 -0
- package/dist/types/store/grw-treks-provider.d.ts +8 -0
- package/package.json +1 -1
- package/dist/geotrek-rando-widget/p-f721481d.js +0 -2
- package/dist/geotrek-rando-widget/p-fe788eaa.entry.js +0 -1
|
@@ -14140,33 +14140,46 @@ var leafletSrc = createCommonjsModule(function (module, exports) {
|
|
|
14140
14140
|
//# sourceMappingURL=leaflet-src.js.map
|
|
14141
14141
|
});
|
|
14142
14142
|
|
|
14143
|
-
const departureArrivalImage = `<svg xmlns="http://www.w3.org/2000/svg" width="512" height="512" viewBox="0 0 512 512"><path d="M80,464V68.14a8,8,0,0,1,4-6.9C91.81,56.66,112.92,48,160,48c64,0,145,48,192,48a199.53,199.53,0,0,0,77.23-15.77A2,2,0,0,1,432,82.08V301.44a4,4,0,0,1-2.39,3.65C421.37,308.7,392.33,320,352,320c-48,0-128-32-192-32s-80,16-80,16" style=";fill
|
|
14143
|
+
const departureArrivalImage = `<svg xmlns="http://www.w3.org/2000/svg" width="512" height="512" viewBox="0 0 512 512"><path d="M80,464V68.14a8,8,0,0,1,4-6.9C91.81,56.66,112.92,48,160,48c64,0,145,48,192,48a199.53,199.53,0,0,0,77.23-15.77A2,2,0,0,1,432,82.08V301.44a4,4,0,0,1-2.39,3.65C421.37,308.7,392.33,320,352,320c-48,0-128-32-192-32s-80,16-80,16" style=";fill:#ffffff;stroke:currentColor;stroke-linecap:round;stroke-miterlimit:10;stroke-width:32px"/></svg>`;
|
|
14144
14144
|
|
|
14145
|
-
const grwMapCss = ".leaflet-pane,.leaflet-tile,.leaflet-marker-icon,.leaflet-marker-shadow,.leaflet-tile-container,.leaflet-pane>svg,.leaflet-pane>canvas,.leaflet-zoom-box,.leaflet-image-layer,.leaflet-layer{position:absolute;left:0;top:0}.leaflet-container{overflow:hidden}.leaflet-tile,.leaflet-marker-icon,.leaflet-marker-shadow{-webkit-user-select:none;-moz-user-select:none;user-select:none;-webkit-user-drag:none}.leaflet-tile::selection{background:transparent}.leaflet-safari .leaflet-tile{image-rendering:-webkit-optimize-contrast}.leaflet-safari .leaflet-tile-container{width:1600px;height:1600px;-webkit-transform-origin:0 0}.leaflet-marker-icon,.leaflet-marker-shadow{display:block}.leaflet-container .leaflet-overlay-pane svg{max-width:none !important;max-height:none !important}.leaflet-container .leaflet-marker-pane img,.leaflet-container .leaflet-shadow-pane img,.leaflet-container .leaflet-tile-pane img,.leaflet-container img.leaflet-image-layer,.leaflet-container .leaflet-tile{max-width:none !important;max-height:none !important;width:auto;padding:0}.leaflet-container.leaflet-touch-zoom{-ms-touch-action:pan-x pan-y;touch-action:pan-x pan-y}.leaflet-container.leaflet-touch-drag{-ms-touch-action:pinch-zoom;touch-action:none;touch-action:pinch-zoom}.leaflet-container.leaflet-touch-drag.leaflet-touch-zoom{-ms-touch-action:none;touch-action:none}.leaflet-container{-webkit-tap-highlight-color:transparent}.leaflet-container a{-webkit-tap-highlight-color:rgba(51, 181, 229, 0.4)}.leaflet-tile{filter:inherit;visibility:hidden}.leaflet-tile-loaded{visibility:inherit}.leaflet-zoom-box{width:0;height:0;-moz-box-sizing:border-box;box-sizing:border-box;z-index:800}.leaflet-overlay-pane svg{-moz-user-select:none}.leaflet-pane{z-index:400}.leaflet-tile-pane{z-index:200}.leaflet-overlay-pane{z-index:400}.leaflet-shadow-pane{z-index:500}.leaflet-marker-pane{z-index:600}.leaflet-tooltip-pane{z-index:650}.leaflet-popup-pane{z-index:700}.leaflet-map-pane canvas{z-index:100}.leaflet-map-pane svg{z-index:200}.leaflet-vml-shape{width:1px;height:1px}.lvml{behavior:url(#default#VML);display:inline-block;position:absolute}.leaflet-control{position:relative;z-index:800;pointer-events:visiblePainted;pointer-events:auto}.leaflet-top,.leaflet-bottom{position:absolute;z-index:1000;pointer-events:none}.leaflet-top{top:0}.leaflet-right{right:0}.leaflet-bottom{bottom:0}.leaflet-left{left:0}.leaflet-control{float:left;clear:both}.leaflet-right .leaflet-control{float:right}.leaflet-top .leaflet-control{margin-top:10px}.leaflet-bottom .leaflet-control{margin-bottom:10px}.leaflet-left .leaflet-control{margin-left:10px}.leaflet-right .leaflet-control{margin-right:10px}.leaflet-fade-anim .leaflet-popup{opacity:0;-webkit-transition:opacity 0.2s linear;-moz-transition:opacity 0.2s linear;transition:opacity 0.2s linear}.leaflet-fade-anim .leaflet-map-pane .leaflet-popup{opacity:1}.leaflet-zoom-animated{-webkit-transform-origin:0 0;-ms-transform-origin:0 0;transform-origin:0 0}svg.leaflet-zoom-animated{will-change:transform}.leaflet-zoom-anim .leaflet-zoom-animated{-webkit-transition:-webkit-transform 0.25s cubic-bezier(0,0,0.25,1);-moz-transition:-moz-transform 0.25s cubic-bezier(0,0,0.25,1);transition:transform 0.25s cubic-bezier(0,0,0.25,1)}.leaflet-zoom-anim .leaflet-tile,.leaflet-pan-anim .leaflet-tile{-webkit-transition:none;-moz-transition:none;transition:none}.leaflet-zoom-anim .leaflet-zoom-hide{visibility:hidden}.leaflet-interactive{cursor:pointer}.leaflet-grab{cursor:-webkit-grab;cursor:-moz-grab;cursor:grab}.leaflet-crosshair,.leaflet-crosshair .leaflet-interactive{cursor:crosshair}.leaflet-popup-pane,.leaflet-control{cursor:auto}.leaflet-dragging .leaflet-grab,.leaflet-dragging .leaflet-grab .leaflet-interactive,.leaflet-dragging .leaflet-marker-draggable{cursor:move;cursor:-webkit-grabbing;cursor:-moz-grabbing;cursor:grabbing}.leaflet-marker-icon,.leaflet-marker-shadow,.leaflet-image-layer,.leaflet-pane>svg path,.leaflet-tile-container{pointer-events:none}.leaflet-marker-icon.leaflet-interactive,.leaflet-image-layer.leaflet-interactive,.leaflet-pane>svg path.leaflet-interactive,svg.leaflet-image-layer.leaflet-interactive path{pointer-events:visiblePainted;pointer-events:auto}.leaflet-container{background:#ddd;outline-offset:1px}.leaflet-container a{color:#0078A8}.leaflet-zoom-box{border:2px dotted #38f;background:rgba(255,255,255,0.5)}.leaflet-container{font-family:\"Helvetica Neue\", Arial, Helvetica, sans-serif;font-size:12px;font-size:0.75rem;line-height:1.5}.leaflet-bar{box-shadow:0 1px 5px rgba(0,0,0,0.65);border-radius:4px}.leaflet-bar a{background-color:#fff;border-bottom:1px solid #ccc;width:26px;height:26px;line-height:26px;display:block;text-align:center;text-decoration:none;color:black}.leaflet-bar a,.leaflet-control-layers-toggle{background-position:50% 50%;background-repeat:no-repeat;display:block}.leaflet-bar a:hover,.leaflet-bar a:focus{background-color:#f4f4f4}.leaflet-bar a:first-child{border-top-left-radius:4px;border-top-right-radius:4px}.leaflet-bar a:last-child{border-bottom-left-radius:4px;border-bottom-right-radius:4px;border-bottom:none}.leaflet-bar a.leaflet-disabled{cursor:default;background-color:#f4f4f4;color:#bbb}.leaflet-touch .leaflet-bar a{width:30px;height:30px;line-height:30px}.leaflet-touch .leaflet-bar a:first-child{border-top-left-radius:2px;border-top-right-radius:2px}.leaflet-touch .leaflet-bar a:last-child{border-bottom-left-radius:2px;border-bottom-right-radius:2px}.leaflet-control-zoom-in,.leaflet-control-zoom-out{font:bold 18px 'Lucida Console', Monaco, monospace;text-indent:1px}.leaflet-touch .leaflet-control-zoom-in,.leaflet-touch .leaflet-control-zoom-out{font-size:22px}.leaflet-control-layers{box-shadow:0 1px 5px rgba(0,0,0,0.4);background:#fff;border-radius:5px}.leaflet-control-layers-toggle{background-image:url(images/layers.png);width:36px;height:36px}.leaflet-retina .leaflet-control-layers-toggle{background-image:url(images/layers-2x.png);background-size:26px 26px}.leaflet-touch .leaflet-control-layers-toggle{width:44px;height:44px}.leaflet-control-layers .leaflet-control-layers-list,.leaflet-control-layers-expanded .leaflet-control-layers-toggle{display:none}.leaflet-control-layers-expanded .leaflet-control-layers-list{display:block;position:relative}.leaflet-control-layers-expanded{padding:6px 10px 6px 6px;color:#333;background:#fff}.leaflet-control-layers-scrollbar{overflow-y:scroll;overflow-x:hidden;padding-right:5px}.leaflet-control-layers-selector{margin-top:2px;position:relative;top:1px}.leaflet-control-layers label{display:block;font-size:13px;font-size:1.08333em}.leaflet-control-layers-separator{height:0;border-top:1px solid #ddd;margin:5px -10px 5px -6px}.leaflet-default-icon-path{background-image:url(images/marker-icon.png)}.leaflet-container .leaflet-control-attribution{background:#fff;background:rgba(255, 255, 255, 0.8);margin:0}.leaflet-control-attribution,.leaflet-control-scale-line{padding:0 5px;color:#333;line-height:1.4}.leaflet-control-attribution a{text-decoration:none}.leaflet-control-attribution a:hover,.leaflet-control-attribution a:focus{text-decoration:underline}.leaflet-control-attribution svg{display:inline !important}.leaflet-left .leaflet-control-scale{margin-left:5px}.leaflet-bottom .leaflet-control-scale{margin-bottom:5px}.leaflet-control-scale-line{border:2px solid #777;border-top:none;line-height:1.1;padding:2px 5px 1px;white-space:nowrap;overflow:hidden;-moz-box-sizing:border-box;box-sizing:border-box;background:#fff;background:rgba(255, 255, 255, 0.5)}.leaflet-control-scale-line:not(:first-child){border-top:2px solid #777;border-bottom:none;margin-top:-2px}.leaflet-control-scale-line:not(:first-child):not(:last-child){border-bottom:2px solid #777}.leaflet-touch .leaflet-control-attribution,.leaflet-touch .leaflet-control-layers,.leaflet-touch .leaflet-bar{box-shadow:none}.leaflet-touch .leaflet-control-layers,.leaflet-touch .leaflet-bar{border:2px solid rgba(0,0,0,0.2);background-clip:padding-box}.leaflet-popup{position:absolute;text-align:center;margin-bottom:20px}.leaflet-popup-content-wrapper{padding:1px;text-align:left;border-radius:12px}.leaflet-popup-content{margin:13px 24px 13px 20px;line-height:1.3;font-size:13px;font-size:1.08333em;min-height:1px}.leaflet-popup-content p{margin:17px 0;margin:1.3em 0}.leaflet-popup-tip-container{width:40px;height:20px;position:absolute;left:50%;margin-top:-1px;margin-left:-20px;overflow:hidden;pointer-events:none}.leaflet-popup-tip{width:17px;height:17px;padding:1px;margin:-10px auto 0;pointer-events:auto;-webkit-transform:rotate(45deg);-moz-transform:rotate(45deg);-ms-transform:rotate(45deg);transform:rotate(45deg)}.leaflet-popup-content-wrapper,.leaflet-popup-tip{background:white;color:#333;box-shadow:0 3px 14px rgba(0,0,0,0.4)}.leaflet-container a.leaflet-popup-close-button{position:absolute;top:0;right:0;border:none;text-align:center;width:24px;height:24px;font:16px/24px Tahoma, Verdana, sans-serif;color:#757575;text-decoration:none;background:transparent}.leaflet-container a.leaflet-popup-close-button:hover,.leaflet-container a.leaflet-popup-close-button:focus{color:#585858}.leaflet-popup-scrolled{overflow:auto;border-bottom:1px solid #ddd;border-top:1px solid #ddd}.leaflet-oldie .leaflet-popup-content-wrapper{-ms-zoom:1}.leaflet-oldie .leaflet-popup-tip{width:24px;margin:0 auto;-ms-filter:\"progid:DXImageTransform.Microsoft.Matrix(M11=0.70710678, M12=0.70710678, M21=-0.70710678, M22=0.70710678)\";filter:progid:DXImageTransform.Microsoft.Matrix(M11=0.70710678, M12=0.70710678, M21=-0.70710678, M22=0.70710678)}.leaflet-oldie .leaflet-control-zoom,.leaflet-oldie .leaflet-control-layers,.leaflet-oldie .leaflet-popup-content-wrapper,.leaflet-oldie .leaflet-popup-tip{border:1px solid #999}.leaflet-div-icon{background:#fff;border:1px solid #666}.leaflet-tooltip{position:absolute;padding:6px;background-color:#fff;border:1px solid #fff;border-radius:3px;color:#222;white-space:nowrap;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;pointer-events:none;box-shadow:0 1px 3px rgba(0,0,0,0.4)}.leaflet-tooltip.leaflet-interactive{cursor:pointer;pointer-events:auto}.leaflet-tooltip-top:before,.leaflet-tooltip-bottom:before,.leaflet-tooltip-left:before,.leaflet-tooltip-right:before{position:absolute;pointer-events:none;border:6px solid transparent;background:transparent;content:\"\"}.leaflet-tooltip-bottom{margin-top:6px}.leaflet-tooltip-top{margin-top:-6px}.leaflet-tooltip-bottom:before,.leaflet-tooltip-top:before{left:50%;margin-left:-6px}.leaflet-tooltip-top:before{bottom:0;margin-bottom:-12px;border-top-color:#fff}.leaflet-tooltip-bottom:before{top:0;margin-top:-12px;margin-left:-6px;border-bottom-color:#fff}.leaflet-tooltip-left{margin-left:-6px}.leaflet-tooltip-right{margin-left:6px}.leaflet-tooltip-left:before,.leaflet-tooltip-right:before{top:50%;margin-top:-6px}.leaflet-tooltip-left:before{right:0;margin-right:-12px;border-left-color:#fff}.leaflet-tooltip-right:before{left:0;margin-left:-12px;border-right-color:#fff}@media print{.leaflet-control{-webkit-print-color-adjust:exact;color-adjust:exact}}grw-map{display:block;height:100%}.departure-icon svg,.arrival-icon svg{width:48px;height:48px}.departure-icon svg path,.arrival-icon svg path{fill:currentColor;stroke:currentColor}.departure-icon{color:var(--color-departure-icon)}.arrival-icon{color:var(--color-arrival-icon)}.trek-marker{background-color:var(--color-primary);border-radius:50%}";
|
|
14145
|
+
const grwMapCss = ".leaflet-pane,.leaflet-tile,.leaflet-marker-icon,.leaflet-marker-shadow,.leaflet-tile-container,.leaflet-pane>svg,.leaflet-pane>canvas,.leaflet-zoom-box,.leaflet-image-layer,.leaflet-layer{position:absolute;left:0;top:0}.leaflet-container{overflow:hidden}.leaflet-tile,.leaflet-marker-icon,.leaflet-marker-shadow{-webkit-user-select:none;-moz-user-select:none;user-select:none;-webkit-user-drag:none}.leaflet-tile::selection{background:transparent}.leaflet-safari .leaflet-tile{image-rendering:-webkit-optimize-contrast}.leaflet-safari .leaflet-tile-container{width:1600px;height:1600px;-webkit-transform-origin:0 0}.leaflet-marker-icon,.leaflet-marker-shadow{display:block}.leaflet-container .leaflet-overlay-pane svg{max-width:none !important;max-height:none !important}.leaflet-container .leaflet-marker-pane img,.leaflet-container .leaflet-shadow-pane img,.leaflet-container .leaflet-tile-pane img,.leaflet-container img.leaflet-image-layer,.leaflet-container .leaflet-tile{max-width:none !important;max-height:none !important;width:auto;padding:0}.leaflet-container.leaflet-touch-zoom{-ms-touch-action:pan-x pan-y;touch-action:pan-x pan-y}.leaflet-container.leaflet-touch-drag{-ms-touch-action:pinch-zoom;touch-action:none;touch-action:pinch-zoom}.leaflet-container.leaflet-touch-drag.leaflet-touch-zoom{-ms-touch-action:none;touch-action:none}.leaflet-container{-webkit-tap-highlight-color:transparent}.leaflet-container a{-webkit-tap-highlight-color:rgba(51, 181, 229, 0.4)}.leaflet-tile{filter:inherit;visibility:hidden}.leaflet-tile-loaded{visibility:inherit}.leaflet-zoom-box{width:0;height:0;-moz-box-sizing:border-box;box-sizing:border-box;z-index:800}.leaflet-overlay-pane svg{-moz-user-select:none}.leaflet-pane{z-index:400}.leaflet-tile-pane{z-index:200}.leaflet-overlay-pane{z-index:400}.leaflet-shadow-pane{z-index:500}.leaflet-marker-pane{z-index:600}.leaflet-tooltip-pane{z-index:650}.leaflet-popup-pane{z-index:700}.leaflet-map-pane canvas{z-index:100}.leaflet-map-pane svg{z-index:200}.leaflet-vml-shape{width:1px;height:1px}.lvml{behavior:url(#default#VML);display:inline-block;position:absolute}.leaflet-control{position:relative;z-index:800;pointer-events:visiblePainted;pointer-events:auto}.leaflet-top,.leaflet-bottom{position:absolute;z-index:1000;pointer-events:none}.leaflet-top{top:0}.leaflet-right{right:0}.leaflet-bottom{bottom:0}.leaflet-left{left:0}.leaflet-control{float:left;clear:both}.leaflet-right .leaflet-control{float:right}.leaflet-top .leaflet-control{margin-top:10px}.leaflet-bottom .leaflet-control{margin-bottom:10px}.leaflet-left .leaflet-control{margin-left:10px}.leaflet-right .leaflet-control{margin-right:10px}.leaflet-fade-anim .leaflet-popup{opacity:0;-webkit-transition:opacity 0.2s linear;-moz-transition:opacity 0.2s linear;transition:opacity 0.2s linear}.leaflet-fade-anim .leaflet-map-pane .leaflet-popup{opacity:1}.leaflet-zoom-animated{-webkit-transform-origin:0 0;-ms-transform-origin:0 0;transform-origin:0 0}svg.leaflet-zoom-animated{will-change:transform}.leaflet-zoom-anim .leaflet-zoom-animated{-webkit-transition:-webkit-transform 0.25s cubic-bezier(0,0,0.25,1);-moz-transition:-moz-transform 0.25s cubic-bezier(0,0,0.25,1);transition:transform 0.25s cubic-bezier(0,0,0.25,1)}.leaflet-zoom-anim .leaflet-tile,.leaflet-pan-anim .leaflet-tile{-webkit-transition:none;-moz-transition:none;transition:none}.leaflet-zoom-anim .leaflet-zoom-hide{visibility:hidden}.leaflet-interactive{cursor:pointer}.leaflet-grab{cursor:-webkit-grab;cursor:-moz-grab;cursor:grab}.leaflet-crosshair,.leaflet-crosshair .leaflet-interactive{cursor:crosshair}.leaflet-popup-pane,.leaflet-control{cursor:auto}.leaflet-dragging .leaflet-grab,.leaflet-dragging .leaflet-grab .leaflet-interactive,.leaflet-dragging .leaflet-marker-draggable{cursor:move;cursor:-webkit-grabbing;cursor:-moz-grabbing;cursor:grabbing}.leaflet-marker-icon,.leaflet-marker-shadow,.leaflet-image-layer,.leaflet-pane>svg path,.leaflet-tile-container{pointer-events:none}.leaflet-marker-icon.leaflet-interactive,.leaflet-image-layer.leaflet-interactive,.leaflet-pane>svg path.leaflet-interactive,svg.leaflet-image-layer.leaflet-interactive path{pointer-events:visiblePainted;pointer-events:auto}.leaflet-container{background:#ddd;outline-offset:1px}.leaflet-container a{color:#0078A8}.leaflet-zoom-box{border:2px dotted #38f;background:rgba(255,255,255,0.5)}.leaflet-container{font-family:\"Helvetica Neue\", Arial, Helvetica, sans-serif;font-size:12px;font-size:0.75rem;line-height:1.5}.leaflet-bar{box-shadow:0 1px 5px rgba(0,0,0,0.65);border-radius:4px}.leaflet-bar a{background-color:#fff;border-bottom:1px solid #ccc;width:26px;height:26px;line-height:26px;display:block;text-align:center;text-decoration:none;color:black}.leaflet-bar a,.leaflet-control-layers-toggle{background-position:50% 50%;background-repeat:no-repeat;display:block}.leaflet-bar a:hover,.leaflet-bar a:focus{background-color:#f4f4f4}.leaflet-bar a:first-child{border-top-left-radius:4px;border-top-right-radius:4px}.leaflet-bar a:last-child{border-bottom-left-radius:4px;border-bottom-right-radius:4px;border-bottom:none}.leaflet-bar a.leaflet-disabled{cursor:default;background-color:#f4f4f4;color:#bbb}.leaflet-touch .leaflet-bar a{width:30px;height:30px;line-height:30px}.leaflet-touch .leaflet-bar a:first-child{border-top-left-radius:2px;border-top-right-radius:2px}.leaflet-touch .leaflet-bar a:last-child{border-bottom-left-radius:2px;border-bottom-right-radius:2px}.leaflet-control-zoom-in,.leaflet-control-zoom-out{font:bold 18px 'Lucida Console', Monaco, monospace;text-indent:1px}.leaflet-touch .leaflet-control-zoom-in,.leaflet-touch .leaflet-control-zoom-out{font-size:22px}.leaflet-control-layers{box-shadow:0 1px 5px rgba(0,0,0,0.4);background:#fff;border-radius:5px}.leaflet-control-layers-toggle{background-image:url(images/layers.png);width:36px;height:36px}.leaflet-retina .leaflet-control-layers-toggle{background-image:url(images/layers-2x.png);background-size:26px 26px}.leaflet-touch .leaflet-control-layers-toggle{width:44px;height:44px}.leaflet-control-layers .leaflet-control-layers-list,.leaflet-control-layers-expanded .leaflet-control-layers-toggle{display:none}.leaflet-control-layers-expanded .leaflet-control-layers-list{display:block;position:relative}.leaflet-control-layers-expanded{padding:6px 10px 6px 6px;color:#333;background:#fff}.leaflet-control-layers-scrollbar{overflow-y:scroll;overflow-x:hidden;padding-right:5px}.leaflet-control-layers-selector{margin-top:2px;position:relative;top:1px}.leaflet-control-layers label{display:block;font-size:13px;font-size:1.08333em}.leaflet-control-layers-separator{height:0;border-top:1px solid #ddd;margin:5px -10px 5px -6px}.leaflet-default-icon-path{background-image:url(images/marker-icon.png)}.leaflet-container .leaflet-control-attribution{background:#fff;background:rgba(255, 255, 255, 0.8);margin:0}.leaflet-control-attribution,.leaflet-control-scale-line{padding:0 5px;color:#333;line-height:1.4}.leaflet-control-attribution a{text-decoration:none}.leaflet-control-attribution a:hover,.leaflet-control-attribution a:focus{text-decoration:underline}.leaflet-control-attribution svg{display:inline !important}.leaflet-left .leaflet-control-scale{margin-left:5px}.leaflet-bottom .leaflet-control-scale{margin-bottom:5px}.leaflet-control-scale-line{border:2px solid #777;border-top:none;line-height:1.1;padding:2px 5px 1px;white-space:nowrap;overflow:hidden;-moz-box-sizing:border-box;box-sizing:border-box;background:#fff;background:rgba(255, 255, 255, 0.5)}.leaflet-control-scale-line:not(:first-child){border-top:2px solid #777;border-bottom:none;margin-top:-2px}.leaflet-control-scale-line:not(:first-child):not(:last-child){border-bottom:2px solid #777}.leaflet-touch .leaflet-control-attribution,.leaflet-touch .leaflet-control-layers,.leaflet-touch .leaflet-bar{box-shadow:none}.leaflet-touch .leaflet-control-layers,.leaflet-touch .leaflet-bar{border:2px solid rgba(0,0,0,0.2);background-clip:padding-box}.leaflet-popup{position:absolute;text-align:center;margin-bottom:20px}.leaflet-popup-content-wrapper{padding:1px;text-align:left;border-radius:12px}.leaflet-popup-content{margin:13px 24px 13px 20px;line-height:1.3;font-size:13px;font-size:1.08333em;min-height:1px}.leaflet-popup-content p{margin:17px 0;margin:1.3em 0}.leaflet-popup-tip-container{width:40px;height:20px;position:absolute;left:50%;margin-top:-1px;margin-left:-20px;overflow:hidden;pointer-events:none}.leaflet-popup-tip{width:17px;height:17px;padding:1px;margin:-10px auto 0;pointer-events:auto;-webkit-transform:rotate(45deg);-moz-transform:rotate(45deg);-ms-transform:rotate(45deg);transform:rotate(45deg)}.leaflet-popup-content-wrapper,.leaflet-popup-tip{background:white;color:#333;box-shadow:0 3px 14px rgba(0,0,0,0.4)}.leaflet-container a.leaflet-popup-close-button{position:absolute;top:0;right:0;border:none;text-align:center;width:24px;height:24px;font:16px/24px Tahoma, Verdana, sans-serif;color:#757575;text-decoration:none;background:transparent}.leaflet-container a.leaflet-popup-close-button:hover,.leaflet-container a.leaflet-popup-close-button:focus{color:#585858}.leaflet-popup-scrolled{overflow:auto;border-bottom:1px solid #ddd;border-top:1px solid #ddd}.leaflet-oldie .leaflet-popup-content-wrapper{-ms-zoom:1}.leaflet-oldie .leaflet-popup-tip{width:24px;margin:0 auto;-ms-filter:\"progid:DXImageTransform.Microsoft.Matrix(M11=0.70710678, M12=0.70710678, M21=-0.70710678, M22=0.70710678)\";filter:progid:DXImageTransform.Microsoft.Matrix(M11=0.70710678, M12=0.70710678, M21=-0.70710678, M22=0.70710678)}.leaflet-oldie .leaflet-control-zoom,.leaflet-oldie .leaflet-control-layers,.leaflet-oldie .leaflet-popup-content-wrapper,.leaflet-oldie .leaflet-popup-tip{border:1px solid #999}.leaflet-div-icon{background:#fff;border:1px solid #666}.leaflet-tooltip{position:absolute;padding:6px;background-color:#fff;border:1px solid #fff;border-radius:3px;color:#222;white-space:nowrap;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;pointer-events:none;box-shadow:0 1px 3px rgba(0,0,0,0.4)}.leaflet-tooltip.leaflet-interactive{cursor:pointer;pointer-events:auto}.leaflet-tooltip-top:before,.leaflet-tooltip-bottom:before,.leaflet-tooltip-left:before,.leaflet-tooltip-right:before{position:absolute;pointer-events:none;border:6px solid transparent;background:transparent;content:\"\"}.leaflet-tooltip-bottom{margin-top:6px}.leaflet-tooltip-top{margin-top:-6px}.leaflet-tooltip-bottom:before,.leaflet-tooltip-top:before{left:50%;margin-left:-6px}.leaflet-tooltip-top:before{bottom:0;margin-bottom:-12px;border-top-color:#fff}.leaflet-tooltip-bottom:before{top:0;margin-top:-12px;margin-left:-6px;border-bottom-color:#fff}.leaflet-tooltip-left{margin-left:-6px}.leaflet-tooltip-right{margin-left:6px}.leaflet-tooltip-left:before,.leaflet-tooltip-right:before{top:50%;margin-top:-6px}.leaflet-tooltip-left:before{right:0;margin-right:-12px;border-left-color:#fff}.leaflet-tooltip-right:before{left:0;margin-left:-12px;border-right-color:#fff}@media print{.leaflet-control{-webkit-print-color-adjust:exact;color-adjust:exact}}grw-map{display:block;height:100%;max-height:100vh}.departure-icon svg,.arrival-icon svg{width:48px;height:48px}.departure-icon svg path,.arrival-icon svg path{fill:currentColor;stroke:currentColor}.departure-icon{color:var(--color-departure-icon)}.arrival-icon{color:var(--color-arrival-icon)}.trek-marker{background-color:var(--color-primary);border-radius:50%;display:flex;justify-content:center;align-items:center}.trek-marker img{width:36px !important}.map-loader-container{position:absolute;z-index:500;width:100%;height:100%;background:rgba(255, 255, 255, 0.5);display:flex;justify-content:center;align-items:center}.map-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)}}";
|
|
14146
14146
|
|
|
14147
14147
|
const GrwMap = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
14148
14148
|
constructor() {
|
|
14149
14149
|
super();
|
|
14150
14150
|
this.__registerHost();
|
|
14151
|
+
this.mapIsReady = false;
|
|
14152
|
+
this.center = '1, 1';
|
|
14153
|
+
this.zoom = 10;
|
|
14151
14154
|
this.colorTrekLine = '#6b0030';
|
|
14152
14155
|
this.colorDepartureIcon = '#006b3b';
|
|
14153
14156
|
this.colorArrivalIcon = '#85003b';
|
|
14157
|
+
this.colorPrimary = '#6b0030';
|
|
14158
|
+
this.colorPrimaryTint = '#d2b2c0';
|
|
14154
14159
|
}
|
|
14155
14160
|
componentDidLoad() {
|
|
14156
14161
|
this.map = leafletSrc.map(this.element, {
|
|
14157
|
-
center:
|
|
14158
|
-
zoom:
|
|
14162
|
+
center: this.center.split(',').map(Number),
|
|
14163
|
+
zoom: this.zoom,
|
|
14159
14164
|
});
|
|
14160
|
-
leafletSrc.tileLayer(
|
|
14165
|
+
leafletSrc.tileLayer(this.urlLayer, {
|
|
14161
14166
|
maxZoom: 19,
|
|
14162
|
-
attribution:
|
|
14167
|
+
attribution: this.attribution,
|
|
14163
14168
|
}).addTo(this.map);
|
|
14164
14169
|
if (state.currentTrek) {
|
|
14165
14170
|
this.addTrek();
|
|
14166
14171
|
}
|
|
14167
|
-
else {
|
|
14172
|
+
else if (state.currentTrek) {
|
|
14168
14173
|
this.addTreks();
|
|
14169
14174
|
}
|
|
14175
|
+
onChange('treks', () => {
|
|
14176
|
+
if (state.currentTrek) {
|
|
14177
|
+
this.addTrek();
|
|
14178
|
+
}
|
|
14179
|
+
else if (state.treks) {
|
|
14180
|
+
this.addTreks();
|
|
14181
|
+
}
|
|
14182
|
+
});
|
|
14170
14183
|
onChange('currentTrek', () => {
|
|
14171
14184
|
if (state.currentTrek) {
|
|
14172
14185
|
this.removeTreks();
|
|
@@ -14179,6 +14192,7 @@ const GrwMap = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
14179
14192
|
});
|
|
14180
14193
|
}
|
|
14181
14194
|
addTreks() {
|
|
14195
|
+
var _a;
|
|
14182
14196
|
const treksDepartureCoordinates = [];
|
|
14183
14197
|
const treksFeatureCollection = {
|
|
14184
14198
|
type: 'FeatureCollection',
|
|
@@ -14188,28 +14202,32 @@ const GrwMap = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
14188
14202
|
treksDepartureCoordinates.push(trek.departure_geom);
|
|
14189
14203
|
treksFeatureCollection.features.push({
|
|
14190
14204
|
type: 'Feature',
|
|
14191
|
-
properties: {},
|
|
14205
|
+
properties: { practice: (_a = state.practices.find(practice => practice.id === trek.practice)) === null || _a === void 0 ? void 0 : _a.pictogram },
|
|
14192
14206
|
geometry: { type: 'Point', coordinates: trek.departure_geom },
|
|
14193
14207
|
});
|
|
14194
14208
|
}
|
|
14195
14209
|
if (treksDepartureCoordinates.length > 0) {
|
|
14196
14210
|
const bounds = leafletSrc.latLngBounds(treksDepartureCoordinates.map(coordinate => [coordinate[1], coordinate[0]]));
|
|
14197
|
-
this.
|
|
14211
|
+
this.currentBounds = bounds;
|
|
14212
|
+
this.map.fitBounds(this.currentBounds);
|
|
14198
14213
|
}
|
|
14199
14214
|
this.treksLayer = leafletSrc.geoJSON(treksFeatureCollection, {
|
|
14200
|
-
pointToLayer: (
|
|
14215
|
+
pointToLayer: (geoJsonPoint, latlng) => leafletSrc.marker(latlng, {
|
|
14201
14216
|
icon: leafletSrc.divIcon({
|
|
14202
14217
|
className: 'trek-marker',
|
|
14203
14218
|
iconSize: 48,
|
|
14204
|
-
|
|
14219
|
+
html: geoJsonPoint.properties.practice ? `<img src=${geoJsonPoint.properties.practice} />` : '',
|
|
14205
14220
|
}),
|
|
14206
14221
|
autoPanOnFocus: false,
|
|
14207
14222
|
}),
|
|
14208
14223
|
}).addTo(this.map);
|
|
14224
|
+
!this.mapIsReady && (this.mapIsReady = !this.mapIsReady);
|
|
14209
14225
|
}
|
|
14210
14226
|
removeTreks() {
|
|
14211
|
-
|
|
14212
|
-
|
|
14227
|
+
if (this.treksLayer) {
|
|
14228
|
+
this.map.removeLayer(this.treksLayer);
|
|
14229
|
+
this.treksLayer = null;
|
|
14230
|
+
}
|
|
14213
14231
|
}
|
|
14214
14232
|
addTrek() {
|
|
14215
14233
|
const trekFeature = {
|
|
@@ -14223,7 +14241,8 @@ const GrwMap = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
14223
14241
|
}),
|
|
14224
14242
|
}).addTo(this.map);
|
|
14225
14243
|
const bounds = leafletSrc.latLngBounds(state.currentTrek.geometry.coordinates.map(coordinate => [coordinate[1], coordinate[0]]));
|
|
14226
|
-
this.
|
|
14244
|
+
this.currentBounds = bounds;
|
|
14245
|
+
this.map.fitBounds(this.currentBounds);
|
|
14227
14246
|
const departureCoordinates = [state.currentTrek.geometry.coordinates.at(0)[0], state.currentTrek.geometry.coordinates.at(0)[1]];
|
|
14228
14247
|
const arrivalCoordinates = [state.currentTrek.geometry.coordinates.at(-1)[0], state.currentTrek.geometry.coordinates.at(-1)[1]];
|
|
14229
14248
|
const departureArrivalFeatureCollection = {
|
|
@@ -14254,22 +14273,39 @@ const GrwMap = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
14254
14273
|
autoPanOnFocus: false,
|
|
14255
14274
|
}),
|
|
14256
14275
|
}).addTo(this.map);
|
|
14276
|
+
!this.mapIsReady && (this.mapIsReady = !this.mapIsReady);
|
|
14257
14277
|
}
|
|
14258
14278
|
removeTrek() {
|
|
14259
|
-
|
|
14260
|
-
|
|
14261
|
-
|
|
14262
|
-
|
|
14279
|
+
if (this.trekLayer) {
|
|
14280
|
+
this.map.removeLayer(this.trekLayer);
|
|
14281
|
+
this.trekLayer = null;
|
|
14282
|
+
}
|
|
14283
|
+
if (this.departureArrivalLayer) {
|
|
14284
|
+
this.map.removeLayer(this.departureArrivalLayer);
|
|
14285
|
+
this.departureArrivalLayer = null;
|
|
14286
|
+
}
|
|
14263
14287
|
}
|
|
14264
14288
|
render() {
|
|
14265
|
-
return h(Host, { style: {
|
|
14289
|
+
return (h(Host, { style: {
|
|
14290
|
+
'--color-primary': this.colorPrimary,
|
|
14291
|
+
'--color-primary-tint': this.colorPrimaryTint,
|
|
14292
|
+
'--color-departure-icon': this.colorDepartureIcon,
|
|
14293
|
+
'--color-arrival-icon': this.colorArrivalIcon,
|
|
14294
|
+
} }, !this.mapIsReady && (h("div", { class: "map-loader-container" }, h("span", { class: "loader" })))));
|
|
14266
14295
|
}
|
|
14267
14296
|
get element() { return this; }
|
|
14268
14297
|
static get style() { return grwMapCss; }
|
|
14269
14298
|
}, [0, "grw-map", {
|
|
14299
|
+
"urlLayer": [1, "url-layer"],
|
|
14300
|
+
"attribution": [1],
|
|
14301
|
+
"center": [1],
|
|
14302
|
+
"zoom": [2],
|
|
14270
14303
|
"colorTrekLine": [1, "color-trek-line"],
|
|
14271
14304
|
"colorDepartureIcon": [1, "color-departure-icon"],
|
|
14272
|
-
"colorArrivalIcon": [1, "color-arrival-icon"]
|
|
14305
|
+
"colorArrivalIcon": [1, "color-arrival-icon"],
|
|
14306
|
+
"colorPrimary": [1, "color-primary"],
|
|
14307
|
+
"colorPrimaryTint": [1, "color-primary-tint"],
|
|
14308
|
+
"mapIsReady": [32]
|
|
14273
14309
|
}]);
|
|
14274
14310
|
function defineCustomElement() {
|
|
14275
14311
|
if (typeof customElements === "undefined") {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
|
|
2
|
-
import { s as state } from './store.js';
|
|
2
|
+
import { s as state, o as onChange } from './store.js';
|
|
3
3
|
import { d as durationImage, f as formatDuration, l as lengthImage, a as formatLength, b as ascentImage, c as formatAscent } from './length.js';
|
|
4
4
|
|
|
5
5
|
const grwTrekCardCss = ".trek-card-container{width:350px;height:auto;border-radius:8px;box-shadow:4px 8px 24px rgba(0, 0, 0, 0.25);cursor:pointer}.trek-card-container .image{width:100%;height:auto}.trek-card-container .sub-container{padding:12px}.trek-card-container .sub-container .name{color:var(--color-primary);font-size:24px;font-weight:bold;margin-bottom:12px}.trek-card-container .sub-container .description{max-height:24px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin-bottom:12px}.trek-card-container .sub-container .description p{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin:0}.trek-card-container .sub-container .icons-labels-container{display:flex;justify-content:flex-start;align-items:center;flex-wrap:wrap}.trek-card-container .sub-container .icons-labels-container .row{display:flex;justify-content:space-between;align-items:center;width:100%}.trek-card-container .sub-container .icons-labels-container .row:not(:last-child){margin-bottom:12px}.trek-card-container .sub-container .icons-labels-container .row .icon-label{display:flex;justify-content:center;align-items:center;width:33.3333333333%}.trek-card-container .sub-container .icons-labels-container .row .icon-label:nth-child(2){margin:0px 4px}.trek-card-container .sub-container .icons-labels-container .row .icon-label img,.trek-card-container .sub-container .icons-labels-container .row .icon-label .svg-icon svg{width:24px;height:auto;margin-right:24px}.trek-card-container .sub-container .icons-labels-container .row .practice img{background-color:var(--color-primary)}";
|
|
@@ -10,23 +10,41 @@ const GrwTrekCard = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
|
10
10
|
this.__registerHost();
|
|
11
11
|
this.__attachShadow();
|
|
12
12
|
this.trekCardPress = createEvent(this, "trekCardPress", 7);
|
|
13
|
+
this.colorPrimary = '#6b0030';
|
|
14
|
+
this.colorPrimaryTint = '#d2b2c0';
|
|
13
15
|
}
|
|
14
16
|
componentWillLoad() {
|
|
15
17
|
this.currentTrek = this.trek ? this.trek : state.currentTrek;
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
18
|
+
if (this.currentTrek) {
|
|
19
|
+
this.difficulty = state.difficulties.find(difficulty => difficulty.id === this.currentTrek.difficulty);
|
|
20
|
+
this.route = state.routes.find(route => route.id === this.currentTrek.route);
|
|
21
|
+
this.practice = state.practices.find(practice => practice.id === this.currentTrek.practice);
|
|
22
|
+
}
|
|
23
|
+
onChange('currentTrek', () => {
|
|
24
|
+
this.currentTrek = this.trek ? this.trek : state.currentTrek;
|
|
25
|
+
if (this.currentTrek) {
|
|
26
|
+
this.difficulty = state.difficulties.find(difficulty => difficulty.id === this.currentTrek.difficulty);
|
|
27
|
+
this.route = state.routes.find(route => route.id === this.currentTrek.route);
|
|
28
|
+
this.practice = state.practices.find(practice => practice.id === this.currentTrek.practice);
|
|
29
|
+
}
|
|
30
|
+
});
|
|
19
31
|
}
|
|
20
32
|
render() {
|
|
21
33
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
22
|
-
return (h(Host, { onClick: () => this.trekCardPress.emit(this.currentTrek.id) }, h("div", { class: "trek-card-container" }, this.currentTrek.attachments[0] && h("img", { class: "image", src: this.currentTrek.attachments[0].url
|
|
34
|
+
return (h(Host, { onClick: () => this.trekCardPress.emit(this.currentTrek.id), style: { '--color-primary': this.colorPrimary, '--color-primary-tint': this.colorPrimaryTint } }, this.currentTrek && (h("div", { class: "trek-card-container" }, this.currentTrek.attachments && this.currentTrek.attachments[0] && this.currentTrek.attachments[0].url && (h("img", { class: "image", src: `${this.currentTrek.attachments[0].url}.400x0_q85.${this.currentTrek.attachments[0].url.slice(-3).toLowerCase()}`, loading: "lazy" })), h("div", { class: "sub-container" }, h("div", { class: "name" }, (_a = this.currentTrek) === null || _a === void 0 ? void 0 : _a.name), h("div", { class: "description", innerHTML: (_b = this.currentTrek) === null || _b === void 0 ? void 0 : _b.description_teaser }), h("div", { class: "icons-labels-container" }, h("div", { class: "row" }, h("div", { class: "icon-label difficulty" }, ((_c = this.difficulty) === null || _c === void 0 ? void 0 : _c.pictogram) && h("img", { src: this.difficulty.pictogram }), (_d = this.difficulty) === null || _d === void 0 ? void 0 :
|
|
23
35
|
_d.label), h("div", { class: "icon-label duration" }, h("div", { class: "svg-icon", innerHTML: durationImage }), formatDuration(this.currentTrek.duration)), h("div", { class: "icon-label route" }, ((_e = this.route) === null || _e === void 0 ? void 0 : _e.pictogram) && h("img", { src: this.route.pictogram }), (_f = this.route) === null || _f === void 0 ? void 0 :
|
|
24
36
|
_f.route)), h("div", { class: "row" }, h("div", { class: "icon-label length" }, h("div", { class: "svg-icon", innerHTML: lengthImage }), formatLength(this.currentTrek.length_2d)), h("div", { class: "icon-label ascent" }, h("div", { class: "svg-icon", innerHTML: ascentImage }), formatAscent(this.currentTrek.ascent)), h("div", { class: "icon-label practice" }, ((_g = this.practice) === null || _g === void 0 ? void 0 : _g.pictogram) && h("img", { src: this.practice.pictogram }), (_h = this.practice) === null || _h === void 0 ? void 0 :
|
|
25
|
-
_h.name)))))));
|
|
37
|
+
_h.name))))))));
|
|
26
38
|
}
|
|
27
39
|
static get style() { return grwTrekCardCss; }
|
|
28
40
|
}, [1, "grw-trek-card", {
|
|
29
|
-
"trek": [16]
|
|
41
|
+
"trek": [16],
|
|
42
|
+
"colorPrimary": [1, "color-primary"],
|
|
43
|
+
"colorPrimaryTint": [1, "color-primary-tint"],
|
|
44
|
+
"currentTrek": [32],
|
|
45
|
+
"difficulty": [32],
|
|
46
|
+
"route": [32],
|
|
47
|
+
"practice": [32]
|
|
30
48
|
}]);
|
|
31
49
|
function defineCustomElement() {
|
|
32
50
|
if (typeof customElements === "undefined") {
|
|
@@ -1,31 +1,49 @@
|
|
|
1
1
|
import { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal/client';
|
|
2
|
-
import { s as state } from './store.js';
|
|
2
|
+
import { s as state, o as onChange } from './store.js';
|
|
3
3
|
import { d as durationImage, f as formatDuration, l as lengthImage, a as formatLength, b as ascentImage, c as formatAscent } from './length.js';
|
|
4
4
|
|
|
5
|
-
const grwTrekDetailCss = ".trek-detail-container{display:flex;flex-direction:column;
|
|
5
|
+
const grwTrekDetailCss = ".trek-detail-container{display:flex;flex-direction:column;height:100%;overflow-y:auto}.trek-detail-container .name{color:var(--color-primary);font-size:48px;font-weight:bold;padding:24px}.trek-detail-container .image{align-self:center;width:100%;max-width:700px;height:auto;box-shadow:4px 8px 24px rgba(0, 0, 0, 0.25)}.trek-detail-container .sub-container{padding:24px}.trek-detail-container .sub-container .icons-labels-container{display:flex;justify-content:flex-start;align-items:center;flex-wrap:wrap}.trek-detail-container .sub-container .icons-labels-container .row{display:flex;justify-content:space-between;align-items:center;width:100%}.trek-detail-container .sub-container .icons-labels-container .row:not(:last-child){margin-bottom:24px}.trek-detail-container .sub-container .icons-labels-container .row .icon-label{display:flex;justify-content:center;align-items:center;width:33.3333333333%}.trek-detail-container .sub-container .icons-labels-container .row .icon-label:nth-child(2){margin:0px 8px}.trek-detail-container .sub-container .icons-labels-container .row .icon-label img,.trek-detail-container .sub-container .icons-labels-container .row .icon-label .svg-icon svg{width:24px;height:auto;margin-right:24px}.trek-detail-container .sub-container .icons-labels-container .row .practice img{background-color:var(--color-primary)}.trek-detail-container .description{padding:0px 24px 24px 24px}";
|
|
6
6
|
|
|
7
7
|
const GrwTrekDetail = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
8
8
|
constructor() {
|
|
9
9
|
super();
|
|
10
10
|
this.__registerHost();
|
|
11
11
|
this.__attachShadow();
|
|
12
|
+
this.colorPrimary = '#6b0030';
|
|
13
|
+
this.colorPrimaryTint = '#d2b2c0';
|
|
12
14
|
}
|
|
13
15
|
componentWillLoad() {
|
|
14
16
|
this.currentTrek = this.trek ? this.trek : state.currentTrek;
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
17
|
+
if (this.currentTrek) {
|
|
18
|
+
this.difficulty = state.difficulties.find(difficulty => difficulty.id === this.currentTrek.difficulty);
|
|
19
|
+
this.route = state.routes.find(route => route.id === this.currentTrek.route);
|
|
20
|
+
this.practice = state.practices.find(practice => practice.id === this.currentTrek.practice);
|
|
21
|
+
}
|
|
22
|
+
onChange('currentTrek', () => {
|
|
23
|
+
this.currentTrek = this.trek ? this.trek : state.currentTrek;
|
|
24
|
+
if (this.currentTrek) {
|
|
25
|
+
this.difficulty = state.difficulties.find(difficulty => difficulty.id === this.currentTrek.difficulty);
|
|
26
|
+
this.route = state.routes.find(route => route.id === this.currentTrek.route);
|
|
27
|
+
this.practice = state.practices.find(practice => practice.id === this.currentTrek.practice);
|
|
28
|
+
}
|
|
29
|
+
});
|
|
18
30
|
}
|
|
19
31
|
render() {
|
|
20
32
|
var _a, _b, _c, _d, _e, _f, _g;
|
|
21
|
-
return (h(Host,
|
|
33
|
+
return (h(Host, { style: { '--color-primary': this.colorPrimary, '--color-primary-tint': this.colorPrimaryTint } }, this.currentTrek && (h("div", { class: "trek-detail-container" }, h("div", { class: "name" }, this.currentTrek.name), this.currentTrek.attachments && this.currentTrek.attachments[0] && h("img", { class: "image", src: this.currentTrek.attachments[0].url, loading: "lazy" }), h("div", { class: "sub-container" }, h("div", { class: "icons-labels-container" }, h("div", { class: "row" }, h("div", { class: "icon-label difficulty" }, ((_a = this.difficulty) === null || _a === void 0 ? void 0 : _a.pictogram) && h("img", { src: this.difficulty.pictogram }), (_b = this.difficulty) === null || _b === void 0 ? void 0 :
|
|
22
34
|
_b.label), h("div", { class: "icon-label duration" }, h("div", { class: "svg-icon", innerHTML: durationImage }), formatDuration((_c = this.currentTrek) === null || _c === void 0 ? void 0 : _c.duration)), h("div", { class: "icon-label route" }, ((_d = this.route) === null || _d === void 0 ? void 0 : _d.pictogram) && h("img", { src: this.route.pictogram }), (_e = this.route) === null || _e === void 0 ? void 0 :
|
|
23
35
|
_e.route)), h("div", { class: "row" }, h("div", { class: "icon-label length" }, h("div", { class: "svg-icon", innerHTML: lengthImage }), formatLength(this.currentTrek.length_2d)), h("div", { class: "icon-label ascent" }, h("div", { class: "svg-icon", innerHTML: ascentImage }), formatAscent(this.currentTrek.ascent)), h("div", { class: "icon-label practice" }, ((_f = this.practice) === null || _f === void 0 ? void 0 : _f.pictogram) && h("img", { src: this.practice.pictogram }), (_g = this.practice) === null || _g === void 0 ? void 0 :
|
|
24
|
-
_g.name)))), h("div", { class: "description", innerHTML: this.currentTrek.description ? this.currentTrek.description : this.currentTrek.description_teaser }))));
|
|
36
|
+
_g.name)))), h("div", { class: "description", innerHTML: this.currentTrek.description ? this.currentTrek.description : this.currentTrek.description_teaser })))));
|
|
25
37
|
}
|
|
26
38
|
static get style() { return grwTrekDetailCss; }
|
|
27
39
|
}, [1, "grw-trek-detail", {
|
|
28
|
-
"trek": [16]
|
|
40
|
+
"trek": [16],
|
|
41
|
+
"colorPrimary": [1, "color-primary"],
|
|
42
|
+
"colorPrimaryTint": [1, "color-primary-tint"],
|
|
43
|
+
"currentTrek": [32],
|
|
44
|
+
"difficulty": [32],
|
|
45
|
+
"route": [32],
|
|
46
|
+
"practice": [32]
|
|
29
47
|
}]);
|
|
30
48
|
function defineCustomElement() {
|
|
31
49
|
if (typeof customElements === "undefined") {
|
|
@@ -5,21 +5,23 @@ const GrwTrekProvider = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
|
|
|
5
5
|
constructor() {
|
|
6
6
|
super();
|
|
7
7
|
this.__registerHost();
|
|
8
|
+
this.__attachShadow();
|
|
9
|
+
this.language = 'fr';
|
|
8
10
|
}
|
|
9
11
|
componentWillLoad() {
|
|
10
12
|
state.api = this.api;
|
|
11
13
|
return Promise.all([
|
|
12
|
-
fetch(`${this.api}
|
|
13
|
-
fetch(`${this.api}
|
|
14
|
-
fetch(`${this.api}
|
|
15
|
-
fetch(`${this.api}
|
|
14
|
+
fetch(`${this.api}trek_difficulty/?language=${this.language}`),
|
|
15
|
+
fetch(`${this.api}trek_route/?language=${this.language}`),
|
|
16
|
+
fetch(`${this.api}trek_practice/?language=${this.language}`),
|
|
17
|
+
fetch(`${this.api}trek/${this.trekId}/?language=${this.language}&fields=id,name,attachments,description,description_teaser,difficulty,duration,ascent,length_2d,practice,route,geometry`),
|
|
16
18
|
])
|
|
17
19
|
.then(responses => Promise.all(responses.map(response => response.json())))
|
|
18
|
-
.then(([
|
|
19
|
-
state.currentTrek = trek;
|
|
20
|
+
.then(([difficulties, routes, practices, trek]) => {
|
|
20
21
|
state.difficulties = difficulties.results;
|
|
21
22
|
state.routes = routes.results;
|
|
22
23
|
state.practices = practices.results;
|
|
24
|
+
state.currentTrek = trek;
|
|
23
25
|
});
|
|
24
26
|
}
|
|
25
27
|
disconnectedCallback() {
|
|
@@ -28,7 +30,8 @@ const GrwTrekProvider = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
|
|
|
28
30
|
render() {
|
|
29
31
|
return h(Host, null);
|
|
30
32
|
}
|
|
31
|
-
}, [
|
|
33
|
+
}, [1, "grw-trek-provider", {
|
|
34
|
+
"language": [1],
|
|
32
35
|
"api": [1],
|
|
33
36
|
"trekId": [1, "trek-id"]
|
|
34
37
|
}]);
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal/client';
|
|
2
|
-
import { s as state } from './store.js';
|
|
2
|
+
import { o as onChange, s as state } from './store.js';
|
|
3
3
|
import { d as defineCustomElement$1 } from './grw-trek-card2.js';
|
|
4
4
|
|
|
5
|
-
const grwTreksListCss = ":host{display:flex;flex-wrap:wrap;justify-content:
|
|
5
|
+
const grwTreksListCss = ":host{display:flex;flex-wrap:wrap;justify-content:space-around;height:100%;max-height:100vh;overflow-y:auto}grw-trek-card{margin:6px}";
|
|
6
6
|
|
|
7
7
|
const GrwTreksList = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
8
8
|
constructor() {
|
|
@@ -10,12 +10,16 @@ const GrwTreksList = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
|
10
10
|
this.__registerHost();
|
|
11
11
|
this.__attachShadow();
|
|
12
12
|
this.treksToDisplay = [];
|
|
13
|
+
this.colorPrimary = '#6b0030';
|
|
14
|
+
this.colorPrimaryTint = '#d2b2c0';
|
|
13
15
|
this.handleInfiniteScrollBind = this.handleInfiniteScroll.bind(this);
|
|
14
16
|
this.step = 10;
|
|
15
17
|
}
|
|
16
18
|
componentWillLoad() {
|
|
17
|
-
this.treksToDisplay = state.treks.slice(0, this.step);
|
|
18
19
|
this.element.addEventListener('scroll', this.handleInfiniteScrollBind);
|
|
20
|
+
onChange('treks', () => {
|
|
21
|
+
this.treksToDisplay = state.treks.slice(0, this.step);
|
|
22
|
+
});
|
|
19
23
|
}
|
|
20
24
|
handleInfiniteScroll(event) {
|
|
21
25
|
if (event.composedPath()[0].scrollTop + event.composedPath()[0].scrollHeight / 2 >= event.composedPath()[0].scrollHeight) {
|
|
@@ -28,11 +32,13 @@ const GrwTreksList = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
|
28
32
|
}
|
|
29
33
|
}
|
|
30
34
|
render() {
|
|
31
|
-
return (h(Host, {
|
|
35
|
+
return (h(Host, { style: { '--color-primary': this.colorPrimary, '--color-primary-tint': this.colorPrimaryTint } }, this.treksToDisplay.map(trek => (h("grw-trek-card", { trek: trek, "color-primary": this.colorPrimary, "color-primary-tint": this.colorPrimaryTint })))));
|
|
32
36
|
}
|
|
33
37
|
get element() { return this; }
|
|
34
38
|
static get style() { return grwTreksListCss; }
|
|
35
39
|
}, [1, "grw-treks-list", {
|
|
40
|
+
"colorPrimary": [1, "color-primary"],
|
|
41
|
+
"colorPrimaryTint": [1, "color-primary-tint"],
|
|
36
42
|
"treksToDisplay": [32]
|
|
37
43
|
}]);
|
|
38
44
|
function defineCustomElement() {
|
|
@@ -5,34 +5,49 @@ const GrwTreksProvider = /*@__PURE__*/ proxyCustomElement(class extends HTMLElem
|
|
|
5
5
|
constructor() {
|
|
6
6
|
super();
|
|
7
7
|
this.__registerHost();
|
|
8
|
+
this.__attachShadow();
|
|
9
|
+
this.language = 'fr';
|
|
8
10
|
}
|
|
9
11
|
componentWillLoad() {
|
|
10
12
|
state.api = this.api;
|
|
11
|
-
let treksRequest = `${this.api}trek/?language
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
}
|
|
13
|
+
let treksRequest = `${this.api}trek/?language=${this.language}`;
|
|
14
|
+
this.inBbox && (treksRequest += `&in_bbox=${this.inBbox}`);
|
|
15
|
+
this.cities && (treksRequest += `&cities=${this.cities}`);
|
|
16
|
+
this.districts && (treksRequest += `&districts=${this.districts}`);
|
|
17
|
+
this.structures && (treksRequest += `&structures=${this.structures}`);
|
|
18
|
+
this.themes && (treksRequest += `&themes=${this.themes}`);
|
|
19
|
+
this.portals && (treksRequest += `&portals=${this.portals}`);
|
|
20
|
+
this.routes && (treksRequest += `&routes=${this.routes}`);
|
|
21
|
+
this.practices && (treksRequest += `&practices=${this.practices}`);
|
|
15
22
|
treksRequest += `&fields=id,name,attachments,description_teaser,difficulty,duration,ascent,length_2d,practice,route,departure_geom&page_size=999`;
|
|
16
23
|
return Promise.all([
|
|
24
|
+
fetch(`${this.api}trek_difficulty/?language=${this.language}`),
|
|
25
|
+
fetch(`${this.api}trek_route/?language=${this.language}`),
|
|
26
|
+
fetch(`${this.api}trek_practice/?language=${this.language}`),
|
|
17
27
|
fetch(treksRequest),
|
|
18
|
-
fetch(`${this.api}trek_difficulty/?language=fr`),
|
|
19
|
-
fetch(`${this.api}trek_route/?language=fr`),
|
|
20
|
-
fetch(`${this.api}trek_practice/?language=fr`),
|
|
21
28
|
])
|
|
22
29
|
.then(responses => Promise.all(responses.map(response => response.json())))
|
|
23
|
-
.then(([
|
|
24
|
-
state.treks = treks.results;
|
|
30
|
+
.then(([difficulties, routes, practices, treks]) => {
|
|
25
31
|
state.difficulties = difficulties.results;
|
|
26
32
|
state.routes = routes.results;
|
|
27
33
|
state.practices = practices.results;
|
|
34
|
+
state.treks = treks.results;
|
|
28
35
|
});
|
|
29
36
|
}
|
|
30
37
|
render() {
|
|
31
38
|
return h(Host, null);
|
|
32
39
|
}
|
|
33
|
-
}, [
|
|
40
|
+
}, [1, "grw-treks-provider", {
|
|
41
|
+
"language": [1],
|
|
34
42
|
"api": [1],
|
|
35
|
-
"
|
|
43
|
+
"inBbox": [1, "in-bbox"],
|
|
44
|
+
"cities": [1],
|
|
45
|
+
"districts": [1],
|
|
46
|
+
"structures": [1],
|
|
47
|
+
"themes": [1],
|
|
48
|
+
"portals": [1],
|
|
49
|
+
"routes": [1],
|
|
50
|
+
"practices": [1]
|
|
36
51
|
}]);
|
|
37
52
|
function defineCustomElement() {
|
|
38
53
|
if (typeof customElements === "undefined") {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { p as promiseResolve, b as bootstrapLazy } from './index-
|
|
1
|
+
import { p as promiseResolve, b as bootstrapLazy } from './index-7aa9e822.js';
|
|
2
2
|
|
|
3
3
|
/*
|
|
4
4
|
Stencil Client Patch Browser v2.16.1 | MIT Licensed | https://stenciljs.com
|
|
@@ -13,5 +13,5 @@ const patchBrowser = () => {
|
|
|
13
13
|
};
|
|
14
14
|
|
|
15
15
|
patchBrowser().then(options => {
|
|
16
|
-
return bootstrapLazy([["grw-app_7",[[1,"grw-app",{"api":[1],"portals":[1],"appName":[1,"app-name"],"colorPrimary":[1,"color-primary"],"colorPrimaryTint":[1,"color-primary-tint"],"showTrek":[32],"showMap":[32],"currentTrekId":[32]},[[0,"trekCardPress","onTrekCardPress"],[9,"resize","onWindowResize"]]],[1,"grw-treks-list",{"treksToDisplay":[32]}],[0,"grw-map",{"colorTrekLine":[1,"color-trek-line"],"colorDepartureIcon":[1,"color-departure-icon"],"colorArrivalIcon":[1,"color-arrival-icon"]}],[1,"grw-trek-detail",{"trek":[16]}],[
|
|
16
|
+
return bootstrapLazy([["grw-app_7",[[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);
|
|
17
17
|
});
|