@arkyn/components 3.0.1-beta.103 → 3.0.1-beta.104
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/bundle.js +734 -717
- package/dist/bundle.umd.cjs +15 -15
- package/dist/components/mapView/index.d.ts +7 -5
- package/dist/components/mapView/index.d.ts.map +1 -1
- package/dist/components/mapView/index.js +10 -3
- package/dist/components/searchPlaces.d.ts.map +1 -1
- package/dist/components/searchPlaces.js +0 -1
- package/package.json +1 -1
|
@@ -1,12 +1,14 @@
|
|
|
1
|
-
import { HtmlHTMLAttributes } from "react";
|
|
1
|
+
import { HtmlHTMLAttributes, ReactNode } from "react";
|
|
2
2
|
import "./styles.css";
|
|
3
|
+
type Coordinate = {
|
|
4
|
+
lat: number;
|
|
5
|
+
lng: number;
|
|
6
|
+
children?: ReactNode;
|
|
7
|
+
};
|
|
3
8
|
type MapViewProps = {
|
|
4
9
|
zoom?: number;
|
|
5
10
|
draggable?: boolean;
|
|
6
|
-
coordinates?:
|
|
7
|
-
lat: number;
|
|
8
|
-
lng: number;
|
|
9
|
-
};
|
|
11
|
+
coordinates?: Coordinate | Coordinate[];
|
|
10
12
|
} & HtmlHTMLAttributes<HTMLDivElement>;
|
|
11
13
|
declare function MapView(props: MapViewProps): import("react/jsx-runtime").JSX.Element;
|
|
12
14
|
export { MapView };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/mapView/index.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,kBAAkB,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/mapView/index.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,kBAAkB,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEtD,OAAO,cAAc,CAAC;AAEtB,KAAK,UAAU,GAAG;IAChB,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB,CAAC;AAEF,KAAK,YAAY,GAAG;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,WAAW,CAAC,EAAE,UAAU,GAAG,UAAU,EAAE,CAAC;CACzC,GAAG,kBAAkB,CAAC,cAAc,CAAC,CAAC;AAEvC,iBAAS,OAAO,CAAC,KAAK,EAAE,YAAY,2CAqDnC;AAED,OAAO,EAAE,OAAO,EAAE,CAAC"}
|
|
@@ -4,13 +4,20 @@ import { MapPinned } from "lucide-react";
|
|
|
4
4
|
import "./styles.css";
|
|
5
5
|
function MapView(props) {
|
|
6
6
|
const { coordinates, zoom = 18, draggable = false, className, ...rest } = props;
|
|
7
|
-
|
|
7
|
+
function hasValidCoordinates() {
|
|
8
|
+
if (Array.isArray(coordinates) && coordinates.length <= 0)
|
|
9
|
+
return false;
|
|
10
|
+
if (!coordinates)
|
|
11
|
+
return false;
|
|
12
|
+
return true;
|
|
13
|
+
}
|
|
14
|
+
if (!hasValidCoordinates()) {
|
|
8
15
|
return (_jsx("div", { className: "arkynMapViewPinnedEmpty " + className, ...rest, children: _jsx(MapPinned, {}) }));
|
|
9
16
|
}
|
|
10
|
-
return (_jsx("div", { className: "arkynMapViewPinned " + className, ...rest, children: _jsx(Map, { zoom: zoom, center: coordinates, mapContainerStyle: {
|
|
17
|
+
return (_jsx("div", { className: "arkynMapViewPinned " + className, ...rest, children: _jsx(Map, { zoom: zoom, center: Array.isArray(coordinates) ? coordinates[0] : coordinates, mapContainerStyle: {
|
|
11
18
|
borderRadius: "8px",
|
|
12
19
|
width: "100%",
|
|
13
20
|
height: "100%",
|
|
14
|
-
}, children: _jsx(Marker, { draggable: draggable, position: coordinates }) }) }));
|
|
21
|
+
}, children: Array.isArray(coordinates) ? (coordinates.map((coordinate, index) => (_jsx(Marker, { draggable: draggable, position: coordinate, children: coordinate.children }, index)))) : (_jsx(Marker, { draggable: draggable, position: coordinates, children: coordinates?.children })) }) }));
|
|
15
22
|
}
|
|
16
23
|
export { MapView };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"searchPlaces.d.ts","sourceRoot":"","sources":["../../src/components/searchPlaces.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,wBAAwB,CAAC;AAEvE,OAAO,EAAE,GAAG,EAAY,MAAM,OAAO,CAAC;AACtC,OAAO,EAAS,UAAU,EAAE,MAAM,SAAS,CAAC;AAY5C;;;;;;GAMG;AACH,KAAK,iBAAiB,GAAG;IACvB,OAAO,CAAC,EAAE,wBAAwB,CAAC,SAAS,CAAC,CAAC;IAC9C,QAAQ,CAAC,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IAC/B,cAAc,CAAC,EAAE,CAAC,CAAC,EAAE;QACnB,MAAM,EAAE,MAAM,CAAC;QACf,IAAI,EAAE,MAAM,CAAC;QACb,KAAK,EAAE,MAAM,CAAC;QACd,YAAY,EAAE,MAAM,CAAC;QACrB,UAAU,EAAE,MAAM,CAAC;QACnB,cAAc,EAAE,MAAM,CAAC;QACvB,YAAY,EAAE,MAAM,CAAC;QACrB,WAAW,EAAE;YAAE,GAAG,EAAE,MAAM,CAAC;YAAC,GAAG,EAAE,MAAM,CAAA;SAAE,CAAC;KAC3C,KAAK,IAAI,CAAC;CACZ,GAAG,IAAI,CAAC,UAAU,EAAE,QAAQ,GAAG,UAAU,GAAG,MAAM,CAAC,CAAC;AAErD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AAEH,iBAAS,YAAY,CAAC,KAAK,EAAE,iBAAiB,GAAG,GAAG,CAAC,OAAO,
|
|
1
|
+
{"version":3,"file":"searchPlaces.d.ts","sourceRoot":"","sources":["../../src/components/searchPlaces.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,wBAAwB,CAAC;AAEvE,OAAO,EAAE,GAAG,EAAY,MAAM,OAAO,CAAC;AACtC,OAAO,EAAS,UAAU,EAAE,MAAM,SAAS,CAAC;AAY5C;;;;;;GAMG;AACH,KAAK,iBAAiB,GAAG;IACvB,OAAO,CAAC,EAAE,wBAAwB,CAAC,SAAS,CAAC,CAAC;IAC9C,QAAQ,CAAC,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IAC/B,cAAc,CAAC,EAAE,CAAC,CAAC,EAAE;QACnB,MAAM,EAAE,MAAM,CAAC;QACf,IAAI,EAAE,MAAM,CAAC;QACb,KAAK,EAAE,MAAM,CAAC;QACd,YAAY,EAAE,MAAM,CAAC;QACrB,UAAU,EAAE,MAAM,CAAC;QACnB,cAAc,EAAE,MAAM,CAAC;QACvB,YAAY,EAAE,MAAM,CAAC;QACrB,WAAW,EAAE;YAAE,GAAG,EAAE,MAAM,CAAC;YAAC,GAAG,EAAE,MAAM,CAAA;SAAE,CAAC;KAC3C,KAAK,IAAI,CAAC;CACZ,GAAG,IAAI,CAAC,UAAU,EAAE,QAAQ,GAAG,UAAU,GAAG,MAAM,CAAC,CAAC;AAErD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AAEH,iBAAS,YAAY,CAAC,KAAK,EAAE,iBAAiB,GAAG,GAAG,CAAC,OAAO,CAmF3D;AAED,OAAO,EAAE,YAAY,EAAE,CAAC"}
|
|
@@ -51,7 +51,6 @@ function SearchPlaces(props) {
|
|
|
51
51
|
const places = searchBox?.getPlaces();
|
|
52
52
|
const place = places ? places[0] : null;
|
|
53
53
|
const address_components = place?.address_components;
|
|
54
|
-
console.log(address_components);
|
|
55
54
|
function findData(key) {
|
|
56
55
|
const data = address_components.find((item) => item.types[0] === key);
|
|
57
56
|
if (data)
|