@majoo-ui/react 1.62.2 → 1.62.4

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@majoo-ui/react",
3
- "version": "1.62.2",
3
+ "version": "1.62.4",
4
4
  "main": "./index.esm.js",
5
5
  "exports": {
6
6
  ".": {
@@ -6,7 +6,6 @@ import 'leaflet-defaulticon-compatibility';
6
6
  declare function MapPicker(props: MapPickerProps): JSX.Element;
7
7
  declare namespace MapPicker {
8
8
  var defaultProps: {
9
- showBanner: boolean;
10
9
  value: {
11
10
  lat: number;
12
11
  lng: number;
@@ -0,0 +1,7 @@
1
+ /// <reference types="react" />
2
+ import { ISearch } from '../types';
3
+ interface AddressCardProps {
4
+ place: ISearch;
5
+ }
6
+ export declare function AddressCard({ place }: AddressCardProps): JSX.Element;
7
+ export {};
@@ -0,0 +1,7 @@
1
+ /// <reference types="react" />
2
+ interface ButtonSelectProps {
3
+ onClick: () => void;
4
+ label?: string;
5
+ }
6
+ export declare function ButtonSelect({ onClick, label }: ButtonSelectProps): JSX.Element;
7
+ export {};
@@ -0,0 +1,10 @@
1
+ interface ChangeViewProps {
2
+ center: [number, number];
3
+ readOnly?: boolean;
4
+ onDragEnd: (latLng: {
5
+ lat: number;
6
+ lng: number;
7
+ }) => void;
8
+ }
9
+ export declare function ChangeView({ center, readOnly, onDragEnd }: ChangeViewProps): null;
10
+ export {};
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ import { InputSearchProps } from '../types';
3
+ export declare function InputSearch({ placeholder, value, list, onChange, onSelect }: InputSearchProps): JSX.Element;
@@ -0,0 +1,2 @@
1
+ /// <reference types="react" />
2
+ export declare function MarkerIcon(): JSX.Element;
@@ -0,0 +1,2 @@
1
+ /// <reference types="react" />
2
+ export declare function MarkerSvg(): JSX.Element;
@@ -0,0 +1,7 @@
1
+ /// <reference types="react" />
2
+ interface ZoomControlsProps {
3
+ onZoomIn: () => void;
4
+ onZoomOut: () => void;
5
+ }
6
+ export declare function ZoomControls({ onZoomIn, onZoomOut }: ZoomControlsProps): JSX.Element;
7
+ export {};
@@ -0,0 +1,7 @@
1
+ export { InputSearch } from './InputSearch';
2
+ export { ButtonSelect } from './ButtonSelect';
3
+ export { MarkerIcon } from './MarkerIcon';
4
+ export { ZoomControls } from './ZoomControls';
5
+ export { AddressCard } from './AddressCard';
6
+ export { ChangeView } from './ChangeView';
7
+ export { MarkerSvg } from './MarkerSvg';
@@ -0,0 +1,39 @@
1
+ /// <reference types="react" />
2
+ import { ISearch } from '../types';
3
+ interface UseMapSearchOptions {
4
+ initialCenter?: {
5
+ lat: number;
6
+ lng: number;
7
+ };
8
+ showSelectButton?: boolean;
9
+ onChange?: (mapObject: any, shouldClose: boolean) => void;
10
+ }
11
+ interface UseMapSearchReturn {
12
+ center: {
13
+ lat: number;
14
+ lng: number;
15
+ };
16
+ setCenter: React.Dispatch<React.SetStateAction<{
17
+ lat: number;
18
+ lng: number;
19
+ }>>;
20
+ places: ISearch[];
21
+ searchQuery: string;
22
+ searchResult: ISearch[];
23
+ handleSearchChange: (e: {
24
+ target: {
25
+ value: string;
26
+ };
27
+ }) => void;
28
+ handleSearchSelect: (item: ISearch) => Promise<void>;
29
+ handleSearchLatLng: (latLng: {
30
+ lat: number;
31
+ lng: number;
32
+ }) => Promise<void>;
33
+ getFullAddress: (latLng: {
34
+ lat: number;
35
+ lng: number;
36
+ }) => Promise<any>;
37
+ }
38
+ export declare function useMapSearch({ initialCenter, showSelectButton, onChange, }: UseMapSearchOptions): UseMapSearchReturn;
39
+ export {};
@@ -1,3 +1,4 @@
1
+ import React from 'react';
1
2
  import { CSS } from '../../../config/stitches.config';
2
3
  export interface AddressComponents {
3
4
  long_name: string;
@@ -21,13 +22,9 @@ export interface MapPickerProps {
21
22
  */
22
23
  css?: CSS;
23
24
  /**
24
- * State to show or hide the banner.
25
+ * Header content to display above the map (e.g., Banner).
25
26
  */
26
- showBanner?: boolean;
27
- /**
28
- * Custom banner description.
29
- */
30
- bannerDescription?: string;
27
+ header?: React.ReactNode;
31
28
  /**
32
29
  * To binding current address.
33
30
  * `{ lat: number, lng: number }`
@@ -36,11 +33,7 @@ export interface MapPickerProps {
36
33
  /**
37
34
  * Change event handler.
38
35
  */
39
- onChange: (MapObject: any) => void;
40
- /**
41
- * Marker Click event handler.
42
- */
43
- onMarkerClick?: () => void;
36
+ onChange?: (MapObject: any) => void;
44
37
  /**
45
38
  * Custom radius.
46
39
  */
@@ -49,12 +42,20 @@ export interface MapPickerProps {
49
42
  * on Show select button.
50
43
  */
51
44
  showSelectButton?: boolean;
52
- }
53
- export interface InputMapPickerProps {
54
45
  /**
55
- * Additional css styles.
46
+ * Make map view-only (hide search, disable dragging).
56
47
  */
57
- css?: CSS;
48
+ readOnly?: boolean;
49
+ /**
50
+ * Custom text for select location button.
51
+ */
52
+ selectLocationText?: string;
53
+ /**
54
+ * Custom placeholder for search input.
55
+ */
56
+ searchPlaceholder?: string;
57
+ }
58
+ export interface InputMapPickerProps extends MapPickerProps {
58
59
  /**
59
60
  * Custom title of the modal.
60
61
  */
@@ -67,37 +68,28 @@ export interface InputMapPickerProps {
67
68
  * Custom InputMap placeholder.
68
69
  */
69
70
  placeholder?: string;
70
- /**
71
- * State to show or hide the banner.
72
- */
73
- showBanner?: boolean;
74
- /**
75
- * Custom banner description.
76
- */
77
- bannerDescription?: string;
78
- /**
79
- * To binding current address.
80
- * `{ lat: number, lng: number }`
81
- */
82
- value?: LatLng;
83
- /**
84
- * Change event handler.
85
- */
86
- onChange: (MapObject: any) => void;
87
- /**
88
- * on Marker click event handle
89
- */
90
- onMarkerClick: () => void;
91
- /**
92
- * Custom radius.
93
- */
94
- radius?: number;
95
- /**
96
- * on Show select button.
97
- */
98
- showSelectButton?: boolean;
99
71
  /**
100
72
  * Custom input value.
101
73
  */
102
74
  customInputValue?: string;
103
75
  }
76
+ /**
77
+ * Search result from OpenStreetMap Nominatim API.
78
+ */
79
+ export interface ISearch {
80
+ place_id: number;
81
+ lat: string;
82
+ lon: string;
83
+ display_name: string;
84
+ address?: Record<string, string>;
85
+ }
86
+ /**
87
+ * Props for InputSearch component.
88
+ */
89
+ export interface InputSearchProps {
90
+ placeholder: string;
91
+ value: string;
92
+ onChange: (e: React.ChangeEvent<HTMLInputElement>) => void;
93
+ onSelect: (item: ISearch) => void;
94
+ list: ISearch[];
95
+ }