@open-tender/utils 0.0.61 → 0.0.62
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/cjs/hooks/useAddressForm.d.ts +3 -4
- package/dist/cjs/hooks/useAllergenForm.d.ts +2 -3
- package/dist/cjs/hooks/useCartGuestForm.d.ts +3 -4
- package/dist/cjs/hooks/useCheckoutLoginForm.d.ts +3 -4
- package/dist/cjs/hooks/useCreditCard.d.ts +2 -3
- package/dist/cjs/hooks/useDineInForm.d.ts +3 -4
- package/dist/cjs/hooks/useDonationForm.d.ts +5 -4
- package/dist/cjs/hooks/useGiftCardAssignForm.d.ts +3 -4
- package/dist/cjs/hooks/useGiftCardAssignOtherForm.d.ts +3 -4
- package/dist/cjs/hooks/useGiftCardForm.d.ts +3 -4
- package/dist/cjs/hooks/useGiftCardsForm.d.ts +3 -4
- package/dist/cjs/hooks/useGuestForm.d.ts +3 -4
- package/dist/cjs/hooks/useOrderFulfillmentForm.d.ts +2 -3
- package/dist/cjs/hooks/useOrderRatingForm.d.ts +2 -3
- package/dist/cjs/hooks/useProfileForm.d.ts +2 -3
- package/dist/cjs/hooks/useResetPasswordForm.d.ts +3 -4
- package/dist/cjs/hooks/useSendResetForm.d.ts +3 -4
- package/dist/cjs/hooks/useSignUpForm.d.ts +2 -3
- package/dist/cjs/hooks/useSignUpGuestForm.d.ts +3 -4
- package/dist/cjs/hooks/useSigninForm.d.ts +3 -4
- package/dist/esm/hooks/useAddressForm.d.ts +3 -4
- package/dist/esm/hooks/useAllergenForm.d.ts +2 -3
- package/dist/esm/hooks/useCartGuestForm.d.ts +3 -4
- package/dist/esm/hooks/useCheckoutLoginForm.d.ts +3 -4
- package/dist/esm/hooks/useCreditCard.d.ts +2 -3
- package/dist/esm/hooks/useDineInForm.d.ts +3 -4
- package/dist/esm/hooks/useDonationForm.d.ts +5 -4
- package/dist/esm/hooks/useGiftCardAssignForm.d.ts +3 -4
- package/dist/esm/hooks/useGiftCardAssignOtherForm.d.ts +3 -4
- package/dist/esm/hooks/useGiftCardForm.d.ts +3 -4
- package/dist/esm/hooks/useGiftCardsForm.d.ts +3 -4
- package/dist/esm/hooks/useGuestForm.d.ts +3 -4
- package/dist/esm/hooks/useOrderFulfillmentForm.d.ts +2 -3
- package/dist/esm/hooks/useOrderRatingForm.d.ts +2 -3
- package/dist/esm/hooks/useProfileForm.d.ts +2 -3
- package/dist/esm/hooks/useResetPasswordForm.d.ts +3 -4
- package/dist/esm/hooks/useSendResetForm.d.ts +3 -4
- package/dist/esm/hooks/useSignUpForm.d.ts +2 -3
- package/dist/esm/hooks/useSignUpGuestForm.d.ts +3 -4
- package/dist/esm/hooks/useSigninForm.d.ts +3 -4
- package/package.json +1 -1
|
@@ -1,20 +1,19 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { Address, RequestStatus } from '@open-tender/types';
|
|
3
|
-
import { Field } from './types';
|
|
4
3
|
interface AddressFormField {
|
|
5
4
|
label: string;
|
|
6
5
|
name: string;
|
|
7
6
|
type: string;
|
|
8
7
|
required?: boolean;
|
|
9
8
|
}
|
|
10
|
-
export declare const useAddressForm:
|
|
9
|
+
export declare const useAddressForm: (address: Address, loading: RequestStatus, error: any, update: (addressId: number, updatedData: Address, callback: () => void) => void, callback: () => void) => {
|
|
11
10
|
fields: AddressFormField[];
|
|
12
11
|
data: Address;
|
|
13
12
|
errors: any;
|
|
14
13
|
submitting: boolean;
|
|
15
14
|
handleChange: (name: string, type: string, value: string | null, checked: boolean | null) => void;
|
|
16
15
|
handleSubmit: () => void;
|
|
17
|
-
submitRef: import("react").MutableRefObject<
|
|
18
|
-
inputRef: import("react").MutableRefObject<
|
|
16
|
+
submitRef: import("react").MutableRefObject<HTMLButtonElement | null>;
|
|
17
|
+
inputRef: import("react").MutableRefObject<HTMLInputElement | null>;
|
|
19
18
|
};
|
|
20
19
|
export {};
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { Allergen, Allergens } from '@open-tender/types';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
submitRef: import("react").MutableRefObject<SubmitRef | null>;
|
|
3
|
+
export declare const useAllergenForm: (allergens: Allergens, selectedAllergens: Allergens, isLoading: boolean | undefined, error: any, setAllergens: (allergens: Allergens) => void, updateAllergens: (allergen: Partial<Allergen>[]) => void, callback?: () => void) => {
|
|
4
|
+
submitRef: import("react").MutableRefObject<HTMLButtonElement | null>;
|
|
6
5
|
submitting: boolean;
|
|
7
6
|
allergenIds: number[];
|
|
8
7
|
formError: any;
|
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { RequestStatus } from '@open-tender/types';
|
|
3
|
-
import { Field } from './types';
|
|
4
3
|
interface CartGuestFormField {
|
|
5
4
|
label?: string;
|
|
6
5
|
name: string;
|
|
7
6
|
type?: string;
|
|
8
7
|
required?: boolean;
|
|
9
8
|
}
|
|
10
|
-
export declare const useCartGuestForm:
|
|
11
|
-
submitRef: import("react").MutableRefObject<
|
|
12
|
-
inputRef: import("react").MutableRefObject<
|
|
9
|
+
export declare const useCartGuestForm: (loading: RequestStatus, errMsg: string, cartId: number, joinCart: (data: any, callback?: any) => void) => {
|
|
10
|
+
submitRef: import("react").MutableRefObject<HTMLButtonElement | null>;
|
|
11
|
+
inputRef: import("react").MutableRefObject<HTMLInputElement | null>;
|
|
13
12
|
fields: CartGuestFormField[];
|
|
14
13
|
data: {
|
|
15
14
|
cart_id?: number | undefined;
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { LoginData, RequestStatus } from '@open-tender/types';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
inputRef: import("react").MutableRefObject<InputRef | null>;
|
|
3
|
+
export declare const useLoginForm: (loading: RequestStatus, error: any, login: (email?: string, password?: string) => void, callback?: () => void) => {
|
|
4
|
+
submitRef: import("react").MutableRefObject<HTMLButtonElement | null>;
|
|
5
|
+
inputRef: import("react").MutableRefObject<HTMLInputElement | null>;
|
|
7
6
|
data: Partial<LoginData>;
|
|
8
7
|
submitting: boolean;
|
|
9
8
|
handleChange: (name: string, value: string) => void;
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { CardType, CreditCardData, RequestStatus } from '@open-tender/types';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
submitRef: import("react").MutableRefObject<SubmitRef | null>;
|
|
3
|
+
export declare const useCreditCardForm: (loading: RequestStatus, error: any, data: CreditCardData, cardType: CardType, setErrors: (errors: any) => void, addCard: (data: CreditCardData, callback: () => void) => void, callback: () => void, recaptchaKey: string, revenue_center_id: number | null, windowRef?: Window) => {
|
|
4
|
+
submitRef: import("react").MutableRefObject<HTMLButtonElement | null>;
|
|
6
5
|
recaptchaRef: import("react").MutableRefObject<any>;
|
|
7
6
|
data: CreditCardData;
|
|
8
7
|
submitting: boolean;
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { GuestData } from '@open-tender/types';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
inputRef: import("react").MutableRefObject<InputRef | null>;
|
|
3
|
+
export declare const useDineInForm: (initialData: Partial<GuestData> | undefined, submitGuest: (data: any) => void) => {
|
|
4
|
+
submitRef: import("react").MutableRefObject<HTMLButtonElement | null>;
|
|
5
|
+
inputRef: import("react").MutableRefObject<HTMLInputElement | null>;
|
|
7
6
|
data: Partial<GuestData>;
|
|
8
7
|
errMsg: string | null;
|
|
9
8
|
handleChange: (name: string, value: string) => void;
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import { Dispatch } from 'react';
|
|
2
2
|
import { CardType, CreditCard, CreditCardData, CreditCards, Profile, PurchaseDonationRequest, RequestStatus } from '@open-tender/types';
|
|
3
|
-
import { Field } from './types';
|
|
4
3
|
interface CreditCardOption {
|
|
5
4
|
label: string;
|
|
6
5
|
value: unknown;
|
|
6
|
+
name?: string;
|
|
7
|
+
disabled?: boolean;
|
|
7
8
|
}
|
|
8
|
-
export declare const useDonationsForm:
|
|
9
|
-
inputRef: import("react").MutableRefObject<
|
|
10
|
-
submitRef: import("react").MutableRefObject<
|
|
9
|
+
export declare const useDonationsForm: (purchase: (data: PurchaseDonationRequest, callback?: () => void) => void, reset: () => void, setAlert: Dispatch<any>, loading: RequestStatus, error: any, success: boolean, customer?: Partial<Profile>, creditCards?: CreditCards, recaptchaKey?: string, cardData?: CreditCardData, cardType?: CardType, windowref?: Window) => {
|
|
10
|
+
inputRef: import("react").MutableRefObject<HTMLInputElement | null>;
|
|
11
|
+
submitRef: import("react").MutableRefObject<HTMLButtonElement | null>;
|
|
11
12
|
recaptchaRef: import("react").MutableRefObject<any>;
|
|
12
13
|
amount: string | null;
|
|
13
14
|
handleAmount: (value: string) => void;
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { RequestStatus } from '@open-tender/types';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
inputRef: import("react").MutableRefObject<InputRef | null>;
|
|
3
|
+
export declare const useGiftCardAssignForm: (loading: RequestStatus, error: any, assign: (card_number: number, callback: () => void) => void, callback: () => void) => {
|
|
4
|
+
submitRef: import("react").MutableRefObject<HTMLButtonElement | null>;
|
|
5
|
+
inputRef: import("react").MutableRefObject<HTMLInputElement | null>;
|
|
7
6
|
cardNumber: string;
|
|
8
7
|
errors: any;
|
|
9
8
|
submitting: boolean;
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { RequestStatus } from '@open-tender/types';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
inputRef: import("react").MutableRefObject<InputRef | null>;
|
|
3
|
+
export declare const useGiftCardAssignOtherForm: (loading: RequestStatus, error: any, giftCardId: number, assign: (id: number, email: string, callback: () => void) => void, callback: () => void) => {
|
|
4
|
+
submitRef: import("react").MutableRefObject<HTMLButtonElement | null>;
|
|
5
|
+
inputRef: import("react").MutableRefObject<HTMLInputElement | null>;
|
|
7
6
|
email: string;
|
|
8
7
|
errors: any;
|
|
9
8
|
submitting: boolean;
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { CreditCards, CustomerGiftCard, RequestStatus } from '@open-tender/types';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
inputRef: import("react").MutableRefObject<InputRef | null>;
|
|
3
|
+
export declare const useGiftCardForm: (giftCard: CustomerGiftCard, creditCards: CreditCards, loading: RequestStatus, error: any, update: (id: number, data: Partial<CustomerGiftCard>, callback: () => void) => void, add: (data: Partial<CustomerGiftCard>, callback: () => void) => void, callback: () => void) => {
|
|
4
|
+
submitRef: import("react").MutableRefObject<HTMLButtonElement | null>;
|
|
5
|
+
inputRef: import("react").MutableRefObject<HTMLInputElement | null>;
|
|
7
6
|
options: {
|
|
8
7
|
name: string;
|
|
9
8
|
value: number | undefined;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { CardType, CreditCard, CreditCardData, CreditCards, Customer, PurchaseGiftCardData, RequestStatus } from '@open-tender/types';
|
|
3
|
-
import { Field } from './types';
|
|
4
3
|
interface CreditCardOption {
|
|
5
4
|
name: string;
|
|
6
5
|
value?: number;
|
|
@@ -13,12 +12,12 @@ interface PurchaseData {
|
|
|
13
12
|
url: string;
|
|
14
13
|
token?: string;
|
|
15
14
|
}
|
|
16
|
-
export declare const useGiftCardsForm:
|
|
15
|
+
export declare const useGiftCardsForm: (purchase: (data: PurchaseData) => void, reset: () => void, loading: RequestStatus, error: any, success: boolean, setAlert: (data: {
|
|
17
16
|
type: string;
|
|
18
17
|
args?: any;
|
|
19
18
|
}) => void, customer: Partial<Customer> | undefined, creditCards: CreditCards | undefined, recaptchaKey: string | null | undefined, initState: PurchaseGiftCardData, cardData: CreditCardData, cardType: CardType, windowRef?: Window) => {
|
|
20
|
-
inputRef: import("react").MutableRefObject<
|
|
21
|
-
submitRef: import("react").MutableRefObject<
|
|
19
|
+
inputRef: import("react").MutableRefObject<HTMLInputElement | null>;
|
|
20
|
+
submitRef: import("react").MutableRefObject<HTMLButtonElement | null>;
|
|
22
21
|
recaptchaRef: import("react").MutableRefObject<any>;
|
|
23
22
|
creditCardOptions: CreditCardOption[];
|
|
24
23
|
handleName: (value: string) => void;
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { GuestData, RequestStatus } from '@open-tender/types';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
inputRef: import("react").MutableRefObject<TnputRef | null>;
|
|
3
|
+
export declare const useGuestForm: (email: string, loading: RequestStatus, errors: any, checkGuest: (email?: string) => void) => {
|
|
4
|
+
submitRef: import("react").MutableRefObject<HTMLButtonElement | null>;
|
|
5
|
+
inputRef: import("react").MutableRefObject<HTMLInputElement | null>;
|
|
7
6
|
data: Partial<GuestData>;
|
|
8
7
|
errMsg: any;
|
|
9
8
|
submitting: boolean;
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { ConfigFulfillment, OrderFulfillment, RequestStatus } from '@open-tender/types';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
submitRef: import("react").MutableRefObject<SubmitRef | null>;
|
|
3
|
+
export declare const useOrderFulfillmentForm: (orderId: number, fulfillment: Partial<OrderFulfillment>, loading: RequestStatus, error: any, update: (orderId: number, data: Partial<OrderFulfillment>) => void, settings?: ConfigFulfillment, showAllFields?: boolean) => {
|
|
4
|
+
submitRef: import("react").MutableRefObject<HTMLButtonElement | null>;
|
|
6
5
|
fields: import("@open-tender/types").ConfigFulfillmentField[] | undefined;
|
|
7
6
|
data: Partial<OrderFulfillment>;
|
|
8
7
|
errors: any;
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { OrderRating } from '@open-tender/types';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
submitRef: import("react").MutableRefObject<SubmitRef | null>;
|
|
3
|
+
export declare const useOrderRatingForm: (orderId: number, orderRating: OrderRating, updateRating: (orderId: number, rating: Partial<OrderRating>) => void, callback?: () => void) => {
|
|
4
|
+
submitRef: import("react").MutableRefObject<HTMLButtonElement | null>;
|
|
6
5
|
stars: number[];
|
|
7
6
|
rating: number;
|
|
8
7
|
handleRating: (star: number) => void;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { ConfigBrand, Profile, RequestStatus } from '@open-tender/types';
|
|
3
|
-
import { Field } from './types';
|
|
4
3
|
export interface ProfileFormField {
|
|
5
4
|
label: string;
|
|
6
5
|
name: keyof Profile;
|
|
@@ -8,8 +7,8 @@ export interface ProfileFormField {
|
|
|
8
7
|
required?: boolean;
|
|
9
8
|
autoComplete?: string;
|
|
10
9
|
}
|
|
11
|
-
export declare const useProfileForm:
|
|
12
|
-
submitRef: import("react").MutableRefObject<
|
|
10
|
+
export declare const useProfileForm: (profile: Partial<Profile>, loading: RequestStatus, error: any, update: (data: Partial<Profile>) => void, optIns?: Partial<ConfigBrand>) => {
|
|
11
|
+
submitRef: import("react").MutableRefObject<HTMLButtonElement | null>;
|
|
13
12
|
accepts_marketing: import("@open-tender/types").ConfigAcceptMarketing | undefined;
|
|
14
13
|
order_notifications: import("@open-tender/types").ConfigOrderNotifications | undefined;
|
|
15
14
|
data: Partial<Profile>;
|
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { RequestStatus, ResetPasswordData } from '@open-tender/types';
|
|
3
|
-
import { Field } from './types';
|
|
4
3
|
export interface ResetPasswordFormField {
|
|
5
4
|
label: string;
|
|
6
5
|
name: string;
|
|
7
6
|
type: string;
|
|
8
7
|
required?: boolean;
|
|
9
8
|
}
|
|
10
|
-
export declare const useResetPasswordForm:
|
|
11
|
-
submitRef: import("react").MutableRefObject<
|
|
12
|
-
inputRef: import("react").MutableRefObject<
|
|
9
|
+
export declare const useResetPasswordForm: (loading: RequestStatus, error: any, reset: (newPassword: string, callback: () => void) => void, resetForm: () => void, resetToken: () => void) => {
|
|
10
|
+
submitRef: import("react").MutableRefObject<HTMLButtonElement | null>;
|
|
11
|
+
inputRef: import("react").MutableRefObject<HTMLInputElement | null>;
|
|
13
12
|
fields: ResetPasswordFormField[];
|
|
14
13
|
data: Partial<ResetPasswordData>;
|
|
15
14
|
errors: {};
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { RequestStatus } from '@open-tender/types';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
inputRef: import("react").MutableRefObject<InputRef | null>;
|
|
3
|
+
export declare const useSendResetForm: (loading: RequestStatus, error: any, sendReset: (email: string, linkUrl: string) => Promise<void>, callback?: () => void, windowref?: any, linkUrlVal?: string) => {
|
|
4
|
+
submitRef: import("react").MutableRefObject<HTMLButtonElement | null>;
|
|
5
|
+
inputRef: import("react").MutableRefObject<HTMLInputElement | null>;
|
|
7
6
|
data: any;
|
|
8
7
|
errMsg: any;
|
|
9
8
|
handleChange: (name: string, value: string) => void;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { CheckoutConfig, Profile } from '@open-tender/types';
|
|
3
|
-
import { Field } from './types';
|
|
4
3
|
export interface SignUpFormField {
|
|
5
4
|
label?: string;
|
|
6
5
|
name: string;
|
|
@@ -8,8 +7,8 @@ export interface SignUpFormField {
|
|
|
8
7
|
required?: boolean;
|
|
9
8
|
autoComplete?: string;
|
|
10
9
|
}
|
|
11
|
-
export declare const useSignUpForm:
|
|
12
|
-
submitRef: import("react").MutableRefObject<
|
|
10
|
+
export declare const useSignUpForm: (loading: RequestInfo, error: any, signUp: (data: any, callback?: () => void) => void, callback?: () => void, checkConfig?: Partial<CheckoutConfig>, hasThanx?: boolean) => {
|
|
11
|
+
submitRef: import("react").MutableRefObject<HTMLButtonElement | null>;
|
|
13
12
|
data: Partial<Profile>;
|
|
14
13
|
errors: any;
|
|
15
14
|
submitting: boolean;
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { GuestData, RequestStatus } from '@open-tender/types';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
inputRef: import("react").MutableRefObject<InputRef | null>;
|
|
3
|
+
export declare const useSignUpGuestForm: (email: string, guest: Partial<GuestData>, loading: RequestStatus, error: any, signUp: (data: any) => void, submitGuest: (data: Partial<GuestData>) => void, hasThanx?: boolean) => {
|
|
4
|
+
submitRef: import("react").MutableRefObject<HTMLButtonElement | null>;
|
|
5
|
+
inputRef: import("react").MutableRefObject<HTMLInputElement | null>;
|
|
7
6
|
data: {
|
|
8
7
|
first_name?: string | undefined;
|
|
9
8
|
email?: string | undefined;
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { LoginData, RequestStatus } from '@open-tender/types';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
inputRef: import("react").MutableRefObject<InputRef | null>;
|
|
3
|
+
export declare const useSignInForm: (email: string, loading: RequestStatus, error: any, login: (email?: string, password?: string) => void, callback?: () => void) => {
|
|
4
|
+
submitRef: import("react").MutableRefObject<HTMLButtonElement | null>;
|
|
5
|
+
inputRef: import("react").MutableRefObject<HTMLInputElement | null>;
|
|
7
6
|
data: Partial<LoginData>;
|
|
8
7
|
submitting: boolean;
|
|
9
8
|
handleChange: (name: string, value: string) => void;
|
|
@@ -1,20 +1,19 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { Address, RequestStatus } from '@open-tender/types';
|
|
3
|
-
import { Field } from './types';
|
|
4
3
|
interface AddressFormField {
|
|
5
4
|
label: string;
|
|
6
5
|
name: string;
|
|
7
6
|
type: string;
|
|
8
7
|
required?: boolean;
|
|
9
8
|
}
|
|
10
|
-
export declare const useAddressForm:
|
|
9
|
+
export declare const useAddressForm: (address: Address, loading: RequestStatus, error: any, update: (addressId: number, updatedData: Address, callback: () => void) => void, callback: () => void) => {
|
|
11
10
|
fields: AddressFormField[];
|
|
12
11
|
data: Address;
|
|
13
12
|
errors: any;
|
|
14
13
|
submitting: boolean;
|
|
15
14
|
handleChange: (name: string, type: string, value: string | null, checked: boolean | null) => void;
|
|
16
15
|
handleSubmit: () => void;
|
|
17
|
-
submitRef: import("react").MutableRefObject<
|
|
18
|
-
inputRef: import("react").MutableRefObject<
|
|
16
|
+
submitRef: import("react").MutableRefObject<HTMLButtonElement | null>;
|
|
17
|
+
inputRef: import("react").MutableRefObject<HTMLInputElement | null>;
|
|
19
18
|
};
|
|
20
19
|
export {};
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { Allergen, Allergens } from '@open-tender/types';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
submitRef: import("react").MutableRefObject<SubmitRef | null>;
|
|
3
|
+
export declare const useAllergenForm: (allergens: Allergens, selectedAllergens: Allergens, isLoading: boolean | undefined, error: any, setAllergens: (allergens: Allergens) => void, updateAllergens: (allergen: Partial<Allergen>[]) => void, callback?: () => void) => {
|
|
4
|
+
submitRef: import("react").MutableRefObject<HTMLButtonElement | null>;
|
|
6
5
|
submitting: boolean;
|
|
7
6
|
allergenIds: number[];
|
|
8
7
|
formError: any;
|
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { RequestStatus } from '@open-tender/types';
|
|
3
|
-
import { Field } from './types';
|
|
4
3
|
interface CartGuestFormField {
|
|
5
4
|
label?: string;
|
|
6
5
|
name: string;
|
|
7
6
|
type?: string;
|
|
8
7
|
required?: boolean;
|
|
9
8
|
}
|
|
10
|
-
export declare const useCartGuestForm:
|
|
11
|
-
submitRef: import("react").MutableRefObject<
|
|
12
|
-
inputRef: import("react").MutableRefObject<
|
|
9
|
+
export declare const useCartGuestForm: (loading: RequestStatus, errMsg: string, cartId: number, joinCart: (data: any, callback?: any) => void) => {
|
|
10
|
+
submitRef: import("react").MutableRefObject<HTMLButtonElement | null>;
|
|
11
|
+
inputRef: import("react").MutableRefObject<HTMLInputElement | null>;
|
|
13
12
|
fields: CartGuestFormField[];
|
|
14
13
|
data: {
|
|
15
14
|
cart_id?: number | undefined;
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { LoginData, RequestStatus } from '@open-tender/types';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
inputRef: import("react").MutableRefObject<InputRef | null>;
|
|
3
|
+
export declare const useLoginForm: (loading: RequestStatus, error: any, login: (email?: string, password?: string) => void, callback?: () => void) => {
|
|
4
|
+
submitRef: import("react").MutableRefObject<HTMLButtonElement | null>;
|
|
5
|
+
inputRef: import("react").MutableRefObject<HTMLInputElement | null>;
|
|
7
6
|
data: Partial<LoginData>;
|
|
8
7
|
submitting: boolean;
|
|
9
8
|
handleChange: (name: string, value: string) => void;
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { CardType, CreditCardData, RequestStatus } from '@open-tender/types';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
submitRef: import("react").MutableRefObject<SubmitRef | null>;
|
|
3
|
+
export declare const useCreditCardForm: (loading: RequestStatus, error: any, data: CreditCardData, cardType: CardType, setErrors: (errors: any) => void, addCard: (data: CreditCardData, callback: () => void) => void, callback: () => void, recaptchaKey: string, revenue_center_id: number | null, windowRef?: Window) => {
|
|
4
|
+
submitRef: import("react").MutableRefObject<HTMLButtonElement | null>;
|
|
6
5
|
recaptchaRef: import("react").MutableRefObject<any>;
|
|
7
6
|
data: CreditCardData;
|
|
8
7
|
submitting: boolean;
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { GuestData } from '@open-tender/types';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
inputRef: import("react").MutableRefObject<InputRef | null>;
|
|
3
|
+
export declare const useDineInForm: (initialData: Partial<GuestData> | undefined, submitGuest: (data: any) => void) => {
|
|
4
|
+
submitRef: import("react").MutableRefObject<HTMLButtonElement | null>;
|
|
5
|
+
inputRef: import("react").MutableRefObject<HTMLInputElement | null>;
|
|
7
6
|
data: Partial<GuestData>;
|
|
8
7
|
errMsg: string | null;
|
|
9
8
|
handleChange: (name: string, value: string) => void;
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import { Dispatch } from 'react';
|
|
2
2
|
import { CardType, CreditCard, CreditCardData, CreditCards, Profile, PurchaseDonationRequest, RequestStatus } from '@open-tender/types';
|
|
3
|
-
import { Field } from './types';
|
|
4
3
|
interface CreditCardOption {
|
|
5
4
|
label: string;
|
|
6
5
|
value: unknown;
|
|
6
|
+
name?: string;
|
|
7
|
+
disabled?: boolean;
|
|
7
8
|
}
|
|
8
|
-
export declare const useDonationsForm:
|
|
9
|
-
inputRef: import("react").MutableRefObject<
|
|
10
|
-
submitRef: import("react").MutableRefObject<
|
|
9
|
+
export declare const useDonationsForm: (purchase: (data: PurchaseDonationRequest, callback?: () => void) => void, reset: () => void, setAlert: Dispatch<any>, loading: RequestStatus, error: any, success: boolean, customer?: Partial<Profile>, creditCards?: CreditCards, recaptchaKey?: string, cardData?: CreditCardData, cardType?: CardType, windowref?: Window) => {
|
|
10
|
+
inputRef: import("react").MutableRefObject<HTMLInputElement | null>;
|
|
11
|
+
submitRef: import("react").MutableRefObject<HTMLButtonElement | null>;
|
|
11
12
|
recaptchaRef: import("react").MutableRefObject<any>;
|
|
12
13
|
amount: string | null;
|
|
13
14
|
handleAmount: (value: string) => void;
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { RequestStatus } from '@open-tender/types';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
inputRef: import("react").MutableRefObject<InputRef | null>;
|
|
3
|
+
export declare const useGiftCardAssignForm: (loading: RequestStatus, error: any, assign: (card_number: number, callback: () => void) => void, callback: () => void) => {
|
|
4
|
+
submitRef: import("react").MutableRefObject<HTMLButtonElement | null>;
|
|
5
|
+
inputRef: import("react").MutableRefObject<HTMLInputElement | null>;
|
|
7
6
|
cardNumber: string;
|
|
8
7
|
errors: any;
|
|
9
8
|
submitting: boolean;
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { RequestStatus } from '@open-tender/types';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
inputRef: import("react").MutableRefObject<InputRef | null>;
|
|
3
|
+
export declare const useGiftCardAssignOtherForm: (loading: RequestStatus, error: any, giftCardId: number, assign: (id: number, email: string, callback: () => void) => void, callback: () => void) => {
|
|
4
|
+
submitRef: import("react").MutableRefObject<HTMLButtonElement | null>;
|
|
5
|
+
inputRef: import("react").MutableRefObject<HTMLInputElement | null>;
|
|
7
6
|
email: string;
|
|
8
7
|
errors: any;
|
|
9
8
|
submitting: boolean;
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { CreditCards, CustomerGiftCard, RequestStatus } from '@open-tender/types';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
inputRef: import("react").MutableRefObject<InputRef | null>;
|
|
3
|
+
export declare const useGiftCardForm: (giftCard: CustomerGiftCard, creditCards: CreditCards, loading: RequestStatus, error: any, update: (id: number, data: Partial<CustomerGiftCard>, callback: () => void) => void, add: (data: Partial<CustomerGiftCard>, callback: () => void) => void, callback: () => void) => {
|
|
4
|
+
submitRef: import("react").MutableRefObject<HTMLButtonElement | null>;
|
|
5
|
+
inputRef: import("react").MutableRefObject<HTMLInputElement | null>;
|
|
7
6
|
options: {
|
|
8
7
|
name: string;
|
|
9
8
|
value: number | undefined;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { CardType, CreditCard, CreditCardData, CreditCards, Customer, PurchaseGiftCardData, RequestStatus } from '@open-tender/types';
|
|
3
|
-
import { Field } from './types';
|
|
4
3
|
interface CreditCardOption {
|
|
5
4
|
name: string;
|
|
6
5
|
value?: number;
|
|
@@ -13,12 +12,12 @@ interface PurchaseData {
|
|
|
13
12
|
url: string;
|
|
14
13
|
token?: string;
|
|
15
14
|
}
|
|
16
|
-
export declare const useGiftCardsForm:
|
|
15
|
+
export declare const useGiftCardsForm: (purchase: (data: PurchaseData) => void, reset: () => void, loading: RequestStatus, error: any, success: boolean, setAlert: (data: {
|
|
17
16
|
type: string;
|
|
18
17
|
args?: any;
|
|
19
18
|
}) => void, customer: Partial<Customer> | undefined, creditCards: CreditCards | undefined, recaptchaKey: string | null | undefined, initState: PurchaseGiftCardData, cardData: CreditCardData, cardType: CardType, windowRef?: Window) => {
|
|
20
|
-
inputRef: import("react").MutableRefObject<
|
|
21
|
-
submitRef: import("react").MutableRefObject<
|
|
19
|
+
inputRef: import("react").MutableRefObject<HTMLInputElement | null>;
|
|
20
|
+
submitRef: import("react").MutableRefObject<HTMLButtonElement | null>;
|
|
22
21
|
recaptchaRef: import("react").MutableRefObject<any>;
|
|
23
22
|
creditCardOptions: CreditCardOption[];
|
|
24
23
|
handleName: (value: string) => void;
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { GuestData, RequestStatus } from '@open-tender/types';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
inputRef: import("react").MutableRefObject<TnputRef | null>;
|
|
3
|
+
export declare const useGuestForm: (email: string, loading: RequestStatus, errors: any, checkGuest: (email?: string) => void) => {
|
|
4
|
+
submitRef: import("react").MutableRefObject<HTMLButtonElement | null>;
|
|
5
|
+
inputRef: import("react").MutableRefObject<HTMLInputElement | null>;
|
|
7
6
|
data: Partial<GuestData>;
|
|
8
7
|
errMsg: any;
|
|
9
8
|
submitting: boolean;
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { ConfigFulfillment, OrderFulfillment, RequestStatus } from '@open-tender/types';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
submitRef: import("react").MutableRefObject<SubmitRef | null>;
|
|
3
|
+
export declare const useOrderFulfillmentForm: (orderId: number, fulfillment: Partial<OrderFulfillment>, loading: RequestStatus, error: any, update: (orderId: number, data: Partial<OrderFulfillment>) => void, settings?: ConfigFulfillment, showAllFields?: boolean) => {
|
|
4
|
+
submitRef: import("react").MutableRefObject<HTMLButtonElement | null>;
|
|
6
5
|
fields: import("@open-tender/types").ConfigFulfillmentField[] | undefined;
|
|
7
6
|
data: Partial<OrderFulfillment>;
|
|
8
7
|
errors: any;
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { OrderRating } from '@open-tender/types';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
submitRef: import("react").MutableRefObject<SubmitRef | null>;
|
|
3
|
+
export declare const useOrderRatingForm: (orderId: number, orderRating: OrderRating, updateRating: (orderId: number, rating: Partial<OrderRating>) => void, callback?: () => void) => {
|
|
4
|
+
submitRef: import("react").MutableRefObject<HTMLButtonElement | null>;
|
|
6
5
|
stars: number[];
|
|
7
6
|
rating: number;
|
|
8
7
|
handleRating: (star: number) => void;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { ConfigBrand, Profile, RequestStatus } from '@open-tender/types';
|
|
3
|
-
import { Field } from './types';
|
|
4
3
|
export interface ProfileFormField {
|
|
5
4
|
label: string;
|
|
6
5
|
name: keyof Profile;
|
|
@@ -8,8 +7,8 @@ export interface ProfileFormField {
|
|
|
8
7
|
required?: boolean;
|
|
9
8
|
autoComplete?: string;
|
|
10
9
|
}
|
|
11
|
-
export declare const useProfileForm:
|
|
12
|
-
submitRef: import("react").MutableRefObject<
|
|
10
|
+
export declare const useProfileForm: (profile: Partial<Profile>, loading: RequestStatus, error: any, update: (data: Partial<Profile>) => void, optIns?: Partial<ConfigBrand>) => {
|
|
11
|
+
submitRef: import("react").MutableRefObject<HTMLButtonElement | null>;
|
|
13
12
|
accepts_marketing: import("@open-tender/types").ConfigAcceptMarketing | undefined;
|
|
14
13
|
order_notifications: import("@open-tender/types").ConfigOrderNotifications | undefined;
|
|
15
14
|
data: Partial<Profile>;
|
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { RequestStatus, ResetPasswordData } from '@open-tender/types';
|
|
3
|
-
import { Field } from './types';
|
|
4
3
|
export interface ResetPasswordFormField {
|
|
5
4
|
label: string;
|
|
6
5
|
name: string;
|
|
7
6
|
type: string;
|
|
8
7
|
required?: boolean;
|
|
9
8
|
}
|
|
10
|
-
export declare const useResetPasswordForm:
|
|
11
|
-
submitRef: import("react").MutableRefObject<
|
|
12
|
-
inputRef: import("react").MutableRefObject<
|
|
9
|
+
export declare const useResetPasswordForm: (loading: RequestStatus, error: any, reset: (newPassword: string, callback: () => void) => void, resetForm: () => void, resetToken: () => void) => {
|
|
10
|
+
submitRef: import("react").MutableRefObject<HTMLButtonElement | null>;
|
|
11
|
+
inputRef: import("react").MutableRefObject<HTMLInputElement | null>;
|
|
13
12
|
fields: ResetPasswordFormField[];
|
|
14
13
|
data: Partial<ResetPasswordData>;
|
|
15
14
|
errors: {};
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { RequestStatus } from '@open-tender/types';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
inputRef: import("react").MutableRefObject<InputRef | null>;
|
|
3
|
+
export declare const useSendResetForm: (loading: RequestStatus, error: any, sendReset: (email: string, linkUrl: string) => Promise<void>, callback?: () => void, windowref?: any, linkUrlVal?: string) => {
|
|
4
|
+
submitRef: import("react").MutableRefObject<HTMLButtonElement | null>;
|
|
5
|
+
inputRef: import("react").MutableRefObject<HTMLInputElement | null>;
|
|
7
6
|
data: any;
|
|
8
7
|
errMsg: any;
|
|
9
8
|
handleChange: (name: string, value: string) => void;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { CheckoutConfig, Profile } from '@open-tender/types';
|
|
3
|
-
import { Field } from './types';
|
|
4
3
|
export interface SignUpFormField {
|
|
5
4
|
label?: string;
|
|
6
5
|
name: string;
|
|
@@ -8,8 +7,8 @@ export interface SignUpFormField {
|
|
|
8
7
|
required?: boolean;
|
|
9
8
|
autoComplete?: string;
|
|
10
9
|
}
|
|
11
|
-
export declare const useSignUpForm:
|
|
12
|
-
submitRef: import("react").MutableRefObject<
|
|
10
|
+
export declare const useSignUpForm: (loading: RequestInfo, error: any, signUp: (data: any, callback?: () => void) => void, callback?: () => void, checkConfig?: Partial<CheckoutConfig>, hasThanx?: boolean) => {
|
|
11
|
+
submitRef: import("react").MutableRefObject<HTMLButtonElement | null>;
|
|
13
12
|
data: Partial<Profile>;
|
|
14
13
|
errors: any;
|
|
15
14
|
submitting: boolean;
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { GuestData, RequestStatus } from '@open-tender/types';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
inputRef: import("react").MutableRefObject<InputRef | null>;
|
|
3
|
+
export declare const useSignUpGuestForm: (email: string, guest: Partial<GuestData>, loading: RequestStatus, error: any, signUp: (data: any) => void, submitGuest: (data: Partial<GuestData>) => void, hasThanx?: boolean) => {
|
|
4
|
+
submitRef: import("react").MutableRefObject<HTMLButtonElement | null>;
|
|
5
|
+
inputRef: import("react").MutableRefObject<HTMLInputElement | null>;
|
|
7
6
|
data: {
|
|
8
7
|
first_name?: string | undefined;
|
|
9
8
|
email?: string | undefined;
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { LoginData, RequestStatus } from '@open-tender/types';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
inputRef: import("react").MutableRefObject<InputRef | null>;
|
|
3
|
+
export declare const useSignInForm: (email: string, loading: RequestStatus, error: any, login: (email?: string, password?: string) => void, callback?: () => void) => {
|
|
4
|
+
submitRef: import("react").MutableRefObject<HTMLButtonElement | null>;
|
|
5
|
+
inputRef: import("react").MutableRefObject<HTMLInputElement | null>;
|
|
7
6
|
data: Partial<LoginData>;
|
|
8
7
|
submitting: boolean;
|
|
9
8
|
handleChange: (name: string, value: string) => void;
|
package/package.json
CHANGED