@geotrekce/geotrek-rando-widget 0.0.6 → 0.0.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/geotrek-rando-widget.cjs.js +2 -2
- package/dist/cjs/grw-app.cjs.entry.js +14 -5
- package/dist/cjs/grw-filter_6.cjs.entry.js +109 -63
- package/dist/cjs/grw-information-desk-detail_3.cjs.entry.js +2 -2
- package/dist/cjs/grw-trek-card.cjs.entry.js +3 -3
- package/dist/cjs/{index-c2c4531d.js → index-4c76daa3.js} +8 -3
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/{store-fd04a216.js → store-b4c3c507.js} +6 -4
- package/dist/collection/components/grw-app/grw-app.css +17 -11
- package/dist/collection/components/grw-app/grw-app.js +21 -9
- package/dist/collection/components/grw-filter/grw-filter.js +11 -12
- package/dist/collection/components/grw-map/grw-map.js +24 -15
- package/dist/collection/components/grw-trek-card/grw-trek-card.js +1 -1
- package/dist/collection/components/grw-trek-detail/grw-trek-detail.js +11 -3
- package/dist/collection/components/grw-treks-list/grw-treks-list.css +0 -12
- package/dist/collection/components/grw-treks-list/grw-treks-list.js +16 -9
- package/dist/collection/store/grw-trek-provider.js +28 -15
- package/dist/collection/store/grw-treks-provider.js +16 -8
- package/dist/collection/store/store.js +5 -3
- package/dist/components/grw-app.js +14 -5
- package/dist/components/grw-filter2.js +11 -12
- package/dist/components/grw-map2.js +24 -15
- package/dist/components/grw-trek-card2.js +1 -1
- package/dist/components/grw-trek-detail2.js +11 -3
- package/dist/components/grw-trek-provider2.js +28 -15
- package/dist/components/grw-treks-list2.js +18 -9
- package/dist/components/grw-treks-provider2.js +16 -8
- package/dist/components/store.js +5 -3
- package/dist/esm/geotrek-rando-widget.js +2 -2
- package/dist/esm/grw-app.entry.js +14 -5
- package/dist/esm/grw-filter_6.entry.js +109 -63
- package/dist/esm/grw-information-desk-detail_3.entry.js +2 -2
- package/dist/esm/grw-trek-card.entry.js +3 -3
- package/dist/esm/{index-192d910f.js → index-ee473772.js} +8 -3
- package/dist/esm/loader.js +2 -2
- package/dist/esm/{store-b2c76c0c.js → store-a5f523fd.js} +6 -4
- package/dist/geotrek-rando-widget/geotrek-rando-widget.esm.js +1 -1
- package/dist/geotrek-rando-widget/{p-7715153d.entry.js → p-0510e16b.entry.js} +1 -1
- package/dist/geotrek-rando-widget/p-22562f4d.js +1 -0
- package/dist/geotrek-rando-widget/p-28db12ba.entry.js +1 -0
- package/dist/geotrek-rando-widget/{p-1b2ba86d.entry.js → p-500436f1.entry.js} +1 -1
- package/dist/geotrek-rando-widget/p-94f0db4d.entry.js +1 -0
- package/dist/geotrek-rando-widget/p-b62909db.js +2 -0
- package/dist/types/components/grw-app/grw-app.d.ts +2 -2
- package/dist/types/components/grw-filter/grw-filter.d.ts +1 -1
- package/dist/types/components/grw-map/grw-map.d.ts +1 -1
- package/dist/types/components/grw-trek-card/grw-trek-card.d.ts +1 -1
- package/dist/types/components/grw-trek-detail/grw-trek-detail.d.ts +1 -1
- package/dist/types/components/grw-treks-list/grw-treks-list.d.ts +3 -2
- package/dist/types/components.d.ts +2 -2
- package/dist/types/store/grw-trek-provider.d.ts +4 -1
- package/dist/types/store/grw-treks-provider.d.ts +4 -1
- package/dist/types/store/store.d.ts +4 -0
- package/package.json +1 -1
- package/readme.md +4 -0
- package/dist/geotrek-rando-widget/p-5f17d340.entry.js +0 -1
- package/dist/geotrek-rando-widget/p-6716c635.entry.js +0 -1
- package/dist/geotrek-rando-widget/p-6dce5e6c.js +0 -2
- package/dist/geotrek-rando-widget/p-e6710c64.js +0 -1
|
@@ -18,7 +18,7 @@ export declare class GrwApp {
|
|
|
18
18
|
practices: string;
|
|
19
19
|
urlLayer: string;
|
|
20
20
|
center: string;
|
|
21
|
-
zoom:
|
|
21
|
+
zoom: number;
|
|
22
22
|
attribution: string;
|
|
23
23
|
colorPrimary: string;
|
|
24
24
|
colorPrimaryShade: string;
|
|
@@ -28,8 +28,8 @@ export declare class GrwApp {
|
|
|
28
28
|
colorArrivalIcon: string;
|
|
29
29
|
colorSensitiveArea: string;
|
|
30
30
|
colorPoiIcon: string;
|
|
31
|
-
handlePopStateBind: (event: any) => void;
|
|
32
31
|
largeViewSize: number;
|
|
32
|
+
handlePopStateBind: (event: any) => void;
|
|
33
33
|
onTrekCardPress(event: CustomEvent<number>): void;
|
|
34
34
|
onWindowResize(): void;
|
|
35
35
|
watchPropHandler(): void;
|
|
@@ -26,7 +26,7 @@ export declare class GrwMap {
|
|
|
26
26
|
currentInformationDesksLayer: L.GeoJSON<any>;
|
|
27
27
|
currentPointsReferenceLayer: L.GeoJSON<any>;
|
|
28
28
|
handleTreksWithinBoundsBind: (event: any) => void;
|
|
29
|
-
|
|
29
|
+
connectedCallback(): void;
|
|
30
30
|
addTreks(): void;
|
|
31
31
|
removeTreks(): void;
|
|
32
32
|
handleTreksWithinBounds(): void;
|
|
@@ -5,9 +5,10 @@ export declare class GrwTreksList {
|
|
|
5
5
|
colorPrimary: string;
|
|
6
6
|
colorPrimaryTint: string;
|
|
7
7
|
isLargeView: boolean;
|
|
8
|
-
handleInfiniteScrollBind: (event: any) => void;
|
|
9
8
|
step: number;
|
|
10
|
-
|
|
9
|
+
handleInfiniteScrollBind: (event: any) => void;
|
|
10
|
+
connectedCallback(): void;
|
|
11
11
|
handleInfiniteScroll(event: any): void;
|
|
12
|
+
disconnectedCallback(): void;
|
|
12
13
|
render(): any;
|
|
13
14
|
}
|
|
@@ -29,7 +29,7 @@ export namespace Components {
|
|
|
29
29
|
"structures": string;
|
|
30
30
|
"themes": string;
|
|
31
31
|
"urlLayer": string;
|
|
32
|
-
"zoom":
|
|
32
|
+
"zoom": number;
|
|
33
33
|
}
|
|
34
34
|
interface GrwFilter {
|
|
35
35
|
"filterName": string;
|
|
@@ -205,7 +205,7 @@ declare namespace LocalJSX {
|
|
|
205
205
|
"structures"?: string;
|
|
206
206
|
"themes"?: string;
|
|
207
207
|
"urlLayer"?: string;
|
|
208
|
-
"zoom"?:
|
|
208
|
+
"zoom"?: number;
|
|
209
209
|
}
|
|
210
210
|
interface GrwFilter {
|
|
211
211
|
"filterName"?: string;
|
|
@@ -2,7 +2,10 @@ export declare class GrwTrekProvider {
|
|
|
2
2
|
language: string;
|
|
3
3
|
api: string;
|
|
4
4
|
trekId: string;
|
|
5
|
-
|
|
5
|
+
trekNetworkError: boolean;
|
|
6
|
+
controller: AbortController;
|
|
7
|
+
signal: AbortSignal;
|
|
8
|
+
connectedCallback(): void;
|
|
6
9
|
disconnectedCallback(): void;
|
|
7
10
|
render(): any;
|
|
8
11
|
}
|
|
@@ -9,6 +9,9 @@ export declare class GrwTreksProvider {
|
|
|
9
9
|
portals: string;
|
|
10
10
|
routes: string;
|
|
11
11
|
practices: string;
|
|
12
|
-
|
|
12
|
+
controller: AbortController;
|
|
13
|
+
signal: AbortSignal;
|
|
14
|
+
connectedCallback(): void;
|
|
15
|
+
disconnectedCallback(): void;
|
|
13
16
|
render(): any;
|
|
14
17
|
}
|
|
@@ -19,6 +19,8 @@ declare const state: {
|
|
|
19
19
|
currentSensitiveAreas: SensitiveAreas;
|
|
20
20
|
currentPois: Pois;
|
|
21
21
|
currentInformationDesks: InformationDesks;
|
|
22
|
+
treksNetworkError: boolean;
|
|
23
|
+
trekNetworkError: boolean;
|
|
22
24
|
}, onChange: import("@stencil/store/dist/types").OnChangeHandler<{
|
|
23
25
|
api: string;
|
|
24
26
|
treks: Treks;
|
|
@@ -38,6 +40,8 @@ declare const state: {
|
|
|
38
40
|
currentSensitiveAreas: SensitiveAreas;
|
|
39
41
|
currentPois: Pois;
|
|
40
42
|
currentInformationDesks: InformationDesks;
|
|
43
|
+
treksNetworkError: boolean;
|
|
44
|
+
trekNetworkError: boolean;
|
|
41
45
|
}>;
|
|
42
46
|
export { onChange };
|
|
43
47
|
export default state;
|
package/package.json
CHANGED
package/readme.md
CHANGED
|
@@ -5,6 +5,8 @@ You can use a complete app or each component independantly.
|
|
|
5
5
|
|
|
6
6
|
## Usage
|
|
7
7
|
|
|
8
|
+
**The api you want to use had to authorize your domain.**
|
|
9
|
+
|
|
8
10
|
To use the latest version, copy-paste this inside `<head></head>`
|
|
9
11
|
|
|
10
12
|
```
|
|
@@ -17,5 +19,7 @@ You can replace _latest_ with a specific version.
|
|
|
17
19
|
|
|
18
20
|
## Explore
|
|
19
21
|
|
|
22
|
+
**The api you want to use had to authorize geotrekce.github.io.**
|
|
23
|
+
|
|
20
24
|
You can explore Geotrek Rando Widget and create your own component [here](https://geotrekce.github.io/Geotrek-rando-widget/).\
|
|
21
25
|
Once you made your component, you can get the code to copy-paste by clicking on _Docs_ then _Show code_.
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as i,h as t,H as e,g as r}from"./p-6dce5e6c.js";import{s as o}from"./p-e6710c64.js";const a=class{constructor(t){i(this,t),this.showTrek=!1,this.showTreksMap=!1,this.showTrekMap=!1,this.showFilters=!1,this.isLargeView=!1,this.language="fr",this.colorPrimary="#6b0030",this.colorPrimaryShade="#4a0021",this.colorPrimaryTint="#974c6e",this.colorTrekLine="#6b0030",this.colorDepartureIcon="#006b3b",this.colorArrivalIcon="#85003b",this.colorSensitiveArea="#4974a5",this.colorPoiIcon="#974c6e",this.handlePopStateBind=this.handlePopState.bind(this),this.largeViewSize=1024}onTrekCardPress(i){this.currentTrekId=i.detail,this.showTrek=!this.showTrek;const t=new URL(window.location.toString());t.searchParams.set("trek",this.currentTrekId.toString()),window.history.pushState({},"",t)}onWindowResize(){this.handleView()}watchPropHandler(){window.dispatchEvent(new window.Event("resize"))}componentDidLoad(){this.handleView(),window.addEventListener("popstate",this.handlePopStateBind,!1);const i=new URL(window.location.toString()),t=i.searchParams.get("trek");t&&(window.history.replaceState({isInitialHistoryWithTrek:!0},"",i),this.currentTrekId=Number(t),this.showTrek=!this.showTrek)}onTrekDetailsClose(){this.currentTrekId=null,this.showTrek=!this.showTrek}handleView(){this.isLargeView=this.element.getBoundingClientRect().width>=this.largeViewSize,this.showTreksMap=this.isLargeView,this.showTrekMap=this.isLargeView}handleFilters(){this.showFilters=!this.showFilters}handleBackButton(){if(window.history.state.isInitialHistoryWithTrek){this.onTrekDetailsClose();const i=new URL(window.location.toString());i.searchParams.delete("trek"),window.history.pushState({},"",i)}else window.history.back()}handlePopState(){const i=new URL(window.location.toString()).searchParams.get("trek");i?(this.currentTrekId=Number(i),this.showTrek=!this.showTrek):this.onTrekDetailsClose()}handleShowMap(){this.currentTrekId?this.showTrekMap=!this.showTrekMap:this.showTreksMap=!this.showTreksMap}disconnectedCallback(){window.removeEventListener("popstate",this.handlePopStateBind)}render(){return t(e,{style:{"--color-primary":this.colorPrimary,"--color-primary-tint":this.colorPrimaryTint,"--color-primary-shade":this.colorPrimaryShade}},t("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&&t("grw-trek-provider",{api:o.api,language:this.language,"trek-id":this.currentTrekId}),t("div",{class:"app-container"},t("div",{class:this.isLargeView?"large-view-header-container":"header-container"},this.showTrek?t("div",{onClick:()=>this.handleBackButton(),class:"arrow-back-icon",innerHTML:'<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>'}):t("div",{onClick:()=>this.handleFilters(),class:"handle-filters-button"},"FILTRER"),!this.showTrek&&this.showFilters&&t("div",{class:"options-container"},t("div",{class:"filters-container"},t("div",{class:"current-treks-length"},`${o.currentTreks.length} résultat${o.currentTreks.length>1?"s":""}`),t("div",{onClick:()=>this.handleFilters(),class:"close-filters-button"},"X"),t("div",null,t("grw-filter",{filterName:"Pratique",filterType:"practices",filterNameProperty:"name"})),t("div",{class:"filter-margin-top"},t("grw-filter",{filterName:"Difficulté",filterType:"difficulties",filterNameProperty:"label"})),t("div",{class:"filter-margin-top"},t("grw-filter",{filterName:"Durée",filterType:"durations",filterNameProperty:"name"}))),t("div",{onClick:()=>this.handleFilters(),class:"back-filters-container"})),t("div",{class:"attribution-container"},t("a",{target:"_blank",href:"https://geotrek.fr"},"GEOTREK"))),t("div",{class:"content-container"},t("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"}},t("grw-treks-list",{"is-large-view":this.isLargeView,"color-primary":this.colorPrimary,"color-primary-tint":this.colorPrimaryTint})),this.showTrek&&!o.currentTrek&&t("div",{class:this.isLargeView?"large-view-loader-container":"loader-container"},t("span",{class:"loader"})),o.currentTrek&&t("div",{class:this.isLargeView?"large-view-app-trek-detail-container":"app-trek-detail-container"},t("grw-trek-detail",{"color-primary":this.colorPrimary,"color-primary-shade":this.colorPrimaryShade,"color-primary-tint":this.colorPrimaryTint})),t("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})),t("div",{class:"map-visibility-button",style:{display:this.isLargeView?"none":"flex"}},t("div",{onClick:()=>this.handleShowMap()},this.showTreksMap||this.showTrekMap?this.showTrek?"Voir la fiche":"Voir la liste":"Voir la carte"))))}get element(){return r(this)}static get watchers(){return{isLargeView:["watchPropHandler"]}}};a.style='.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%}';export{a as grw_app}
|