@omnic/widget-locations 1.0.96 → 1.0.98

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.
@@ -1,16 +1,20 @@
1
1
  /// <reference types="react" />
2
2
  import type { CourierDeliveryPoint, CourierPoint } from '../../types/points';
3
+ import type { CourierDetailsModalState } from "./CourierDetailsView.utils";
3
4
  export interface CourierDetailsViewClasses {
4
5
  header?: string;
5
6
  content?: string;
6
7
  }
7
- interface CourierDetailsViewProps {
8
+ export interface CourierDetailsViewMethods {
9
+ submit(): Promise<Nullable<CourierDeliveryPoint>>;
10
+ }
11
+ export interface CourierDetailsViewProps {
8
12
  location: CourierPoint;
9
13
  hideActions?: boolean;
10
14
  classes?: CourierDetailsViewClasses;
11
15
  onClose?: () => void;
12
- onChange?: (location: CourierDeliveryPoint) => void;
16
+ onChange?: (location: CourierDetailsModalState) => void;
13
17
  onSubmit?: (location: CourierDeliveryPoint) => void;
14
18
  }
15
- declare const MemoizedCourierDetailsView: import("react").NamedExoticComponent<CourierDetailsViewProps>;
19
+ declare const MemoizedCourierDetailsView: import("react").MemoExoticComponent<import("react").ForwardRefExoticComponent<CourierDetailsViewProps & import("react").RefAttributes<CourierDetailsViewMethods>>>;
16
20
  export { MemoizedCourierDetailsView as CourierDetailsView };
@@ -1,10 +1,14 @@
1
1
  import type { Reducer } from "react";
2
- import type { CourierDeliveryPoint } from '../../types/points';
3
- type ChangeHandler = (location: CourierDeliveryPoint) => void;
2
+ import type { CourierPoint } from '../../types/points';
3
+ export type CourierDetailsModalState = CourierPoint & {
4
+ comment: string;
5
+ delivery_time: string;
6
+ apartment_number: string;
7
+ };
8
+ type ChangeHandler = (location: CourierDetailsModalState) => void;
4
9
  interface ReducerParams {
5
10
  set?: ChangeHandler;
6
11
  }
7
- export type CourierDetailsModalState = CourierDeliveryPoint;
8
12
  export type CourierDetailsModalAction = {
9
13
  type: "SET_COMMENT";
10
14
  payload: string;
@@ -16,5 +20,5 @@ export type CourierDetailsModalAction = {
16
20
  payload: string;
17
21
  };
18
22
  export declare const createReducer: ({ set }: ReducerParams) => Reducer<CourierDetailsModalState, CourierDetailsModalAction>;
19
- export declare const getStateValid: (state: CourierDetailsModalState) => boolean;
23
+ export declare const getStateValid: (state: Pick<CourierDetailsModalState, "apartment_number" | "delivery_time">) => boolean;
20
24
  export {};
@@ -5,6 +5,7 @@ interface PointSheetProps extends BottomSheetProps {
5
5
  minSnapHeight?: number;
6
6
  hideFooter?: boolean;
7
7
  submitDisabled?: boolean;
8
+ submitLoading?: boolean;
8
9
  onSubmitClick?: () => void;
9
10
  }
10
11
  export declare const PointSheet: FC<PointSheetProps>;
package/dist/lib/index.js CHANGED
@@ -1,5 +1,4 @@
1
1
  window.OMNIC_WIDGET_LOCATIONS_CONFIG = {
2
2
  INN: "7707419906",
3
- logo: "llama",
4
3
  onPointClick: console.log,
5
4
  };