@omnic/widget-locations 1.1.80 → 1.1.82
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/lib/components/PlaceAutocomplete/PlaceAutocomplete.d.ts +16 -1
- package/dist/lib/components/PlaceAutocomplete/index.d.ts +1 -0
- package/dist/lib/context/WidgetLocations/components/MapPlaceholder/MapPlaceholder.d.ts +3 -1
- package/dist/lib/context/WidgetLocations/components/MapPlaceholder/index.d.ts +1 -0
- package/dist/lib/context/WidgetLocations/components/MapPlaceholder/types.d.ts +4 -0
- package/dist/lib/context/WidgetLocations/type.d.ts +4 -2
- package/dist/lib/index.d.ts +2 -0
- package/dist/lib/widget.cjs.js +21 -21
- package/dist/lib/widget.esm.js +599 -594
- package/package.json +2 -2
|
@@ -1,5 +1,18 @@
|
|
|
1
|
-
import type { FC, ReactNode, RefObject } from "react";
|
|
1
|
+
import type { ChangeEvent, FC, ReactNode, RefObject } from "react";
|
|
2
2
|
import type { UsePlaceAutocompleteReturn } from '../../hooks/usePlaceAutocomplete';
|
|
3
|
+
/** Props passed to custom input when using render prop. */
|
|
4
|
+
export interface PlaceAutocompleteInputProps {
|
|
5
|
+
value: string;
|
|
6
|
+
onChange: (event: ChangeEvent<HTMLInputElement>) => void;
|
|
7
|
+
inputRef?: RefObject<HTMLInputElement>;
|
|
8
|
+
onFocus?: () => void;
|
|
9
|
+
onBlur?: () => void;
|
|
10
|
+
onClick?: () => void;
|
|
11
|
+
placeholder?: string;
|
|
12
|
+
name?: string;
|
|
13
|
+
label?: string;
|
|
14
|
+
endAdornment?: ReactNode;
|
|
15
|
+
}
|
|
3
16
|
interface PlaceAutocompleteProps {
|
|
4
17
|
autocomplete: UsePlaceAutocompleteReturn;
|
|
5
18
|
className?: string;
|
|
@@ -11,6 +24,8 @@ interface PlaceAutocompleteProps {
|
|
|
11
24
|
onClick?: () => void;
|
|
12
25
|
onFocus?: () => void;
|
|
13
26
|
onBlur?: () => void;
|
|
27
|
+
/** Custom input. If not provided, default Input is used. */
|
|
28
|
+
children?: (props: PlaceAutocompleteInputProps) => ReactNode;
|
|
14
29
|
}
|
|
15
30
|
export declare const PlaceAutocomplete: FC<PlaceAutocompleteProps>;
|
|
16
31
|
export {};
|
|
@@ -1,17 +1,19 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import type { WidgetConfig, WidgetOptions } from '../../types/config';
|
|
3
|
+
import type { Locale } from '../../types/i18n';
|
|
3
4
|
import type { LocationPoint } from '../../types/points';
|
|
4
5
|
export type OnSamePointsClick = (data: LocationPoint[]) => void;
|
|
5
6
|
export interface LaunchConfig {
|
|
6
7
|
options: WidgetOptions;
|
|
7
8
|
config: WidgetConfig;
|
|
8
9
|
}
|
|
9
|
-
export type
|
|
10
|
+
export type MapPlaceholderConfig = Pick<WidgetConfig, "cityName" | "country" | "countryAbbreviation" | "disableDelivery" | "disableGeolocation" | "globalSearch" | "handlers" | "hideCloseButtonOnLocationScreen" | "hideDeliveryTime" | "hideDetails" | "hideFilters" | "hideHeader" | "hideLogo" | "hideMapControls" | "hideSearchInput" | "onCloseLocationSelector" | "onLocationSelect" | "onPointClick" | "onSamePointsClusterClick" | "onWarehouseSelect" | "warehouseSelection" | "skipPointInfo" | "regionName" | "inputs" | "startScreen">;
|
|
10
11
|
export interface WidgetLocationsContextValue {
|
|
11
12
|
widgetOutHolderRef: React.RefObject<HTMLDivElement>;
|
|
12
13
|
widgetLocationsRef: React.RefObject<HTMLDivElement>;
|
|
13
14
|
launchWidget: (params: LaunchConfig) => void;
|
|
14
|
-
|
|
15
|
+
setLocale: (locale: Locale) => void;
|
|
16
|
+
setMapPlaceholderConfig: (config: MapPlaceholderConfig | undefined) => void;
|
|
15
17
|
}
|
|
16
18
|
export interface WidgetLocationsContextProps {
|
|
17
19
|
children: React.ReactNode;
|
package/dist/lib/index.d.ts
CHANGED
|
@@ -14,3 +14,5 @@ export * from "./types/points";
|
|
|
14
14
|
export * from "./types/regions";
|
|
15
15
|
export * from "./context/WidgetLocations";
|
|
16
16
|
export * from "./context/WidgetLocations/components/MapPlaceholder";
|
|
17
|
+
export * from "./components/PlaceAutocomplete";
|
|
18
|
+
export * from "./hooks/usePlaceAutocomplete";
|