vue3-google-map 0.8.4 → 0.8.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.
- package/dist/cjs/index.js +1 -1
- package/dist/es/index.js +1 -1
- package/dist/types/components/Circle.d.ts +1 -3
- package/dist/types/components/Marker.d.ts +1 -3
- package/dist/types/components/Polygon.d.ts +1 -3
- package/dist/types/components/Polyline.d.ts +1 -3
- package/dist/types/components/Rectangle.d.ts +1 -3
- package/dist/types/composables/useSetupMapComponent.d.ts +1 -3
- package/package.json +1 -1
package/dist/cjs/index.js
CHANGED
|
@@ -18,7 +18,7 @@ d.value=new google.maps.Map(e.value,l());mapEvents.forEach(a=>{var c;null===(c=d
|
|
|
18
18
|
function styleInject(a,b){void 0===b&&(b={});b=b.insertAt;if(a&&"undefined"!==typeof document){var e=document.head||document.getElementsByTagName("head")[0],c=document.createElement("style");c.type="text/css";"top"===b?e.firstChild?e.insertBefore(c,e.firstChild):e.appendChild(c):e.appendChild(c);c.styleSheet?c.styleSheet.cssText=a:c.appendChild(document.createTextNode(a))}}var css_248z="\n.mapdiv[data-v-177d06e3] {\n width: 100%;\n height: 100%;\n}\n";styleInject(css_248z);let _withId=vue.withScopeId("data-v-177d06e3");
|
|
19
19
|
vue.pushScopeId("data-v-177d06e3");let _hoisted_1$2={ref:"mapRef",class:"mapdiv"};vue.popScopeId();let _sfc_render$2=_withId((a,b,e,c,d,f)=>(vue.openBlock(),vue.createBlock("div",null,[vue.createVNode("div",_hoisted_1$2,null,512),vue.renderSlot(a.$slots,"default",{ready:a.ready,map:a.map,api:a.api,mapTilesLoaded:a.mapTilesLoaded},void 0,!0)])));_sfc_main$2.render=_sfc_render$2;_sfc_main$2.__scopeId="data-v-177d06e3";
|
|
20
20
|
let useSetupMapComponent=(a,b,e,c)=>{let d=null;const f=vue.ref(null),g=vue.inject(mapSymbol,vue.ref(null)),l=vue.inject(apiSymbol,vue.ref(null));vue.watch([g,e],(k,[h,m])=>{k=JSON.stringify(e.value)!==JSON.stringify(m)||g.value!==h;g.value&&l.value&&k&&(d?(d.setOptions(e.value),d.setMap(g.value)):(f.value=d=new l.value[a]({...e.value,map:g.value}),b.forEach(a=>{null===d||void 0===d?void 0:d.addListener(a,b=>c(a,b))})))},{immediate:!0});vue.onBeforeUnmount(()=>{var a;d&&(null===(a=l.value)||void 0===
|
|
21
|
-
a?void 0:a.event.clearInstanceListeners(d),d.setMap(null))});return
|
|
21
|
+
a?void 0:a.event.clearInstanceListeners(d),d.setMap(null))});return f},markerEvents="animation_changed click dblclick rightclick dragstart dragend drag mouseover mousedown mouseout mouseup draggable_changed clickable_changed contextmenu cursor_changed flat_changed rightclick zindex_changed icon_changed position_changed shape_changed title_changed visible_changed".split(" ");
|
|
22
22
|
var Marker=vue.defineComponent({props:{options:{type:Object,required:!0}},emits:markerEvents,setup(a,{emit:b}){a=vue.toRef(a,"options");return{marker:useSetupMapComponent("Marker",markerEvents,a,b)}},render:()=>null}),Polyline=vue.defineComponent({props:{options:{type:Object,required:!0}},emits:polylineEvents,setup(a,{emit:b}){a=vue.toRef(a,"options");return{polyline:useSetupMapComponent("Polyline",polylineEvents,a,b)}},render:()=>null}),Polygon=vue.defineComponent({props:{options:{type:Object,required:!0}},
|
|
23
23
|
emits:polylineEvents,setup(a,{emit:b}){a=vue.toRef(a,"options");return{polygon:useSetupMapComponent("Polygon",polylineEvents,a,b)}},render:()=>null});let rectangleEvents=polylineEvents.concat(["bounds_changed"]);var Rectangle=vue.defineComponent({props:{options:{type:Object,required:!0}},emits:rectangleEvents,setup(a,{emit:b}){a=vue.toRef(a,"options");return{rectangle:useSetupMapComponent("Rectangle",rectangleEvents,a,b)}},render:()=>null});
|
|
24
24
|
let circleEvents=polylineEvents.concat(["center_changed","radius_changed"]);
|
package/dist/es/index.js
CHANGED
|
@@ -18,7 +18,7 @@ h?void 0:h.addListener(a,h=>b(a,h))});d.value=!0;let h=Object.keys(a).filter(a=>
|
|
|
18
18
|
if("undefined"!==typeof document){var D=document.head||document.getElementsByTagName("head")[0],E=document.createElement("style");E.type="text/css";"top"===B?D.firstChild?D.insertBefore(E,D.firstChild):D.appendChild(E):D.appendChild(E);E.styleSheet?E.styleSheet.cssText="\n.mapdiv[data-v-177d06e3] {\n width: 100%;\n height: 100%;\n}\n":E.appendChild(document.createTextNode("\n.mapdiv[data-v-177d06e3] {\n width: 100%;\n height: 100%;\n}\n"))}let F=withScopeId("data-v-177d06e3");pushScopeId("data-v-177d06e3");
|
|
19
19
|
let G={ref:"mapRef",class:"mapdiv"};popScopeId();let H=F(a=>(openBlock(),createBlock("div",null,[createVNode("div",G,null,512),renderSlot(a.$slots,"default",{ready:a.ready,map:a.map,api:a.api,mapTilesLoaded:a.mapTilesLoaded},void 0,!0)])));z.render=H;z.__scopeId="data-v-177d06e3";
|
|
20
20
|
let I=(a,b,e,d)=>{let c=null;const f=ref(null),g=inject(n,ref(null)),m=inject(p,ref(null));watch([g,e],(l,[k,h])=>{l=JSON.stringify(e.value)!==JSON.stringify(h)||g.value!==k;g.value&&m.value&&l&&(c?(c.setOptions(e.value),c.setMap(g.value)):(f.value=c=new m.value[a]({...e.value,map:g.value}),b.forEach(a=>{null===c||void 0===c?void 0:c.addListener(a,b=>d(a,b))})))},{immediate:!0});onBeforeUnmount(()=>{var a;c&&(null===(a=m.value)||void 0===a?void 0:a.event.clearInstanceListeners(c),c.setMap(null))});
|
|
21
|
-
return
|
|
21
|
+
return f},J="animation_changed click dblclick rightclick dragstart dragend drag mouseover mousedown mouseout mouseup draggable_changed clickable_changed contextmenu cursor_changed flat_changed rightclick zindex_changed icon_changed position_changed shape_changed title_changed visible_changed".split(" ");
|
|
22
22
|
var K=defineComponent({props:{options:{type:Object,required:!0}},emits:J,setup(a,{emit:b}){a=toRef(a,"options");return{marker:I("Marker",J,a,b)}},render:()=>null}),L=defineComponent({props:{options:{type:Object,required:!0}},emits:t,setup(a,{emit:b}){a=toRef(a,"options");return{polyline:I("Polyline",t,a,b)}},render:()=>null}),M=defineComponent({props:{options:{type:Object,required:!0}},emits:t,setup(a,{emit:b}){a=toRef(a,"options");return{polygon:I("Polygon",t,a,b)}},render:()=>null});let P=t.concat(["bounds_changed"]);
|
|
23
23
|
var Q=defineComponent({props:{options:{type:Object,required:!0}},emits:P,setup(a,{emit:b}){a=toRef(a,"options");return{rectangle:I("Rectangle",P,a,b)}},render:()=>null});let R=t.concat(["center_changed","radius_changed"]);
|
|
24
24
|
var S=defineComponent({props:{options:{type:Object,required:!0}},emits:R,setup(a,{emit:b}){a=toRef(a,"options");return{circle:I("Circle",R,a,b)}},render:()=>null}),T=defineComponent({props:{position:{type:String,required:!0},index:{type:Number,default:1}},emits:["content:loaded"],setup(a,{emit:b}){let e=ref(null),d=inject(n,ref(null)),c=inject(p,ref(null)),f=inject(q,ref(!1)),g=ref(!1),m=watch([f,c,e],([h,c,d])=>{c&&h&&d&&(l(a.position),g.value=!0,b("content:loaded"),setTimeout(m,0))},{immediate:!0}),
|
|
@@ -6,9 +6,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
6
6
|
required: true;
|
|
7
7
|
};
|
|
8
8
|
}, {
|
|
9
|
-
circle:
|
|
10
|
-
component: import("vue").Ref<import("../composables/useSetupMapComponent").IComponent | null>;
|
|
11
|
-
};
|
|
9
|
+
circle: import("vue").Ref<import("../composables/useSetupMapComponent").IComponent | null>;
|
|
12
10
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, string[], string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<{
|
|
13
11
|
options: google.maps.CircleOptions;
|
|
14
12
|
} & {}>, {}>;
|
|
@@ -6,9 +6,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
6
6
|
required: true;
|
|
7
7
|
};
|
|
8
8
|
}, {
|
|
9
|
-
marker:
|
|
10
|
-
component: Ref<import("../composables/useSetupMapComponent").IComponent | null>;
|
|
11
|
-
};
|
|
9
|
+
marker: Ref<import("../composables/useSetupMapComponent").IComponent | null>;
|
|
12
10
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, string[], string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<{
|
|
13
11
|
options: google.maps.MarkerOptions;
|
|
14
12
|
} & {}>, {}>;
|
|
@@ -6,9 +6,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
6
6
|
required: true;
|
|
7
7
|
};
|
|
8
8
|
}, {
|
|
9
|
-
polygon:
|
|
10
|
-
component: import("vue").Ref<import("../composables/useSetupMapComponent").IComponent | null>;
|
|
11
|
-
};
|
|
9
|
+
polygon: import("vue").Ref<import("../composables/useSetupMapComponent").IComponent | null>;
|
|
12
10
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, string[], string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<{
|
|
13
11
|
options: google.maps.PolygonOptions;
|
|
14
12
|
} & {}>, {}>;
|
|
@@ -6,9 +6,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
6
6
|
required: true;
|
|
7
7
|
};
|
|
8
8
|
}, {
|
|
9
|
-
polyline:
|
|
10
|
-
component: import("vue").Ref<import("../composables/useSetupMapComponent").IComponent | null>;
|
|
11
|
-
};
|
|
9
|
+
polyline: import("vue").Ref<import("../composables/useSetupMapComponent").IComponent | null>;
|
|
12
10
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, string[], string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<{
|
|
13
11
|
options: google.maps.PolylineOptions;
|
|
14
12
|
} & {}>, {}>;
|
|
@@ -6,9 +6,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
6
6
|
required: true;
|
|
7
7
|
};
|
|
8
8
|
}, {
|
|
9
|
-
rectangle:
|
|
10
|
-
component: import("vue").Ref<import("../composables/useSetupMapComponent").IComponent | null>;
|
|
11
|
-
};
|
|
9
|
+
rectangle: import("vue").Ref<import("../composables/useSetupMapComponent").IComponent | null>;
|
|
12
10
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, string[], string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<{
|
|
13
11
|
options: google.maps.RectangleOptions;
|
|
14
12
|
} & {}>, {}>;
|
|
@@ -2,6 +2,4 @@
|
|
|
2
2
|
import { Ref } from "vue";
|
|
3
3
|
export declare type IComponent = google.maps.Marker | google.maps.Polyline | google.maps.Polygon | google.maps.Rectangle | google.maps.Circle;
|
|
4
4
|
export declare type IComponentOptions = google.maps.MarkerOptions | google.maps.PolylineOptions | google.maps.PolygonOptions | google.maps.RectangleOptions | google.maps.CircleOptions;
|
|
5
|
-
export declare const useSetupMapComponent: (componentName: "Marker" | "Polyline" | "Polygon" | "Rectangle" | "Circle", events: string[], options: Ref<IComponentOptions>, emit: (event: string, ...args: unknown[]) => void) =>
|
|
6
|
-
component: Ref<IComponent | null>;
|
|
7
|
-
};
|
|
5
|
+
export declare const useSetupMapComponent: (componentName: "Marker" | "Polyline" | "Polygon" | "Rectangle" | "Circle", events: string[], options: Ref<IComponentOptions>, emit: (event: string, ...args: unknown[]) => void) => Ref<IComponent | null>;
|