@tekkare/auriga 0.2.126 → 0.2.127
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/module.json +1 -1
- package/dist/runtime/components/argGoogleMaps.vue +133 -0
- package/dist/runtime/components/argGoogleMaps.vue.d.ts +83 -0
- package/dist/runtime/components/argGoogleMapsHeader.vue +47 -0
- package/dist/runtime/components/argGoogleMapsHeader.vue.d.ts +43 -0
- package/package.json +6 -6
package/dist/module.json
CHANGED
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="auriga_map_frame">
|
|
3
|
+
<GoogleMap
|
|
4
|
+
v-if="mapKey"
|
|
5
|
+
:api-key="mapKey"
|
|
6
|
+
:style="{ width: width, height: height }"
|
|
7
|
+
:center="center"
|
|
8
|
+
:zoom="mapZoom"
|
|
9
|
+
map-id="arg-map"
|
|
10
|
+
>
|
|
11
|
+
<MarkerCluster>
|
|
12
|
+
<AdvancedMarker
|
|
13
|
+
v-for="(loc, index) in locations"
|
|
14
|
+
:key="index"
|
|
15
|
+
:options="{
|
|
16
|
+
position: { lat: loc.lat, lng: loc.lng },
|
|
17
|
+
title: loc.title,
|
|
18
|
+
}"
|
|
19
|
+
>
|
|
20
|
+
<InfoWindow v-if="showWindow">
|
|
21
|
+
<h1 class="auriga_map_infowindow_title">{{ loc.title }}</h1>
|
|
22
|
+
</InfoWindow>
|
|
23
|
+
</AdvancedMarker>
|
|
24
|
+
</MarkerCluster>
|
|
25
|
+
</GoogleMap>
|
|
26
|
+
</div>
|
|
27
|
+
</template>
|
|
28
|
+
<script>
|
|
29
|
+
import {
|
|
30
|
+
computed,
|
|
31
|
+
defineComponent
|
|
32
|
+
} from "vue";
|
|
33
|
+
import {
|
|
34
|
+
GoogleMap,
|
|
35
|
+
AdvancedMarker,
|
|
36
|
+
InfoWindow,
|
|
37
|
+
MarkerCluster
|
|
38
|
+
} from "vue3-google-map";
|
|
39
|
+
import argStyle from "./argStyle.vue";
|
|
40
|
+
export default defineComponent({
|
|
41
|
+
name: "argGoogleMaps",
|
|
42
|
+
components: {
|
|
43
|
+
GoogleMap,
|
|
44
|
+
AdvancedMarker,
|
|
45
|
+
InfoWindow,
|
|
46
|
+
argStyle,
|
|
47
|
+
MarkerCluster
|
|
48
|
+
},
|
|
49
|
+
props: {
|
|
50
|
+
mapKey: {
|
|
51
|
+
type: String,
|
|
52
|
+
required: true
|
|
53
|
+
},
|
|
54
|
+
locations: {
|
|
55
|
+
type: Array,
|
|
56
|
+
required: true
|
|
57
|
+
},
|
|
58
|
+
showWindow: {
|
|
59
|
+
type: Boolean,
|
|
60
|
+
default: false
|
|
61
|
+
},
|
|
62
|
+
width: {
|
|
63
|
+
type: String,
|
|
64
|
+
default: "100%"
|
|
65
|
+
},
|
|
66
|
+
height: {
|
|
67
|
+
type: String,
|
|
68
|
+
default: "205px"
|
|
69
|
+
},
|
|
70
|
+
zoom: {
|
|
71
|
+
type: Number,
|
|
72
|
+
required: false
|
|
73
|
+
},
|
|
74
|
+
mapCenter: {
|
|
75
|
+
type: Object,
|
|
76
|
+
required: false
|
|
77
|
+
}
|
|
78
|
+
},
|
|
79
|
+
setup(props) {
|
|
80
|
+
const center = computed(() => {
|
|
81
|
+
if (props.mapCenter) {
|
|
82
|
+
return props.mapCenter;
|
|
83
|
+
} else {
|
|
84
|
+
if (props.locations.length === 0)
|
|
85
|
+
return { lat: 0, lng: 0 };
|
|
86
|
+
const totalLat = props.locations.reduce(
|
|
87
|
+
(sum, loc) => sum + loc?.lat,
|
|
88
|
+
0
|
|
89
|
+
);
|
|
90
|
+
const totalLng = props.locations.reduce(
|
|
91
|
+
(sum, loc) => sum + loc?.lng,
|
|
92
|
+
0
|
|
93
|
+
);
|
|
94
|
+
return {
|
|
95
|
+
lat: totalLat / props.locations.length,
|
|
96
|
+
lng: totalLng / props.locations.length
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
});
|
|
100
|
+
const mapZoom = computed(() => {
|
|
101
|
+
if (props.zoom) {
|
|
102
|
+
return props.zoom;
|
|
103
|
+
} else {
|
|
104
|
+
if (props.locations.length === 0)
|
|
105
|
+
return 12;
|
|
106
|
+
const latitudes = props.locations.map((loc) => loc.lat);
|
|
107
|
+
const longitudes = props.locations.map((loc) => loc.lng);
|
|
108
|
+
const latDiff = Math.max(...latitudes) - Math.min(...latitudes);
|
|
109
|
+
const lngDiff = Math.max(...longitudes) - Math.min(...longitudes);
|
|
110
|
+
const maxDiff = Math.max(latDiff, lngDiff);
|
|
111
|
+
if (maxDiff < 0.01)
|
|
112
|
+
return 16;
|
|
113
|
+
if (maxDiff < 0.05)
|
|
114
|
+
return 14;
|
|
115
|
+
if (maxDiff < 0.1)
|
|
116
|
+
return 12;
|
|
117
|
+
if (maxDiff < 0.5)
|
|
118
|
+
return 10;
|
|
119
|
+
if (maxDiff < 1)
|
|
120
|
+
return 8;
|
|
121
|
+
return 6;
|
|
122
|
+
}
|
|
123
|
+
});
|
|
124
|
+
return {
|
|
125
|
+
center,
|
|
126
|
+
mapZoom
|
|
127
|
+
};
|
|
128
|
+
}
|
|
129
|
+
});
|
|
130
|
+
</script>
|
|
131
|
+
<style>
|
|
132
|
+
.auriga_map_frame{border:1px solid var(--Main-Light,#dbdef0);border-radius:12px;box-shadow:0 1px 2px 0 rgba(30,41,59,.1);overflow:hidden}.auriga_map_infowindow_title{font-size:20px;font-style:normal;font-weight:800;line-height:normal}
|
|
133
|
+
</style>
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { PropType } from "vue";
|
|
2
|
+
interface Location {
|
|
3
|
+
lat: number;
|
|
4
|
+
lng: number;
|
|
5
|
+
title: string;
|
|
6
|
+
}
|
|
7
|
+
interface LocationCenter {
|
|
8
|
+
lat: number;
|
|
9
|
+
lng: number;
|
|
10
|
+
}
|
|
11
|
+
declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
12
|
+
mapKey: {
|
|
13
|
+
type: StringConstructor;
|
|
14
|
+
required: true;
|
|
15
|
+
};
|
|
16
|
+
locations: {
|
|
17
|
+
type: PropType<Location[]>;
|
|
18
|
+
required: true;
|
|
19
|
+
};
|
|
20
|
+
showWindow: {
|
|
21
|
+
type: BooleanConstructor;
|
|
22
|
+
default: boolean;
|
|
23
|
+
};
|
|
24
|
+
width: {
|
|
25
|
+
type: StringConstructor;
|
|
26
|
+
default: string;
|
|
27
|
+
};
|
|
28
|
+
height: {
|
|
29
|
+
type: StringConstructor;
|
|
30
|
+
default: string;
|
|
31
|
+
};
|
|
32
|
+
zoom: {
|
|
33
|
+
type: NumberConstructor;
|
|
34
|
+
required: false;
|
|
35
|
+
};
|
|
36
|
+
mapCenter: {
|
|
37
|
+
type: PropType<LocationCenter>;
|
|
38
|
+
required: false;
|
|
39
|
+
};
|
|
40
|
+
}>, {
|
|
41
|
+
center: import("vue").ComputedRef<LocationCenter>;
|
|
42
|
+
mapZoom: import("vue").ComputedRef<number>;
|
|
43
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
44
|
+
mapKey: {
|
|
45
|
+
type: StringConstructor;
|
|
46
|
+
required: true;
|
|
47
|
+
};
|
|
48
|
+
locations: {
|
|
49
|
+
type: PropType<Location[]>;
|
|
50
|
+
required: true;
|
|
51
|
+
};
|
|
52
|
+
showWindow: {
|
|
53
|
+
type: BooleanConstructor;
|
|
54
|
+
default: boolean;
|
|
55
|
+
};
|
|
56
|
+
width: {
|
|
57
|
+
type: StringConstructor;
|
|
58
|
+
default: string;
|
|
59
|
+
};
|
|
60
|
+
height: {
|
|
61
|
+
type: StringConstructor;
|
|
62
|
+
default: string;
|
|
63
|
+
};
|
|
64
|
+
zoom: {
|
|
65
|
+
type: NumberConstructor;
|
|
66
|
+
required: false;
|
|
67
|
+
};
|
|
68
|
+
mapCenter: {
|
|
69
|
+
type: PropType<LocationCenter>;
|
|
70
|
+
required: false;
|
|
71
|
+
};
|
|
72
|
+
}>> & Readonly<{}>, {
|
|
73
|
+
width: string;
|
|
74
|
+
height: string;
|
|
75
|
+
showWindow: boolean;
|
|
76
|
+
}, {}, {
|
|
77
|
+
GoogleMap: any;
|
|
78
|
+
AdvancedMarker: any;
|
|
79
|
+
InfoWindow: any;
|
|
80
|
+
argStyle: any;
|
|
81
|
+
MarkerCluster: any;
|
|
82
|
+
}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
83
|
+
export default _default;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<ArgGoogleMaps :map-key="mapKey" :locations="locations" />
|
|
4
|
+
<div class="arg_google_maps_header_content">
|
|
5
|
+
<div class="arg_google_maps_header_icon">
|
|
6
|
+
<argIcon :name="icon" size="96px" :color="iconColor" />
|
|
7
|
+
</div>
|
|
8
|
+
<div class="arg_google_maps_header_slot">
|
|
9
|
+
<slot></slot>
|
|
10
|
+
</div>
|
|
11
|
+
</div>
|
|
12
|
+
</div>
|
|
13
|
+
</template>
|
|
14
|
+
<script>
|
|
15
|
+
import {
|
|
16
|
+
defineComponent
|
|
17
|
+
} from "vue";
|
|
18
|
+
import argIcon from "./argIcon.vue";
|
|
19
|
+
import argGoogleMaps from "./argGoogleMaps.vue";
|
|
20
|
+
export default defineComponent({
|
|
21
|
+
name: "argGoogleMapsHeader",
|
|
22
|
+
components: { argIcon, argGoogleMaps },
|
|
23
|
+
props: {
|
|
24
|
+
mapKey: {
|
|
25
|
+
type: String,
|
|
26
|
+
required: true
|
|
27
|
+
},
|
|
28
|
+
locations: {
|
|
29
|
+
type: Array,
|
|
30
|
+
required: true
|
|
31
|
+
},
|
|
32
|
+
icon: {
|
|
33
|
+
type: String,
|
|
34
|
+
default: "BuildingApartment"
|
|
35
|
+
},
|
|
36
|
+
iconColor: {
|
|
37
|
+
type: String,
|
|
38
|
+
default: "#2176FF"
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
setup(props) {
|
|
42
|
+
}
|
|
43
|
+
});
|
|
44
|
+
</script>
|
|
45
|
+
<style>
|
|
46
|
+
.arg_google_maps_header_content{display:flex;gap:24px;margin:-30px 30px 0;position:relative;z-index:200}.arg_google_maps_header_icon{align-items:center;background:#fff;border:1px solid #dbdef0;border-radius:500px;box-shadow:0 6px 8px 0 rgba(30,41,59,.1);display:flex;height:160px;justify-content:center;width:160px}.arg_google_maps_header_slot{box-sizing:border-box;display:flex;flex-direction:column;gap:6px;padding:42px 0 12px}
|
|
47
|
+
</style>
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { PropType } from "vue";
|
|
2
|
+
declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
3
|
+
mapKey: {
|
|
4
|
+
type: StringConstructor;
|
|
5
|
+
required: true;
|
|
6
|
+
};
|
|
7
|
+
locations: {
|
|
8
|
+
type: PropType<Location[]>;
|
|
9
|
+
required: true;
|
|
10
|
+
};
|
|
11
|
+
icon: {
|
|
12
|
+
type: StringConstructor;
|
|
13
|
+
default: string;
|
|
14
|
+
};
|
|
15
|
+
iconColor: {
|
|
16
|
+
type: StringConstructor;
|
|
17
|
+
default: string;
|
|
18
|
+
};
|
|
19
|
+
}>, void, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
20
|
+
mapKey: {
|
|
21
|
+
type: StringConstructor;
|
|
22
|
+
required: true;
|
|
23
|
+
};
|
|
24
|
+
locations: {
|
|
25
|
+
type: PropType<Location[]>;
|
|
26
|
+
required: true;
|
|
27
|
+
};
|
|
28
|
+
icon: {
|
|
29
|
+
type: StringConstructor;
|
|
30
|
+
default: string;
|
|
31
|
+
};
|
|
32
|
+
iconColor: {
|
|
33
|
+
type: StringConstructor;
|
|
34
|
+
default: string;
|
|
35
|
+
};
|
|
36
|
+
}>> & Readonly<{}>, {
|
|
37
|
+
iconColor: string;
|
|
38
|
+
icon: string;
|
|
39
|
+
}, {}, {
|
|
40
|
+
argIcon: any;
|
|
41
|
+
argGoogleMaps: any;
|
|
42
|
+
}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
43
|
+
export default _default;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tekkare/auriga",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.127",
|
|
4
4
|
"description": "Aurgia is a UI kit developped by Tekkare",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"patch": "nuxt-module-build && npm version patch && npm publish"
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@nuxt/kit": "^3.15.
|
|
33
|
+
"@nuxt/kit": "^3.15.4",
|
|
34
34
|
"@svg-maps/france.departments": "^1.0.1",
|
|
35
35
|
"@svg-maps/france.regions": "^1.1.1",
|
|
36
36
|
"@svg-maps/usa": "^1.1.1",
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"@vueuse/integrations": "^10.11.1",
|
|
40
40
|
"apexcharts": "^3.54.1",
|
|
41
41
|
"fuse.js": "^6.6.2",
|
|
42
|
-
"posthog-js": "^1.
|
|
42
|
+
"posthog-js": "^1.215.2",
|
|
43
43
|
"save": "^2.9.0",
|
|
44
44
|
"vue-apexcharts": "^1.7.0",
|
|
45
45
|
"vue-svg-map": "^1.2.0",
|
|
@@ -50,12 +50,12 @@
|
|
|
50
50
|
"@nuxt/devtools": "latest",
|
|
51
51
|
"@nuxt/eslint-config": "^0.2.0",
|
|
52
52
|
"@nuxt/module-builder": "^0.5.5",
|
|
53
|
-
"@nuxt/schema": "^3.15.
|
|
53
|
+
"@nuxt/schema": "^3.15.4",
|
|
54
54
|
"@nuxt/test-utils": "^3.15.4",
|
|
55
|
-
"@types/node": "^18.19.
|
|
55
|
+
"@types/node": "^18.19.75",
|
|
56
56
|
"changelogen": "^0.5.7",
|
|
57
57
|
"eslint": "^8.57.1",
|
|
58
|
-
"nuxt": "^3.15.
|
|
58
|
+
"nuxt": "^3.15.4",
|
|
59
59
|
"vitest": "^0.34.6"
|
|
60
60
|
},
|
|
61
61
|
"author": "Tekkare"
|