@open-tender/utils 0.0.60 → 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 -4
- package/dist/cjs/hooks/useAllergenForm.js +2 -1
- package/dist/cjs/hooks/useCartGuestForm.d.ts +4 -5
- package/dist/cjs/hooks/useCartGuestForm.js +2 -1
- package/dist/cjs/hooks/useCheckoutLoginForm.d.ts +3 -5
- package/dist/cjs/hooks/useCheckoutLoginForm.js +2 -1
- package/dist/cjs/hooks/useCreditCard.d.ts +2 -4
- package/dist/cjs/hooks/useCreditCard.js +2 -1
- package/dist/cjs/hooks/useCurbside.d.ts +1 -2
- package/dist/cjs/hooks/useCurbside.js +2 -1
- package/dist/cjs/hooks/useDineInForm.d.ts +3 -5
- package/dist/cjs/hooks/useDineInForm.js +2 -1
- package/dist/cjs/hooks/useDonationForm.d.ts +6 -5
- package/dist/cjs/hooks/useDonationForm.js +2 -1
- package/dist/cjs/hooks/useGiftCardAssignForm.d.ts +3 -5
- package/dist/cjs/hooks/useGiftCardAssignForm.js +2 -1
- package/dist/cjs/hooks/useGiftCardAssignOtherForm.d.ts +3 -5
- package/dist/cjs/hooks/useGiftCardAssignOtherForm.js +2 -1
- package/dist/cjs/hooks/useGiftCardForm.d.ts +3 -5
- package/dist/cjs/hooks/useGiftCardForm.js +2 -1
- package/dist/cjs/hooks/useGiftCardsForm.d.ts +4 -5
- package/dist/cjs/hooks/useGiftCardsForm.js +2 -1
- package/dist/cjs/hooks/useGuestForm.d.ts +3 -5
- package/dist/cjs/hooks/useGuestForm.js +2 -1
- package/dist/cjs/hooks/useOrderFulfillmentForm.d.ts +2 -4
- package/dist/cjs/hooks/useOrderFulfillmentForm.js +2 -1
- package/dist/cjs/hooks/useOrderRating.d.ts +1 -2
- package/dist/cjs/hooks/useOrderRating.js +3 -2
- package/dist/cjs/hooks/useOrderRatingForm.d.ts +2 -4
- package/dist/cjs/hooks/useOrderRatingForm.js +2 -1
- package/dist/cjs/hooks/useProfileForm.d.ts +3 -5
- package/dist/cjs/hooks/useProfileForm.js +2 -1
- package/dist/cjs/hooks/useResetPasswordForm.d.ts +4 -6
- package/dist/cjs/hooks/useResetPasswordForm.js +2 -1
- package/dist/cjs/hooks/useSendResetForm.d.ts +3 -5
- package/dist/cjs/hooks/useSendResetForm.js +2 -1
- package/dist/cjs/hooks/useSignUpForm.d.ts +3 -5
- package/dist/cjs/hooks/useSignUpForm.js +2 -1
- package/dist/cjs/hooks/useSignUpGuestForm.d.ts +3 -5
- package/dist/cjs/hooks/useSignUpGuestForm.js +2 -1
- package/dist/cjs/hooks/useSigninForm.d.ts +3 -5
- package/dist/cjs/hooks/useSigninForm.js +2 -1
- package/dist/esm/hooks/useAddressForm.d.ts +3 -4
- package/dist/esm/hooks/useAllergenForm.d.ts +2 -4
- package/dist/esm/hooks/useAllergenForm.js +1 -2
- package/dist/esm/hooks/useCartGuestForm.d.ts +4 -5
- package/dist/esm/hooks/useCartGuestForm.js +1 -2
- package/dist/esm/hooks/useCheckoutLoginForm.d.ts +3 -5
- package/dist/esm/hooks/useCheckoutLoginForm.js +1 -2
- package/dist/esm/hooks/useCreditCard.d.ts +2 -4
- package/dist/esm/hooks/useCreditCard.js +1 -2
- package/dist/esm/hooks/useCurbside.d.ts +1 -2
- package/dist/esm/hooks/useCurbside.js +1 -2
- package/dist/esm/hooks/useDineInForm.d.ts +3 -5
- package/dist/esm/hooks/useDineInForm.js +1 -2
- package/dist/esm/hooks/useDonationForm.d.ts +6 -5
- package/dist/esm/hooks/useDonationForm.js +1 -2
- package/dist/esm/hooks/useGiftCardAssignForm.d.ts +3 -5
- package/dist/esm/hooks/useGiftCardAssignForm.js +1 -2
- package/dist/esm/hooks/useGiftCardAssignOtherForm.d.ts +3 -5
- package/dist/esm/hooks/useGiftCardAssignOtherForm.js +1 -2
- package/dist/esm/hooks/useGiftCardForm.d.ts +3 -5
- package/dist/esm/hooks/useGiftCardForm.js +1 -2
- package/dist/esm/hooks/useGiftCardsForm.d.ts +4 -5
- package/dist/esm/hooks/useGiftCardsForm.js +1 -2
- package/dist/esm/hooks/useGuestForm.d.ts +3 -5
- package/dist/esm/hooks/useGuestForm.js +1 -2
- package/dist/esm/hooks/useOrderFulfillmentForm.d.ts +2 -4
- package/dist/esm/hooks/useOrderFulfillmentForm.js +1 -2
- package/dist/esm/hooks/useOrderRating.d.ts +1 -2
- package/dist/esm/hooks/useOrderRating.js +1 -2
- package/dist/esm/hooks/useOrderRatingForm.d.ts +2 -4
- package/dist/esm/hooks/useOrderRatingForm.js +1 -2
- package/dist/esm/hooks/useProfileForm.d.ts +3 -5
- package/dist/esm/hooks/useProfileForm.js +1 -2
- package/dist/esm/hooks/useResetPasswordForm.d.ts +4 -6
- package/dist/esm/hooks/useResetPasswordForm.js +1 -2
- package/dist/esm/hooks/useSendResetForm.d.ts +3 -5
- package/dist/esm/hooks/useSendResetForm.js +1 -2
- package/dist/esm/hooks/useSignUpForm.d.ts +3 -5
- package/dist/esm/hooks/useSignUpForm.js +1 -2
- package/dist/esm/hooks/useSignUpGuestForm.d.ts +3 -5
- package/dist/esm/hooks/useSignUpGuestForm.js +1 -2
- package/dist/esm/hooks/useSigninForm.d.ts +3 -5
- package/dist/esm/hooks/useSigninForm.js +1 -2
- 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,12 +1,10 @@
|
|
|
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;
|
|
9
8
|
handleChange: (name: string, checked?: boolean) => void;
|
|
10
9
|
handleSubmit: () => void;
|
|
11
10
|
};
|
|
12
|
-
export default useAllergenForm;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useAllergenForm = void 0;
|
|
3
4
|
const react_1 = require("react");
|
|
4
5
|
const useAllergenForm = (allergens, selectedAllergens, isLoading = false, error = null, setAllergens, updateAllergens, callback) => {
|
|
5
6
|
const submitRef = (0, react_1.useRef)(null);
|
|
@@ -45,4 +46,4 @@ const useAllergenForm = (allergens, selectedAllergens, isLoading = false, error
|
|
|
45
46
|
handleSubmit,
|
|
46
47
|
};
|
|
47
48
|
};
|
|
48
|
-
exports.
|
|
49
|
+
exports.useAllergenForm = useAllergenForm;
|
|
@@ -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
|
-
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;
|
|
@@ -18,4 +17,4 @@ declare const useCartGuestForm: <InputRef extends Field, SubmitRef extends Field
|
|
|
18
17
|
handleChange: (name: string, value: string) => void;
|
|
19
18
|
handleSubmit: () => void;
|
|
20
19
|
};
|
|
21
|
-
export
|
|
20
|
+
export {};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useCartGuestForm = void 0;
|
|
3
4
|
const react_1 = require("react");
|
|
4
5
|
const useCartGuestForm = (loading, errMsg, cartId, joinCart) => {
|
|
5
6
|
const submitRef = (0, react_1.useRef)(null);
|
|
@@ -43,4 +44,4 @@ const useCartGuestForm = (loading, errMsg, cartId, joinCart) => {
|
|
|
43
44
|
handleSubmit,
|
|
44
45
|
};
|
|
45
46
|
};
|
|
46
|
-
exports.
|
|
47
|
+
exports.useCartGuestForm = useCartGuestForm;
|
|
@@ -1,12 +1,10 @@
|
|
|
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;
|
|
10
9
|
handleSubmit: () => void;
|
|
11
10
|
};
|
|
12
|
-
export default useLoginForm;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useLoginForm = void 0;
|
|
3
4
|
const react_1 = require("react");
|
|
4
5
|
const useLoginForm = (loading, error, login, callback) => {
|
|
5
6
|
const submitRef = (0, react_1.useRef)(null);
|
|
@@ -38,4 +39,4 @@ const useLoginForm = (loading, error, login, callback) => {
|
|
|
38
39
|
handleSubmit,
|
|
39
40
|
};
|
|
40
41
|
};
|
|
41
|
-
exports.
|
|
42
|
+
exports.useLoginForm = useLoginForm;
|
|
@@ -1,11 +1,9 @@
|
|
|
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;
|
|
9
8
|
handleSubmit: () => void;
|
|
10
9
|
};
|
|
11
|
-
export default useCreditCardForm;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useCreditCardForm = void 0;
|
|
3
4
|
const react_1 = require("react");
|
|
4
5
|
const utils_1 = require("@open-tender/utils");
|
|
5
6
|
const useCreditCardForm = (loading, error, data, cardType, setErrors, addCard, callback, recaptchaKey, revenue_center_id, windowRef) => {
|
|
@@ -70,4 +71,4 @@ const useCreditCardForm = (loading, error, data, cardType, setErrors, addCard, c
|
|
|
70
71
|
handleSubmit,
|
|
71
72
|
};
|
|
72
73
|
};
|
|
73
|
-
exports.
|
|
74
|
+
exports.useCreditCardForm = useCreditCardForm;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ConfigFulfillment, OrderFulfillment, RequestStatus } from '@open-tender/types';
|
|
2
|
-
declare const useCurbside: (orderId: number, fulfillment: Partial<OrderFulfillment>, loading: RequestStatus, error: any, update: (orderId: number, data: Partial<OrderFulfillment>) => void, settings?: ConfigFulfillment, showAllFields?: boolean) => {
|
|
2
|
+
export declare const useCurbside: (orderId: number, fulfillment: Partial<OrderFulfillment>, loading: RequestStatus, error: any, update: (orderId: number, data: Partial<OrderFulfillment>) => void, settings?: ConfigFulfillment, showAllFields?: boolean) => {
|
|
3
3
|
fields: import("@open-tender/types").ConfigFulfillmentField[] | undefined;
|
|
4
4
|
data: Partial<OrderFulfillment>;
|
|
5
5
|
errors: any;
|
|
@@ -7,4 +7,3 @@ declare const useCurbside: (orderId: number, fulfillment: Partial<OrderFulfillme
|
|
|
7
7
|
handleChange: (name: keyof OrderFulfillment, value: string) => void;
|
|
8
8
|
handleSubmit: () => void;
|
|
9
9
|
};
|
|
10
|
-
export default useCurbside;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useCurbside = void 0;
|
|
3
4
|
const react_1 = require("react");
|
|
4
5
|
const utils_1 = require("../utils");
|
|
5
6
|
const useCurbside = (orderId, fulfillment, loading, error, update, settings, showAllFields = false) => {
|
|
@@ -34,4 +35,4 @@ const useCurbside = (orderId, fulfillment, loading, error, update, settings, sho
|
|
|
34
35
|
handleSubmit,
|
|
35
36
|
};
|
|
36
37
|
};
|
|
37
|
-
exports.
|
|
38
|
+
exports.useCurbside = useCurbside;
|
|
@@ -1,12 +1,10 @@
|
|
|
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;
|
|
10
9
|
handleSubmit: () => void;
|
|
11
10
|
};
|
|
12
|
-
export default useDineInForm;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useDineInForm = void 0;
|
|
3
4
|
const react_1 = require("react");
|
|
4
5
|
const useDineInForm = (initialData = {}, submitGuest) => {
|
|
5
6
|
const submitRef = (0, react_1.useRef)(null);
|
|
@@ -28,4 +29,4 @@ const useDineInForm = (initialData = {}, submitGuest) => {
|
|
|
28
29
|
handleSubmit,
|
|
29
30
|
};
|
|
30
31
|
};
|
|
31
|
-
exports.
|
|
32
|
+
exports.useDineInForm = useDineInForm;
|
|
@@ -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
|
-
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;
|
|
@@ -25,4 +26,4 @@ declare const useDonationsForm: <InputRef extends Field, SubmitRef extends Field
|
|
|
25
26
|
handleReset: () => void;
|
|
26
27
|
setErrors: Dispatch<any>;
|
|
27
28
|
};
|
|
28
|
-
export
|
|
29
|
+
export {};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useDonationsForm = void 0;
|
|
3
4
|
const react_1 = require("react");
|
|
4
5
|
const utils_1 = require("../utils");
|
|
5
6
|
const useDonationsForm = (purchase, reset, setAlert, loading, error, success, customer, creditCards, recaptchaKey, cardData, cardType, windowref) => {
|
|
@@ -166,4 +167,4 @@ const useDonationsForm = (purchase, reset, setAlert, loading, error, success, cu
|
|
|
166
167
|
setErrors,
|
|
167
168
|
};
|
|
168
169
|
};
|
|
169
|
-
exports.
|
|
170
|
+
exports.useDonationsForm = useDonationsForm;
|
|
@@ -1,13 +1,11 @@
|
|
|
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;
|
|
10
9
|
handleChange: (value: string) => void;
|
|
11
10
|
handleSubmit: () => void;
|
|
12
11
|
};
|
|
13
|
-
export default useGiftCardAssignForm;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useGiftCardAssignForm = void 0;
|
|
3
4
|
const react_1 = require("react");
|
|
4
5
|
const useGiftCardAssignForm = (loading, error, assign, callback) => {
|
|
5
6
|
const submitRef = (0, react_1.useRef)(null);
|
|
@@ -43,4 +44,4 @@ const useGiftCardAssignForm = (loading, error, assign, callback) => {
|
|
|
43
44
|
handleSubmit,
|
|
44
45
|
};
|
|
45
46
|
};
|
|
46
|
-
exports.
|
|
47
|
+
exports.useGiftCardAssignForm = useGiftCardAssignForm;
|
|
@@ -1,13 +1,11 @@
|
|
|
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;
|
|
10
9
|
handleChange: (value: string) => void;
|
|
11
10
|
handleSubmit: () => void;
|
|
12
11
|
};
|
|
13
|
-
export default useGiftCardAssignOtherForm;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useGiftCardAssignOtherForm = void 0;
|
|
3
4
|
const react_1 = require("react");
|
|
4
5
|
const useGiftCardAssignOtherForm = (loading, error, giftCardId, assign, callback) => {
|
|
5
6
|
const submitRef = (0, react_1.useRef)(null);
|
|
@@ -36,4 +37,4 @@ const useGiftCardAssignOtherForm = (loading, error, giftCardId, assign, callback
|
|
|
36
37
|
handleSubmit,
|
|
37
38
|
};
|
|
38
39
|
};
|
|
39
|
-
exports.
|
|
40
|
+
exports.useGiftCardAssignOtherForm = useGiftCardAssignOtherForm;
|
|
@@ -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;
|
|
@@ -14,4 +13,3 @@ declare const useGiftCardForm: <InputRef extends Field, SubmitRef extends Field>
|
|
|
14
13
|
handleChange: (name: number, type: string, value: string | null, checked: boolean | null) => void;
|
|
15
14
|
handleSubmit: () => void;
|
|
16
15
|
};
|
|
17
|
-
export default useGiftCardForm;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useGiftCardForm = void 0;
|
|
3
4
|
const react_1 = require("react");
|
|
4
5
|
const useGiftCardForm = (giftCard, creditCards, loading, error, update, add, callback) => {
|
|
5
6
|
const submitRef = (0, react_1.useRef)(null);
|
|
@@ -54,4 +55,4 @@ const useGiftCardForm = (giftCard, creditCards, loading, error, update, add, cal
|
|
|
54
55
|
handleSubmit,
|
|
55
56
|
};
|
|
56
57
|
};
|
|
57
|
-
exports.
|
|
58
|
+
exports.useGiftCardForm = useGiftCardForm;
|
|
@@ -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
|
-
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;
|
|
@@ -39,4 +38,4 @@ declare const useGiftCardsForm: <InputRef extends Field, SubmitRef extends Field
|
|
|
39
38
|
errors: {};
|
|
40
39
|
submitting: boolean;
|
|
41
40
|
};
|
|
42
|
-
export
|
|
41
|
+
export {};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useGiftCardsForm = void 0;
|
|
3
4
|
const react_1 = require("react");
|
|
4
5
|
const utils_1 = require("@open-tender/utils");
|
|
5
6
|
const useGiftCardsForm = (purchase, reset, loading, error, success, setAlert, customer = {}, creditCards = [], recaptchaKey = null, initState, cardData, cardType, windowRef) => {
|
|
@@ -184,4 +185,4 @@ const useGiftCardsForm = (purchase, reset, loading, error, success, setAlert, cu
|
|
|
184
185
|
submitting,
|
|
185
186
|
};
|
|
186
187
|
};
|
|
187
|
-
exports.
|
|
188
|
+
exports.useGiftCardsForm = useGiftCardsForm;
|
|
@@ -1,13 +1,11 @@
|
|
|
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;
|
|
10
9
|
handleChange: (name: string, value: string) => void;
|
|
11
10
|
handleSubmit: () => void;
|
|
12
11
|
};
|
|
13
|
-
export default useGuestForm;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useGuestForm = void 0;
|
|
3
4
|
const react_1 = require("react");
|
|
4
5
|
const useGuestForm = (email, loading, errors, checkGuest) => {
|
|
5
6
|
const submitRef = (0, react_1.useRef)(null);
|
|
@@ -38,4 +39,4 @@ const useGuestForm = (email, loading, errors, checkGuest) => {
|
|
|
38
39
|
handleSubmit,
|
|
39
40
|
};
|
|
40
41
|
};
|
|
41
|
-
exports.
|
|
42
|
+
exports.useGuestForm = useGuestForm;
|
|
@@ -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;
|
|
@@ -10,4 +9,3 @@ declare const useOrderFulfillmentForm: <SubmitRef extends Field>(orderId: number
|
|
|
10
9
|
handleChange: (name: string, type: string, value: string | null, checked: boolean | null) => void;
|
|
11
10
|
handleSubmit: () => void;
|
|
12
11
|
};
|
|
13
|
-
export default useOrderFulfillmentForm;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useOrderFulfillmentForm = void 0;
|
|
3
4
|
const react_1 = require("react");
|
|
4
5
|
const useOrderFulfillmentForm = (orderId, fulfillment, loading, error, update, settings, showAllFields = false) => {
|
|
5
6
|
const submitRef = (0, react_1.useRef)(null);
|
|
@@ -37,4 +38,4 @@ const useOrderFulfillmentForm = (orderId, fulfillment, loading, error, update, s
|
|
|
37
38
|
handleSubmit,
|
|
38
39
|
};
|
|
39
40
|
};
|
|
40
|
-
exports.
|
|
41
|
+
exports.useOrderFulfillmentForm = useOrderFulfillmentForm;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { OrderRating } from '@open-tender/types';
|
|
2
|
-
declare const
|
|
2
|
+
export declare const useOrderRating: (orderId: number, orderRating: OrderRating, updateRating: (id: number, data: Partial<OrderRating>) => void) => {
|
|
3
3
|
rating: number;
|
|
4
4
|
handleRating: (star: number) => void;
|
|
5
5
|
comments: string;
|
|
@@ -8,4 +8,3 @@ declare const useOrderRatingForm: (orderId: number, orderRating: OrderRating, up
|
|
|
8
8
|
handleClose: () => void;
|
|
9
9
|
stars: number[];
|
|
10
10
|
};
|
|
11
|
-
export default useOrderRatingForm;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useOrderRating = void 0;
|
|
3
4
|
const react_1 = require("react");
|
|
4
|
-
const
|
|
5
|
+
const useOrderRating = (orderId, orderRating, updateRating) => {
|
|
5
6
|
const [rating, setRating] = (0, react_1.useState)((orderRating && orderRating.rating) || 0);
|
|
6
7
|
const [comments, setComments] = (0, react_1.useState)((orderRating && orderRating.comments) || '');
|
|
7
8
|
const stars = [1, 2, 3, 4, 5];
|
|
@@ -29,4 +30,4 @@ const useOrderRatingForm = (orderId, orderRating, updateRating) => {
|
|
|
29
30
|
stars,
|
|
30
31
|
};
|
|
31
32
|
};
|
|
32
|
-
exports.
|
|
33
|
+
exports.useOrderRating = useOrderRating;
|
|
@@ -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;
|
|
@@ -10,4 +9,3 @@ declare const useOrderRatingForm: <SubmitRef extends Field>(orderId: number, ord
|
|
|
10
9
|
handleComments: (value: string) => void;
|
|
11
10
|
handleSubmit: () => void;
|
|
12
11
|
};
|
|
13
|
-
export default useOrderRatingForm;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useOrderRatingForm = void 0;
|
|
3
4
|
const react_1 = require("react");
|
|
4
5
|
const useOrderRatingForm = (orderId, orderRating, updateRating, callback) => {
|
|
5
6
|
const submitRef = (0, react_1.useRef)(null);
|
|
@@ -30,4 +31,4 @@ const useOrderRatingForm = (orderId, orderRating, updateRating, callback) => {
|
|
|
30
31
|
handleSubmit,
|
|
31
32
|
};
|
|
32
33
|
};
|
|
33
|
-
exports.
|
|
34
|
+
exports.useOrderRatingForm = useOrderRatingForm;
|
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { ConfigBrand, Profile, RequestStatus } from '@open-tender/types';
|
|
3
|
-
|
|
4
|
-
interface ProfileFormField {
|
|
3
|
+
export interface ProfileFormField {
|
|
5
4
|
label: string;
|
|
6
5
|
name: keyof Profile;
|
|
7
6
|
type: string;
|
|
8
7
|
required?: boolean;
|
|
9
8
|
autoComplete?: string;
|
|
10
9
|
}
|
|
11
|
-
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>;
|
|
@@ -21,4 +20,3 @@ declare const useProfileForm: <SubmitRef extends Field>(profile: Partial<Profile
|
|
|
21
20
|
handleRadio: (name: string, value: string) => void;
|
|
22
21
|
handleSubmit: () => void;
|
|
23
22
|
};
|
|
24
|
-
export default useProfileForm;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useProfileForm = void 0;
|
|
3
4
|
const react_1 = require("react");
|
|
4
5
|
const utils_1 = require("../utils");
|
|
5
6
|
const useProfileForm = (profile, loading, error, update, optIns = {}) => {
|
|
@@ -71,4 +72,4 @@ const useProfileForm = (profile, loading, error, update, optIns = {}) => {
|
|
|
71
72
|
handleSubmit,
|
|
72
73
|
};
|
|
73
74
|
};
|
|
74
|
-
exports.
|
|
75
|
+
exports.useProfileForm = useProfileForm;
|
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { RequestStatus, ResetPasswordData } from '@open-tender/types';
|
|
3
|
-
|
|
4
|
-
interface ResetPasswordFormField {
|
|
3
|
+
export interface ResetPasswordFormField {
|
|
5
4
|
label: string;
|
|
6
5
|
name: string;
|
|
7
6
|
type: string;
|
|
8
7
|
required?: boolean;
|
|
9
8
|
}
|
|
10
|
-
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: {};
|
|
@@ -17,4 +16,3 @@ declare const useResetPasswordForm: <InputRef extends Field, SubmitRef extends F
|
|
|
17
16
|
handleChange: (name: string, value: string) => void;
|
|
18
17
|
handleSubmit: () => void;
|
|
19
18
|
};
|
|
20
|
-
export default useResetPasswordForm;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useResetPasswordForm = void 0;
|
|
3
4
|
const react_1 = require("react");
|
|
4
5
|
const useResetPasswordForm = (loading, error, reset, resetForm, resetToken) => {
|
|
5
6
|
const submitRef = (0, react_1.useRef)(null);
|
|
@@ -63,4 +64,4 @@ const useResetPasswordForm = (loading, error, reset, resetForm, resetToken) => {
|
|
|
63
64
|
handleSubmit,
|
|
64
65
|
};
|
|
65
66
|
};
|
|
66
|
-
exports.
|
|
67
|
+
exports.useResetPasswordForm = useResetPasswordForm;
|
|
@@ -1,12 +1,10 @@
|
|
|
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;
|
|
10
9
|
handleSubmit: () => void;
|
|
11
10
|
};
|
|
12
|
-
export default useSendResetForm;
|