@heycar/heycars-map 0.2.6 → 0.2.8
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/business-components/AbsoluteAddressBox/AbsoluteAddressBox.d.ts +2 -0
- package/dist/business-components/AbsoluteAddressBox/index.d.ts +1 -0
- package/dist/business-components/AddressBox/AddressBox.d.ts +1 -2
- package/dist/business-components/BusinessQuotingMap/BusinessQuotingMap.d.ts +2 -3
- package/dist/business-components/BusinessRecomendPlaceMap/BusinessRecomendPlaceMap.d.ts +24 -0
- package/dist/business-components/BusinessRecomendPlaceMap/index.d.ts +1 -0
- package/dist/business-components/BusinessTaxiServiceMap/BusinessTaxiServiceMap.d.ts +2 -3
- package/dist/business-components/FitView/FitView.d.ts +3 -1
- package/dist/hooks/useGeoLocation.d.ts +1 -0
- package/dist/hooks-business/useBusinessRecomendPlaceMap.d.ts +27 -0
- package/dist/hooks-business/{useBusinessMapRecomendPlace.d.ts → useLagecyMapRecomendPlace.d.ts} +2 -2
- package/dist/index.cjs +50 -50
- package/dist/index.d.ts +4 -1
- package/dist/index.js +1564 -1403
- package/dist/style.css +1 -1
- package/dist/types/interface.d.ts +2 -1
- package/package.json +1 -1
- package/src/App.tsx +3 -3
- package/src/business-components/AbsoluteAddressBox/AbsoluteAddressBox.tsx +8 -0
- package/src/business-components/AbsoluteAddressBox/index.ts +1 -0
- package/src/business-components/AddressBox/AddressBox.tsx +1 -1
- package/src/business-components/BusinessQuotingMap/BusinessQuotingMap.tsx +4 -4
- package/src/business-components/BusinessRecomendPlaceMap/BusinessRecomendPlaceMap.tsx +157 -0
- package/src/business-components/BusinessRecomendPlaceMap/index.ts +1 -0
- package/src/business-components/BusinessTaxiServiceMap/BusinessTaxiServiceMap.tsx +115 -101
- package/src/business-components/FitView/FitView.tsx +10 -2
- package/src/business-components/PlaceCircle/PlaceCircle.tsx +15 -19
- package/src/components/Demo/DemoBusinessQuoting.tsx +1 -2
- package/src/components/Demo/DemoBusinessTaxiService.tsx +0 -1
- package/src/components/Demo/HeycarDemo.tsx +21 -98
- package/src/hooks/useGeoLocation.ts +3 -1
- package/src/hooks/useMapFitView.ts +18 -16
- package/src/hooks-business/useBusinessRecomendPlaceMap.ts +45 -0
- package/src/hooks-business/{useBusinessMapRecomendPlace.ts → useLagecyMapRecomendPlace.ts} +3 -2
- package/src/index.ts +4 -1
- package/src/types/interface.ts +12 -1
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import type { AddressBoxProps } from "../AddressBox";
|
|
2
|
+
export declare const AbsoluteAddressBox: import("vue").DefineComponent<import("vue/types/v3-component-props").ComponentObjectPropsOptions<AddressBoxProps>, import("../../types/helper").Empty, import("../../types/helper").Empty, import("../../types/helper").Empty, import("../../types/helper").Empty, import("../../types/helper").Empty, import("../../types/helper").Empty, import("../../types/helper").EmitByProps<AddressBoxProps, Required<AddressBoxProps>>, never, AddressBoxProps, {}>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./AbsoluteAddressBox";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Point } from "../../types/interface";
|
|
2
|
-
interface AddressBoxProps {
|
|
2
|
+
export interface AddressBoxProps {
|
|
3
3
|
type: "box" | "locator";
|
|
4
4
|
position: Point;
|
|
5
5
|
title: string;
|
|
@@ -8,4 +8,3 @@ interface AddressBoxProps {
|
|
|
8
8
|
export declare const AAddressBox: import("vue-demi").DefineComponent<import("vue/types/v3-component-props").ComponentObjectPropsOptions<AddressBoxProps>, import("../../types/helper").Empty, import("../../types/helper").Empty, import("../../types/helper").Empty, import("../../types/helper").Empty, import("../../types/helper").Empty, import("../../types/helper").Empty, import("../../types/helper").EmitByProps<AddressBoxProps, Required<AddressBoxProps>>, never, AddressBoxProps, {}>;
|
|
9
9
|
export declare const GAddressBox: import("vue-demi").DefineComponent<import("vue/types/v3-component-props").ComponentObjectPropsOptions<AddressBoxProps>, import("../../types/helper").Empty, import("../../types/helper").Empty, import("../../types/helper").Empty, import("../../types/helper").Empty, import("../../types/helper").Empty, import("../../types/helper").Empty, import("../../types/helper").EmitByProps<AddressBoxProps, Required<AddressBoxProps>>, never, AddressBoxProps, {}>;
|
|
10
10
|
export declare const AddressBox: import("vue-demi").DefineComponent<import("vue/types/v3-component-props").ComponentObjectPropsOptions<AddressBoxProps>, import("../../types/helper").Empty, import("../../types/helper").Empty, import("../../types/helper").Empty, import("../../types/helper").Empty, import("../../types/helper").Empty, import("../../types/helper").Empty, import("../../types/helper").EmitByProps<AddressBoxProps, Required<AddressBoxProps>>, never, AddressBoxProps, {}>;
|
|
11
|
-
export {};
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { HeycarMapProps } from "../../components/MapProvider";
|
|
2
|
-
import type { MapMountedProps } from "../../hooks/useMap";
|
|
3
2
|
import type { MROP } from "../../hooks/useOverlay";
|
|
4
3
|
import type { Place } from "../../types/interface";
|
|
5
|
-
export type BusinessQuotingMapProps = Omit<HeycarMapProps, "center" | "zoom"> & MROP &
|
|
4
|
+
export type BusinessQuotingMapProps = Omit<HeycarMapProps, "center" | "zoom"> & Required<MROP> & {
|
|
6
5
|
from: Place;
|
|
7
6
|
to: Place;
|
|
8
7
|
renderDescription: (titleProps: {
|
|
@@ -10,4 +9,4 @@ export type BusinessQuotingMapProps = Omit<HeycarMapProps, "center" | "zoom"> &
|
|
|
10
9
|
duration: number;
|
|
11
10
|
}) => string;
|
|
12
11
|
};
|
|
13
|
-
export declare const BusinessQuotingMap: import("vue").DefineComponent<import("vue/types/v3-component-props").ComponentObjectPropsOptions<BusinessQuotingMapProps>, import("../../types/helper").Empty, import("../../types/helper").Empty, import("../../types/helper").Empty, import("../../types/helper").Empty, import("../../types/helper").Empty, import("../../types/helper").Empty, import("../../types/helper").EmitByProps<BusinessQuotingMapProps, Required<BusinessQuotingMapProps>>, "dragEnd"
|
|
12
|
+
export declare const BusinessQuotingMap: import("vue").DefineComponent<import("vue/types/v3-component-props").ComponentObjectPropsOptions<BusinessQuotingMapProps>, import("../../types/helper").Empty, import("../../types/helper").Empty, import("../../types/helper").Empty, import("../../types/helper").Empty, import("../../types/helper").Empty, import("../../types/helper").Empty, import("../../types/helper").EmitByProps<BusinessQuotingMapProps, Required<BusinessQuotingMapProps>>, "dragEnd", BusinessQuotingMapProps, {} | {}>;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { HeycarMapProps } from "../../components/MapProvider";
|
|
2
|
+
import type { BusinessRecomendPlaceContext } from "../../hooks-business/useBusinessRecomendPlaceMap";
|
|
3
|
+
import { UseGeoLocationProps } from "../../hooks/useGeoLocation";
|
|
4
|
+
import { UseMapDragProps } from "../../hooks/useMapDrag";
|
|
5
|
+
import type { UseMapPlaceProps } from "../../hooks/useMapPlace";
|
|
6
|
+
import { UseMapRecomendPlaceProps } from "../../hooks/useMapRecomendPlace";
|
|
7
|
+
import type { Point } from "../../types/interface";
|
|
8
|
+
export interface CenterPlaceSource {
|
|
9
|
+
source: "default" | "geo" | "drag" | "recomend" | "api";
|
|
10
|
+
}
|
|
11
|
+
export interface BusinessRecomendPlaceMapProps extends Omit<HeycarMapProps, "center" | "zoom" | "mapRef">, Pick<UseMapRecomendPlaceProps<CenterPlaceSource>, "getRecomendPlace"> {
|
|
12
|
+
title: string;
|
|
13
|
+
description: string;
|
|
14
|
+
geoDefaultPosition?: Point;
|
|
15
|
+
mapContext: BusinessRecomendPlaceContext;
|
|
16
|
+
onLoadGeoLocation?: UseGeoLocationProps["onLoad"];
|
|
17
|
+
onLoadDefaultGeoLocation?: UseGeoLocationProps["onLoadDefault"];
|
|
18
|
+
onChangeByDrag?: UseMapDragProps["onChange"];
|
|
19
|
+
onChangeGeoLocation?: UseGeoLocationProps["onChange"];
|
|
20
|
+
onChangePlace?: UseMapPlaceProps["onChange"];
|
|
21
|
+
onChangeRecomandPlace?: UseMapRecomendPlaceProps["onChange"];
|
|
22
|
+
onGeoError?: UseGeoLocationProps["onError"];
|
|
23
|
+
}
|
|
24
|
+
export declare const BusinessRecomendPlaceMap: import("vue").DefineComponent<import("vue/types/v3-component-props").ComponentObjectPropsOptions<BusinessRecomendPlaceMapProps>, import("../../types/helper").Empty, import("../../types/helper").Empty, import("../../types/helper").Empty, import("../../types/helper").Empty, import("../../types/helper").Empty, import("../../types/helper").Empty, import("../../types/helper").EmitByProps<BusinessRecomendPlaceMapProps, Required<BusinessRecomendPlaceMapProps>>, "dragEnd" | "changePlace" | "loadGeoLocation" | "loadDefaultGeoLocation" | "changeByDrag" | "changeGeoLocation" | "changeRecomandPlace" | "geoError", BusinessRecomendPlaceMapProps, {}>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./BusinessRecomendPlaceMap";
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { HeycarMapProps } from "../../components/MapProvider";
|
|
2
|
-
import { MapMountedProps } from "../../hooks/useMap";
|
|
3
2
|
import type { MROP } from "../../hooks/useOverlay";
|
|
4
3
|
import type { DriverStatus, Place, Point } from "../../types/interface";
|
|
5
|
-
export type BusinessTaxiServiceMapProps = Omit<HeycarMapProps, "center" | "zoom"> & MROP &
|
|
4
|
+
export type BusinessTaxiServiceMapProps = Omit<HeycarMapProps, "center" | "zoom"> & Required<MROP> & {
|
|
6
5
|
from: Place;
|
|
7
6
|
to: Place;
|
|
8
7
|
dispatchingTitle: string;
|
|
@@ -21,4 +20,4 @@ export type BusinessTaxiServiceMapProps = Omit<HeycarMapProps, "center" | "zoom"
|
|
|
21
20
|
}) => string;
|
|
22
21
|
getDriverPosition: () => Promise<Point>;
|
|
23
22
|
};
|
|
24
|
-
export declare const BusinessTaxiServiceMap: import("vue-demi").DefineComponent<import("vue/types/v3-component-props").ComponentObjectPropsOptions<BusinessTaxiServiceMapProps>, import("../../types/helper").Empty, import("../../types/helper").Empty, import("../../types/helper").Empty, import("../../types/helper").Empty, import("../../types/helper").Empty, import("../../types/helper").Empty, import("../../types/helper").EmitByProps<BusinessTaxiServiceMapProps, Required<BusinessTaxiServiceMapProps>>, "dragEnd"
|
|
23
|
+
export declare const BusinessTaxiServiceMap: import("vue-demi").DefineComponent<import("vue/types/v3-component-props").ComponentObjectPropsOptions<BusinessTaxiServiceMapProps>, import("../../types/helper").Empty, import("../../types/helper").Empty, import("../../types/helper").Empty, import("../../types/helper").Empty, import("../../types/helper").Empty, import("../../types/helper").Empty, import("../../types/helper").EmitByProps<BusinessTaxiServiceMapProps, Required<BusinessTaxiServiceMapProps>>, "dragEnd", BusinessTaxiServiceMapProps, {} | {}>;
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { UseMapFitViewOutput, UseMapFitViewProps } from "../../hooks/useMapFitView";
|
|
2
|
-
import type { AmapOverlay, GmapOverlay } from "../../hooks/useOverlay";
|
|
2
|
+
import type { AmapOverlay, GmapOverlay, MROP } from "../../hooks/useOverlay";
|
|
3
3
|
import { VNodeChild } from "../../types/helper";
|
|
4
4
|
type FitViewRenderProps = UseMapFitViewOutput<AmapOverlay> | UseMapFitViewOutput<GmapOverlay>;
|
|
5
5
|
export interface FitViewProps extends Omit<UseMapFitViewProps, "mapRef"> {
|
|
6
6
|
render?: (props: FitViewRenderProps) => VNodeChild;
|
|
7
7
|
}
|
|
8
8
|
export declare const FitView: import("vue").DefineComponent<import("vue/types/v3-component-props").ComponentObjectPropsOptions<FitViewProps>, import("../../types/helper").Empty, import("../../types/helper").Empty, import("../../types/helper").Empty, import("../../types/helper").Empty, import("../../types/helper").Empty, import("../../types/helper").Empty, import("../../types/helper").EmitByProps<FitViewProps, Required<FitViewProps>>, never, FitViewProps, {}>;
|
|
9
|
+
export type FitViewOnceProps = Required<MROP>;
|
|
10
|
+
export declare const FitViewOnce: import("vue").DefineComponent<import("vue/types/v3-component-props").ComponentObjectPropsOptions<FitViewOnceProps>, import("../../types/helper").Empty, import("../../types/helper").Empty, import("../../types/helper").Empty, import("../../types/helper").Empty, import("../../types/helper").Empty, import("../../types/helper").Empty, import("../../types/helper").EmitByProps<FitViewOnceProps, Required<FitViewOnceProps>>, never, FitViewOnceProps, {} | {}>;
|
|
9
11
|
export {};
|
|
@@ -12,6 +12,7 @@ export interface UseGeoLocationProps {
|
|
|
12
12
|
onLoadDefault?: (value: {
|
|
13
13
|
position: Point;
|
|
14
14
|
}) => any;
|
|
15
|
+
onError?: (error: GeolocationPositionError) => any;
|
|
15
16
|
}
|
|
16
17
|
export declare const useGeoLocation: (props?: UseGeoLocationProps) => {
|
|
17
18
|
geoError: import("vue-demi").Ref<GeolocationPositionError | undefined>;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { Place, Point } from "../types/interface";
|
|
2
|
+
export interface BusinessRecomendPlaceContext {
|
|
3
|
+
panTo: (value: Point) => void;
|
|
4
|
+
setCenterPlaceByRecomand: (value: Point) => void;
|
|
5
|
+
onChangeCenterPlace: (value: Place) => void;
|
|
6
|
+
onChangeRecomendPlaces: (value: Place[]) => void;
|
|
7
|
+
}
|
|
8
|
+
export declare const useBusinessRecomendPlaceMap: () => {
|
|
9
|
+
mapContext: BusinessRecomendPlaceContext;
|
|
10
|
+
centerPlace: {
|
|
11
|
+
lng: number;
|
|
12
|
+
lat: number;
|
|
13
|
+
name: string;
|
|
14
|
+
cityName?: string | undefined;
|
|
15
|
+
cityId?: string | undefined;
|
|
16
|
+
};
|
|
17
|
+
placeCandidates: import("vue-demi").Ref<{
|
|
18
|
+
lng: number;
|
|
19
|
+
lat: number;
|
|
20
|
+
name: string;
|
|
21
|
+
cityName?: string | undefined;
|
|
22
|
+
cityId?: string | undefined;
|
|
23
|
+
}[]>;
|
|
24
|
+
panTo: (value: Point) => void;
|
|
25
|
+
setCenterPlaceByRecomand: (value: Point) => void;
|
|
26
|
+
apiMapDistance: (from: Point, to: Point) => number | undefined;
|
|
27
|
+
};
|
package/dist/hooks-business/{useBusinessMapRecomendPlace.d.ts → useLagecyMapRecomendPlace.d.ts}
RENAMED
|
@@ -6,7 +6,7 @@ import type { MapShallowRef, Place, Point } from "../types/interface";
|
|
|
6
6
|
interface CenterPlaceSource {
|
|
7
7
|
source: "default" | "geo" | "drag" | "recomend" | "api";
|
|
8
8
|
}
|
|
9
|
-
export interface
|
|
9
|
+
export interface UseLagecyMapRecomendPlace extends Pick<UseMapRecomendPlaceProps<CenterPlaceSource>, "getRecomendPlace"> {
|
|
10
10
|
mapRef: MapShallowRef;
|
|
11
11
|
defaultCenterPoint?: Point;
|
|
12
12
|
geoDefaultPosition?: Point;
|
|
@@ -19,7 +19,7 @@ export interface UseBusinessMapRecomendPlaceProps extends Pick<UseMapRecomendPla
|
|
|
19
19
|
onChangePlace?: UseMapPlaceProps["onChange"];
|
|
20
20
|
onChangeRecomandPlace?: UseMapRecomendPlaceProps["onChange"];
|
|
21
21
|
}
|
|
22
|
-
export declare const
|
|
22
|
+
export declare const useLagecyMapRecomendPlace: (props: UseLagecyMapRecomendPlace) => {
|
|
23
23
|
isDragging: import("vue-demi").Ref<boolean>;
|
|
24
24
|
geoLoading: import("vue-demi").Ref<boolean>;
|
|
25
25
|
geoError: import("vue-demi").Ref<GeolocationPositionError | undefined>;
|