@open-tender/utils 0.4.31 → 0.4.32
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/LICENSE.md +21 -21
- package/README.md +2 -2
- package/dist/cjs/__tests__/utils/helpers.test.d.ts +1 -1
- package/dist/cjs/__tests__/utils/helpers.test.js +96 -96
- package/dist/cjs/__tests__/utils/theme.test.d.ts +1 -1
- package/dist/cjs/__tests__/utils/theme.test.js +37 -37
- package/dist/cjs/hooks/index.d.ts +35 -35
- package/dist/cjs/hooks/index.js +38 -38
- package/dist/cjs/hooks/types.d.ts +4 -4
- package/dist/cjs/hooks/types.js +2 -2
- package/dist/cjs/hooks/useAccordion.d.ts +22 -22
- package/dist/cjs/hooks/useAccordion.js +56 -56
- package/dist/cjs/hooks/useAddressForm.d.ts +12 -12
- package/dist/cjs/hooks/useAddressForm.js +83 -83
- package/dist/cjs/hooks/useAllergenForm.d.ts +10 -10
- package/dist/cjs/hooks/useAllergenForm.js +58 -58
- package/dist/cjs/hooks/useBuilder.d.ts +14 -14
- package/dist/cjs/hooks/useBuilder.js +144 -144
- package/dist/cjs/hooks/useCartGuestForm.d.ts +12 -12
- package/dist/cjs/hooks/useCartGuestForm.js +58 -58
- package/dist/cjs/hooks/useCartPoints.d.ts +13 -13
- package/dist/cjs/hooks/useCartPoints.js +74 -74
- package/dist/cjs/hooks/useCommunicationPreferences.js +1 -1
- package/dist/cjs/hooks/useCreditCard.d.ts +13 -13
- package/dist/cjs/hooks/useCreditCard.js +63 -63
- package/dist/cjs/hooks/useCreditCardForm.d.ts +10 -10
- package/dist/cjs/hooks/useCreditCardForm.js +71 -71
- package/dist/cjs/hooks/useCurbside.d.ts +9 -9
- package/dist/cjs/hooks/useCurbside.js +39 -39
- package/dist/cjs/hooks/useDineInForm.d.ts +11 -11
- package/dist/cjs/hooks/useDineInForm.js +56 -56
- package/dist/cjs/hooks/useDonationForm.d.ts +28 -28
- package/dist/cjs/hooks/useDonationForm.js +172 -172
- package/dist/cjs/hooks/useFirstTimes.d.ts +18 -18
- package/dist/cjs/hooks/useFirstTimes.js +81 -81
- package/dist/cjs/hooks/useGiftCardAssignForm.d.ts +14 -14
- package/dist/cjs/hooks/useGiftCardAssignForm.js +57 -57
- package/dist/cjs/hooks/useGiftCardAssignOtherForm.d.ts +14 -14
- package/dist/cjs/hooks/useGiftCardAssignOtherForm.js +50 -50
- package/dist/cjs/hooks/useGiftCardForm.d.ts +12 -12
- package/dist/cjs/hooks/useGiftCardForm.js +74 -74
- package/dist/cjs/hooks/useGiftCardsForm.d.ts +31 -31
- package/dist/cjs/hooks/useGiftCardsForm.js +195 -195
- package/dist/cjs/hooks/useGuestCheckoutForm.d.ts +21 -21
- package/dist/cjs/hooks/useGuestCheckoutForm.js +89 -89
- package/dist/cjs/hooks/useGuestForm.d.ts +12 -12
- package/dist/cjs/hooks/useGuestForm.js +60 -60
- package/dist/cjs/hooks/useImage.d.ts +5 -5
- package/dist/cjs/hooks/useImage.js +33 -33
- package/dist/cjs/hooks/useLoginForm.d.ts +12 -12
- package/dist/cjs/hooks/useLoginForm.js +67 -67
- package/dist/cjs/hooks/useMenuItem.d.ts +57 -57
- package/dist/cjs/hooks/useMenuItem.js +67 -67
- package/dist/cjs/hooks/useModifier.d.ts +53 -53
- package/dist/cjs/hooks/useModifier.js +72 -72
- package/dist/cjs/hooks/useModifierGroup.d.ts +15 -15
- package/dist/cjs/hooks/useModifierGroup.js +17 -17
- package/dist/cjs/hooks/useOneTimePasscodeForm.d.ts +16 -16
- package/dist/cjs/hooks/useOneTimePasscodeForm.js +87 -87
- package/dist/cjs/hooks/useOrderFulfillmentForm.d.ts +11 -11
- package/dist/cjs/hooks/useOrderFulfillmentForm.js +65 -65
- package/dist/cjs/hooks/useOrderItem.d.ts +48 -48
- package/dist/cjs/hooks/useOrderItem.js +54 -54
- package/dist/cjs/hooks/useOrderRating.d.ts +10 -10
- package/dist/cjs/hooks/useOrderRating.js +34 -34
- package/dist/cjs/hooks/useOrderRatingForm.d.ts +11 -11
- package/dist/cjs/hooks/useOrderRatingForm.js +35 -35
- package/dist/cjs/hooks/useProfileForm.d.ts +15 -15
- package/dist/cjs/hooks/useProfileForm.js +116 -116
- package/dist/cjs/hooks/useResetPasswordForm.d.ts +12 -12
- package/dist/cjs/hooks/useResetPasswordForm.js +77 -77
- package/dist/cjs/hooks/useSendResetForm.d.ts +14 -14
- package/dist/cjs/hooks/useSendResetForm.js +57 -57
- package/dist/cjs/hooks/useSignUpForm.d.ts +20 -20
- package/dist/cjs/hooks/useSignUpForm.js +151 -151
- package/dist/cjs/hooks/useSignUpGuestForm.d.ts +23 -23
- package/dist/cjs/hooks/useSignUpGuestForm.js +122 -113
- package/dist/cjs/hooks/useSigninForm.d.ts +12 -12
- package/dist/cjs/hooks/useSigninForm.js +66 -66
- package/dist/cjs/index.d.ts +2 -2
- package/dist/cjs/index.js +5 -5
- package/dist/cjs/utils/cards.d.ts +20 -20
- package/dist/cjs/utils/cards.js +155 -155
- package/dist/cjs/utils/cart.d.ts +202 -202
- package/dist/cjs/utils/cart.js +909 -909
- package/dist/cjs/utils/checkout.d.ts +55 -55
- package/dist/cjs/utils/checkout.js +125 -125
- package/dist/cjs/utils/constants.d.ts +43 -43
- package/dist/cjs/utils/constants.js +58 -58
- package/dist/cjs/utils/customer.d.ts +4 -4
- package/dist/cjs/utils/customer.js +34 -34
- package/dist/cjs/utils/datetimes.d.ts +99 -99
- package/dist/cjs/utils/datetimes.js +601 -601
- package/dist/cjs/utils/errors.d.ts +51 -51
- package/dist/cjs/utils/errors.js +191 -191
- package/dist/cjs/utils/favorites.d.ts +10 -10
- package/dist/cjs/utils/favorites.js +119 -119
- package/dist/cjs/utils/googleMaps.d.ts +14 -14
- package/dist/cjs/utils/googleMaps.js +30 -30
- package/dist/cjs/utils/helpers.d.ts +63 -63
- package/dist/cjs/utils/helpers.js +244 -244
- package/dist/cjs/utils/index.d.ts +19 -19
- package/dist/cjs/utils/index.js +23 -23
- package/dist/cjs/utils/keypad.d.ts +9 -9
- package/dist/cjs/utils/keypad.js +105 -105
- package/dist/cjs/utils/maps.d.ts +226 -226
- package/dist/cjs/utils/maps.js +334 -334
- package/dist/cjs/utils/menu.d.ts +117 -117
- package/dist/cjs/utils/menu.js +82 -82
- package/dist/cjs/utils/orders.d.ts +21 -21
- package/dist/cjs/utils/orders.js +202 -202
- package/dist/cjs/utils/pizzaBuilder.d.ts +10 -10
- package/dist/cjs/utils/pizzaBuilder.js +43 -43
- package/dist/cjs/utils/refunds.d.ts +35 -35
- package/dist/cjs/utils/refunds.js +98 -98
- package/dist/cjs/utils/revenueCenters.d.ts +11 -11
- package/dist/cjs/utils/revenueCenters.js +125 -125
- package/dist/cjs/utils/rewards.d.ts +4 -4
- package/dist/cjs/utils/rewards.js +106 -106
- package/dist/cjs/utils/theme.d.ts +27 -27
- package/dist/cjs/utils/theme.js +266 -266
- package/dist/cjs/utils/version.d.ts +4 -4
- package/dist/cjs/utils/version.js +38 -38
- package/dist/esm/__tests__/utils/helpers.test.d.ts +1 -1
- package/dist/esm/__tests__/utils/helpers.test.js +94 -94
- package/dist/esm/__tests__/utils/theme.test.d.ts +1 -1
- package/dist/esm/__tests__/utils/theme.test.js +35 -35
- package/dist/esm/hooks/index.d.ts +35 -35
- package/dist/esm/hooks/index.js +35 -35
- package/dist/esm/hooks/types.d.ts +4 -4
- package/dist/esm/hooks/types.js +1 -1
- package/dist/esm/hooks/useAccordion.d.ts +22 -22
- package/dist/esm/hooks/useAccordion.js +52 -52
- package/dist/esm/hooks/useAddressForm.d.ts +12 -12
- package/dist/esm/hooks/useAddressForm.js +79 -79
- package/dist/esm/hooks/useAllergenForm.d.ts +10 -10
- package/dist/esm/hooks/useAllergenForm.js +54 -54
- package/dist/esm/hooks/useBuilder.d.ts +14 -14
- package/dist/esm/hooks/useBuilder.js +140 -140
- package/dist/esm/hooks/useCartGuestForm.d.ts +12 -12
- package/dist/esm/hooks/useCartGuestForm.js +54 -54
- package/dist/esm/hooks/useCartPoints.d.ts +13 -13
- package/dist/esm/hooks/useCartPoints.js +70 -70
- package/dist/esm/hooks/useCommunicationPreferences.js +1 -1
- package/dist/esm/hooks/useCreditCard.d.ts +13 -13
- package/dist/esm/hooks/useCreditCard.js +59 -59
- package/dist/esm/hooks/useCreditCardForm.d.ts +10 -10
- package/dist/esm/hooks/useCreditCardForm.js +67 -67
- package/dist/esm/hooks/useCurbside.d.ts +9 -9
- package/dist/esm/hooks/useCurbside.js +35 -35
- package/dist/esm/hooks/useDineInForm.d.ts +11 -11
- package/dist/esm/hooks/useDineInForm.js +52 -52
- package/dist/esm/hooks/useDonationForm.d.ts +28 -28
- package/dist/esm/hooks/useDonationForm.js +168 -168
- package/dist/esm/hooks/useFirstTimes.d.ts +18 -18
- package/dist/esm/hooks/useFirstTimes.js +77 -77
- package/dist/esm/hooks/useGiftCardAssignForm.d.ts +14 -14
- package/dist/esm/hooks/useGiftCardAssignForm.js +53 -53
- package/dist/esm/hooks/useGiftCardAssignOtherForm.d.ts +14 -14
- package/dist/esm/hooks/useGiftCardAssignOtherForm.js +46 -46
- package/dist/esm/hooks/useGiftCardForm.d.ts +12 -12
- package/dist/esm/hooks/useGiftCardForm.js +70 -70
- package/dist/esm/hooks/useGiftCardsForm.d.ts +31 -31
- package/dist/esm/hooks/useGiftCardsForm.js +191 -191
- package/dist/esm/hooks/useGuestCheckoutForm.d.ts +21 -21
- package/dist/esm/hooks/useGuestCheckoutForm.js +85 -85
- package/dist/esm/hooks/useGuestForm.d.ts +12 -12
- package/dist/esm/hooks/useGuestForm.js +56 -56
- package/dist/esm/hooks/useImage.d.ts +5 -5
- package/dist/esm/hooks/useImage.js +29 -29
- package/dist/esm/hooks/useLoginForm.d.ts +12 -12
- package/dist/esm/hooks/useLoginForm.js +63 -63
- package/dist/esm/hooks/useMenuItem.d.ts +57 -57
- package/dist/esm/hooks/useMenuItem.js +63 -63
- package/dist/esm/hooks/useModifier.d.ts +53 -53
- package/dist/esm/hooks/useModifier.js +68 -68
- package/dist/esm/hooks/useModifierGroup.d.ts +15 -15
- package/dist/esm/hooks/useModifierGroup.js +13 -13
- package/dist/esm/hooks/useOneTimePasscodeForm.d.ts +16 -16
- package/dist/esm/hooks/useOneTimePasscodeForm.js +83 -83
- package/dist/esm/hooks/useOrderFulfillmentForm.d.ts +11 -11
- package/dist/esm/hooks/useOrderFulfillmentForm.js +61 -61
- package/dist/esm/hooks/useOrderItem.d.ts +48 -48
- package/dist/esm/hooks/useOrderItem.js +50 -50
- package/dist/esm/hooks/useOrderRating.d.ts +10 -10
- package/dist/esm/hooks/useOrderRating.js +30 -30
- package/dist/esm/hooks/useOrderRatingForm.d.ts +11 -11
- package/dist/esm/hooks/useOrderRatingForm.js +31 -31
- package/dist/esm/hooks/useProfileForm.d.ts +15 -15
- package/dist/esm/hooks/useProfileForm.js +112 -112
- package/dist/esm/hooks/useResetPasswordForm.d.ts +12 -12
- package/dist/esm/hooks/useResetPasswordForm.js +73 -73
- package/dist/esm/hooks/useSendResetForm.d.ts +14 -14
- package/dist/esm/hooks/useSendResetForm.js +53 -53
- package/dist/esm/hooks/useSignUpForm.d.ts +20 -20
- package/dist/esm/hooks/useSignUpForm.js +147 -147
- package/dist/esm/hooks/useSignUpGuestForm.d.ts +23 -23
- package/dist/esm/hooks/useSignUpGuestForm.js +118 -109
- package/dist/esm/hooks/useSigninForm.d.ts +12 -12
- package/dist/esm/hooks/useSigninForm.js +62 -62
- package/dist/esm/index.d.ts +2 -2
- package/dist/esm/index.js +2 -2
- package/dist/esm/utils/cards.d.ts +20 -20
- package/dist/esm/utils/cards.js +146 -146
- package/dist/esm/utils/cart.d.ts +202 -202
- package/dist/esm/utils/cart.js +868 -868
- package/dist/esm/utils/checkout.d.ts +55 -55
- package/dist/esm/utils/checkout.js +117 -117
- package/dist/esm/utils/constants.d.ts +43 -43
- package/dist/esm/utils/constants.js +55 -55
- package/dist/esm/utils/customer.d.ts +4 -4
- package/dist/esm/utils/customer.js +29 -29
- package/dist/esm/utils/datetimes.d.ts +99 -99
- package/dist/esm/utils/datetimes.js +531 -531
- package/dist/esm/utils/errors.d.ts +51 -51
- package/dist/esm/utils/errors.js +180 -180
- package/dist/esm/utils/favorites.d.ts +10 -10
- package/dist/esm/utils/favorites.js +109 -109
- package/dist/esm/utils/googleMaps.d.ts +14 -14
- package/dist/esm/utils/googleMaps.js +26 -26
- package/dist/esm/utils/helpers.d.ts +63 -63
- package/dist/esm/utils/helpers.js +205 -205
- package/dist/esm/utils/index.d.ts +19 -19
- package/dist/esm/utils/index.js +20 -20
- package/dist/esm/utils/keypad.d.ts +9 -9
- package/dist/esm/utils/keypad.js +97 -97
- package/dist/esm/utils/maps.d.ts +226 -226
- package/dist/esm/utils/maps.js +316 -316
- package/dist/esm/utils/menu.d.ts +117 -117
- package/dist/esm/utils/menu.js +74 -74
- package/dist/esm/utils/orders.d.ts +21 -21
- package/dist/esm/utils/orders.js +185 -185
- package/dist/esm/utils/pizzaBuilder.d.ts +10 -10
- package/dist/esm/utils/pizzaBuilder.js +38 -38
- package/dist/esm/utils/refunds.d.ts +35 -35
- package/dist/esm/utils/refunds.js +90 -90
- package/dist/esm/utils/revenueCenters.d.ts +11 -11
- package/dist/esm/utils/revenueCenters.js +115 -115
- package/dist/esm/utils/rewards.d.ts +4 -4
- package/dist/esm/utils/rewards.js +100 -100
- package/dist/esm/utils/theme.d.ts +27 -27
- package/dist/esm/utils/theme.js +254 -254
- package/dist/esm/utils/version.d.ts +4 -4
- package/dist/esm/utils/version.js +34 -34
- package/package.json +69 -68
|
@@ -1,56 +1,56 @@
|
|
|
1
|
-
import { useState, useEffect, useRef } from 'react';
|
|
2
|
-
import { makeFormErrors } from '../utils';
|
|
3
|
-
export const useGuestForm = (email, loading, error, checkGuest) => {
|
|
4
|
-
const submitRef = useRef(null);
|
|
5
|
-
const inputRef = useRef(null);
|
|
6
|
-
const [data, setData] = useState({ email });
|
|
7
|
-
const [errors, setErrors] = useState({});
|
|
8
|
-
const [submitting, setSubmitting] = useState(false);
|
|
9
|
-
const fields = [
|
|
10
|
-
{
|
|
11
|
-
label: 'Email',
|
|
12
|
-
name: 'email',
|
|
13
|
-
type: 'email'
|
|
14
|
-
}
|
|
15
|
-
];
|
|
16
|
-
useEffect(() => {
|
|
17
|
-
var _a, _b;
|
|
18
|
-
if (loading === 'idle') {
|
|
19
|
-
setSubmitting(false);
|
|
20
|
-
if (error) {
|
|
21
|
-
const errs = makeFormErrors(error);
|
|
22
|
-
if (errs.form === 'Unknown 500 error') {
|
|
23
|
-
errs.form = 'Invalid email address. Please try again.';
|
|
24
|
-
}
|
|
25
|
-
setErrors(errs);
|
|
26
|
-
((_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.focus) && ((_b = inputRef.current) === null || _b === void 0 ? void 0 : _b.focus());
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
}, [loading, error]);
|
|
30
|
-
useEffect(() => {
|
|
31
|
-
if (email && data.email === undefined) {
|
|
32
|
-
setData({ email });
|
|
33
|
-
}
|
|
34
|
-
}, [email, data.email]);
|
|
35
|
-
const handleChange = (name, value) => {
|
|
36
|
-
setData(Object.assign(Object.assign({}, data), { [name]: value }));
|
|
37
|
-
};
|
|
38
|
-
const handleSubmit = (evt) => {
|
|
39
|
-
var _a, _b;
|
|
40
|
-
evt === null || evt === void 0 ? void 0 : evt.preventDefault();
|
|
41
|
-
setSubmitting(true);
|
|
42
|
-
if (data.email)
|
|
43
|
-
checkGuest(data.email);
|
|
44
|
-
((_a = submitRef.current) === null || _a === void 0 ? void 0 : _a.blur) && ((_b = submitRef.current) === null || _b === void 0 ? void 0 : _b.blur());
|
|
45
|
-
};
|
|
46
|
-
return {
|
|
47
|
-
submitRef,
|
|
48
|
-
inputRef,
|
|
49
|
-
fields,
|
|
50
|
-
data,
|
|
51
|
-
errors,
|
|
52
|
-
submitting,
|
|
53
|
-
handleChange,
|
|
54
|
-
handleSubmit
|
|
55
|
-
};
|
|
56
|
-
};
|
|
1
|
+
import { useState, useEffect, useRef } from 'react';
|
|
2
|
+
import { makeFormErrors } from '../utils';
|
|
3
|
+
export const useGuestForm = (email, loading, error, checkGuest) => {
|
|
4
|
+
const submitRef = useRef(null);
|
|
5
|
+
const inputRef = useRef(null);
|
|
6
|
+
const [data, setData] = useState({ email });
|
|
7
|
+
const [errors, setErrors] = useState({});
|
|
8
|
+
const [submitting, setSubmitting] = useState(false);
|
|
9
|
+
const fields = [
|
|
10
|
+
{
|
|
11
|
+
label: 'Email',
|
|
12
|
+
name: 'email',
|
|
13
|
+
type: 'email'
|
|
14
|
+
}
|
|
15
|
+
];
|
|
16
|
+
useEffect(() => {
|
|
17
|
+
var _a, _b;
|
|
18
|
+
if (loading === 'idle') {
|
|
19
|
+
setSubmitting(false);
|
|
20
|
+
if (error) {
|
|
21
|
+
const errs = makeFormErrors(error);
|
|
22
|
+
if (errs.form === 'Unknown 500 error') {
|
|
23
|
+
errs.form = 'Invalid email address. Please try again.';
|
|
24
|
+
}
|
|
25
|
+
setErrors(errs);
|
|
26
|
+
((_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.focus) && ((_b = inputRef.current) === null || _b === void 0 ? void 0 : _b.focus());
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}, [loading, error]);
|
|
30
|
+
useEffect(() => {
|
|
31
|
+
if (email && data.email === undefined) {
|
|
32
|
+
setData({ email });
|
|
33
|
+
}
|
|
34
|
+
}, [email, data.email]);
|
|
35
|
+
const handleChange = (name, value) => {
|
|
36
|
+
setData(Object.assign(Object.assign({}, data), { [name]: value }));
|
|
37
|
+
};
|
|
38
|
+
const handleSubmit = (evt) => {
|
|
39
|
+
var _a, _b;
|
|
40
|
+
evt === null || evt === void 0 ? void 0 : evt.preventDefault();
|
|
41
|
+
setSubmitting(true);
|
|
42
|
+
if (data.email)
|
|
43
|
+
checkGuest(data.email);
|
|
44
|
+
((_a = submitRef.current) === null || _a === void 0 ? void 0 : _a.blur) && ((_b = submitRef.current) === null || _b === void 0 ? void 0 : _b.blur());
|
|
45
|
+
};
|
|
46
|
+
return {
|
|
47
|
+
submitRef,
|
|
48
|
+
inputRef,
|
|
49
|
+
fields,
|
|
50
|
+
data,
|
|
51
|
+
errors,
|
|
52
|
+
submitting,
|
|
53
|
+
handleChange,
|
|
54
|
+
handleSubmit
|
|
55
|
+
};
|
|
56
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export declare const useImage: (src: string | null | undefined) => {
|
|
2
|
-
hasLoaded: boolean;
|
|
3
|
-
hasError: boolean;
|
|
4
|
-
hasStartedInitialFetch: boolean;
|
|
5
|
-
};
|
|
1
|
+
export declare const useImage: (src: string | null | undefined) => {
|
|
2
|
+
hasLoaded: boolean;
|
|
3
|
+
hasError: boolean;
|
|
4
|
+
hasStartedInitialFetch: boolean;
|
|
5
|
+
};
|
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
import { useState, useEffect } from 'react';
|
|
2
|
-
// https://typesafe.blog/article/fetch-images-with-a-react-hook
|
|
3
|
-
export const useImage = (src) => {
|
|
4
|
-
const [hasLoaded, setHasLoaded] = useState(false);
|
|
5
|
-
const [hasError, setHasError] = useState(false);
|
|
6
|
-
const [hasStartedInitialFetch, setHasStartedInitialFetch] = useState(false);
|
|
7
|
-
useEffect(() => {
|
|
8
|
-
setHasStartedInitialFetch(true);
|
|
9
|
-
setHasLoaded(false);
|
|
10
|
-
setHasError(false);
|
|
11
|
-
const image = new Image();
|
|
12
|
-
if (src)
|
|
13
|
-
image.src = src;
|
|
14
|
-
const handleError = () => {
|
|
15
|
-
setHasError(true);
|
|
16
|
-
};
|
|
17
|
-
const handleLoad = () => {
|
|
18
|
-
setHasLoaded(true);
|
|
19
|
-
setHasError(false);
|
|
20
|
-
};
|
|
21
|
-
image.onerror = handleError;
|
|
22
|
-
image.onload = handleLoad;
|
|
23
|
-
return () => {
|
|
24
|
-
image.removeEventListener('error', handleError);
|
|
25
|
-
image.removeEventListener('load', handleLoad);
|
|
26
|
-
};
|
|
27
|
-
}, [src]);
|
|
28
|
-
return { hasLoaded, hasError, hasStartedInitialFetch };
|
|
29
|
-
};
|
|
1
|
+
import { useState, useEffect } from 'react';
|
|
2
|
+
// https://typesafe.blog/article/fetch-images-with-a-react-hook
|
|
3
|
+
export const useImage = (src) => {
|
|
4
|
+
const [hasLoaded, setHasLoaded] = useState(false);
|
|
5
|
+
const [hasError, setHasError] = useState(false);
|
|
6
|
+
const [hasStartedInitialFetch, setHasStartedInitialFetch] = useState(false);
|
|
7
|
+
useEffect(() => {
|
|
8
|
+
setHasStartedInitialFetch(true);
|
|
9
|
+
setHasLoaded(false);
|
|
10
|
+
setHasError(false);
|
|
11
|
+
const image = new Image();
|
|
12
|
+
if (src)
|
|
13
|
+
image.src = src;
|
|
14
|
+
const handleError = () => {
|
|
15
|
+
setHasError(true);
|
|
16
|
+
};
|
|
17
|
+
const handleLoad = () => {
|
|
18
|
+
setHasLoaded(true);
|
|
19
|
+
setHasError(false);
|
|
20
|
+
};
|
|
21
|
+
image.onerror = handleError;
|
|
22
|
+
image.onload = handleLoad;
|
|
23
|
+
return () => {
|
|
24
|
+
image.removeEventListener('error', handleError);
|
|
25
|
+
image.removeEventListener('load', handleLoad);
|
|
26
|
+
};
|
|
27
|
+
}, [src]);
|
|
28
|
+
return { hasLoaded, hasError, hasStartedInitialFetch };
|
|
29
|
+
};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { LoginData, RequestError, RequestStatus } from '@open-tender/types';
|
|
3
|
-
export declare const useLoginForm: (loading: RequestStatus, error: RequestError, login: (email: string, password?: string) => void, callback?: () => void, showPassword?: boolean) => {
|
|
4
|
-
submitRef: import("react").MutableRefObject<HTMLButtonElement | null>;
|
|
5
|
-
inputRef: import("react").MutableRefObject<HTMLInputElement | null>;
|
|
6
|
-
fields: import("@open-tender/types").FormFieldType[];
|
|
7
|
-
data: LoginData;
|
|
8
|
-
errors: Record<string, string>;
|
|
9
|
-
submitting: boolean;
|
|
10
|
-
handleChange: (name: string, value: string | number | boolean) => void;
|
|
11
|
-
handleSubmit: (evt?: React.FormEvent<HTMLFormElement>) => void;
|
|
12
|
-
};
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { LoginData, RequestError, RequestStatus } from '@open-tender/types';
|
|
3
|
+
export declare const useLoginForm: (loading: RequestStatus, error: RequestError, login: (email: string, password?: string) => void, callback?: () => void, showPassword?: boolean) => {
|
|
4
|
+
submitRef: import("react").MutableRefObject<HTMLButtonElement | null>;
|
|
5
|
+
inputRef: import("react").MutableRefObject<HTMLInputElement | null>;
|
|
6
|
+
fields: import("@open-tender/types").FormFieldType[];
|
|
7
|
+
data: LoginData;
|
|
8
|
+
errors: Record<string, string>;
|
|
9
|
+
submitting: boolean;
|
|
10
|
+
handleChange: (name: string, value: string | number | boolean) => void;
|
|
11
|
+
handleSubmit: (evt?: React.FormEvent<HTMLFormElement>) => void;
|
|
12
|
+
};
|
|
@@ -1,63 +1,63 @@
|
|
|
1
|
-
import { useState, useEffect, useRef } from 'react';
|
|
2
|
-
import { makeFormErrors } from '../utils';
|
|
3
|
-
export const useLoginForm = (loading, error, login, callback, showPassword = true) => {
|
|
4
|
-
const submitRef = useRef(null);
|
|
5
|
-
const inputRef = useRef(null);
|
|
6
|
-
const [data, setData] = useState({ email: '', password: '' });
|
|
7
|
-
const [errors, setErrors] = useState({});
|
|
8
|
-
const [submitting, setSubmitting] = useState(false);
|
|
9
|
-
const toRemove = [];
|
|
10
|
-
if (!showPassword)
|
|
11
|
-
toRemove.push('password');
|
|
12
|
-
const allFields = [
|
|
13
|
-
{
|
|
14
|
-
label: 'Email',
|
|
15
|
-
name: 'email',
|
|
16
|
-
type: 'email',
|
|
17
|
-
required: true
|
|
18
|
-
},
|
|
19
|
-
{
|
|
20
|
-
label: 'Password',
|
|
21
|
-
name: 'password',
|
|
22
|
-
type: 'password',
|
|
23
|
-
required: true,
|
|
24
|
-
autoComplete: 'new-password'
|
|
25
|
-
}
|
|
26
|
-
];
|
|
27
|
-
const fields = allFields.filter(i => !toRemove.includes(i.name));
|
|
28
|
-
useEffect(() => {
|
|
29
|
-
var _a, _b;
|
|
30
|
-
if (loading === 'idle' && submitting) {
|
|
31
|
-
setSubmitting(false);
|
|
32
|
-
if (error) {
|
|
33
|
-
setErrors(makeFormErrors(error));
|
|
34
|
-
((_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.focus) && ((_b = inputRef.current) === null || _b === void 0 ? void 0 : _b.focus());
|
|
35
|
-
}
|
|
36
|
-
else if (callback && submitting) {
|
|
37
|
-
callback();
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
}, [loading, error, callback, submitting]);
|
|
41
|
-
const handleChange = (name, value) => {
|
|
42
|
-
setData(Object.assign(Object.assign({}, data), { [name]: value }));
|
|
43
|
-
};
|
|
44
|
-
const handleSubmit = (evt) => {
|
|
45
|
-
var _a, _b;
|
|
46
|
-
evt === null || evt === void 0 ? void 0 : evt.preventDefault();
|
|
47
|
-
setSubmitting(true);
|
|
48
|
-
const { email, password } = data;
|
|
49
|
-
if (email)
|
|
50
|
-
login(email, password);
|
|
51
|
-
((_a = submitRef.current) === null || _a === void 0 ? void 0 : _a.blur) && ((_b = submitRef.current) === null || _b === void 0 ? void 0 : _b.blur());
|
|
52
|
-
};
|
|
53
|
-
return {
|
|
54
|
-
submitRef,
|
|
55
|
-
inputRef,
|
|
56
|
-
fields,
|
|
57
|
-
data,
|
|
58
|
-
errors,
|
|
59
|
-
submitting,
|
|
60
|
-
handleChange,
|
|
61
|
-
handleSubmit
|
|
62
|
-
};
|
|
63
|
-
};
|
|
1
|
+
import { useState, useEffect, useRef } from 'react';
|
|
2
|
+
import { makeFormErrors } from '../utils';
|
|
3
|
+
export const useLoginForm = (loading, error, login, callback, showPassword = true) => {
|
|
4
|
+
const submitRef = useRef(null);
|
|
5
|
+
const inputRef = useRef(null);
|
|
6
|
+
const [data, setData] = useState({ email: '', password: '' });
|
|
7
|
+
const [errors, setErrors] = useState({});
|
|
8
|
+
const [submitting, setSubmitting] = useState(false);
|
|
9
|
+
const toRemove = [];
|
|
10
|
+
if (!showPassword)
|
|
11
|
+
toRemove.push('password');
|
|
12
|
+
const allFields = [
|
|
13
|
+
{
|
|
14
|
+
label: 'Email',
|
|
15
|
+
name: 'email',
|
|
16
|
+
type: 'email',
|
|
17
|
+
required: true
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
label: 'Password',
|
|
21
|
+
name: 'password',
|
|
22
|
+
type: 'password',
|
|
23
|
+
required: true,
|
|
24
|
+
autoComplete: 'new-password'
|
|
25
|
+
}
|
|
26
|
+
];
|
|
27
|
+
const fields = allFields.filter(i => !toRemove.includes(i.name));
|
|
28
|
+
useEffect(() => {
|
|
29
|
+
var _a, _b;
|
|
30
|
+
if (loading === 'idle' && submitting) {
|
|
31
|
+
setSubmitting(false);
|
|
32
|
+
if (error) {
|
|
33
|
+
setErrors(makeFormErrors(error));
|
|
34
|
+
((_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.focus) && ((_b = inputRef.current) === null || _b === void 0 ? void 0 : _b.focus());
|
|
35
|
+
}
|
|
36
|
+
else if (callback && submitting) {
|
|
37
|
+
callback();
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}, [loading, error, callback, submitting]);
|
|
41
|
+
const handleChange = (name, value) => {
|
|
42
|
+
setData(Object.assign(Object.assign({}, data), { [name]: value }));
|
|
43
|
+
};
|
|
44
|
+
const handleSubmit = (evt) => {
|
|
45
|
+
var _a, _b;
|
|
46
|
+
evt === null || evt === void 0 ? void 0 : evt.preventDefault();
|
|
47
|
+
setSubmitting(true);
|
|
48
|
+
const { email, password } = data;
|
|
49
|
+
if (email)
|
|
50
|
+
login(email, password);
|
|
51
|
+
((_a = submitRef.current) === null || _a === void 0 ? void 0 : _a.blur) && ((_b = submitRef.current) === null || _b === void 0 ? void 0 : _b.blur());
|
|
52
|
+
};
|
|
53
|
+
return {
|
|
54
|
+
submitRef,
|
|
55
|
+
inputRef,
|
|
56
|
+
fields,
|
|
57
|
+
data,
|
|
58
|
+
errors,
|
|
59
|
+
submitting,
|
|
60
|
+
handleChange,
|
|
61
|
+
handleSubmit
|
|
62
|
+
};
|
|
63
|
+
};
|
|
@@ -1,57 +1,57 @@
|
|
|
1
|
-
import { Auth, CartItem, ConfigDisplaySetting, FavoritesLookup } from '@open-tender/types';
|
|
2
|
-
export declare const useMenuItem: (builtItem: CartItem, auth: Auth | null, lookup: FavoritesLookup, cartId: number | null, displaySettings?: ConfigDisplaySetting) => {
|
|
3
|
-
description: string | null;
|
|
4
|
-
tags: string[];
|
|
5
|
-
allergens: string[];
|
|
6
|
-
displayPrice: string;
|
|
7
|
-
displayCals: number | null;
|
|
8
|
-
totalPoints: number | null;
|
|
9
|
-
totalAllergens: string[];
|
|
10
|
-
auth: Auth | null;
|
|
11
|
-
favoriteId: number | null;
|
|
12
|
-
isIncomplete: boolean;
|
|
13
|
-
hasTagsAllergens: boolean;
|
|
14
|
-
hasTags: boolean;
|
|
15
|
-
hasAllergens: boolean;
|
|
16
|
-
hasGroups: boolean;
|
|
17
|
-
sizeGroup: import("@open-tender/types").CartItemGroup | null | undefined;
|
|
18
|
-
sizeSelected: boolean;
|
|
19
|
-
nonSizeGroups: import("@open-tender/types").CartItemGroup[] | null;
|
|
20
|
-
requiresCustomization: boolean;
|
|
21
|
-
hasCals: boolean;
|
|
22
|
-
hasIngredients: boolean | "" | null;
|
|
23
|
-
hasInfo: boolean | "" | null;
|
|
24
|
-
hasMadeFor: boolean;
|
|
25
|
-
hasNotes: boolean;
|
|
26
|
-
hasSelections: boolean;
|
|
27
|
-
cartGuestId: number | null;
|
|
28
|
-
customerId: number | null;
|
|
29
|
-
index?: number | undefined;
|
|
30
|
-
madeFor: string | null;
|
|
31
|
-
notes: string | null;
|
|
32
|
-
signature?: string | undefined;
|
|
33
|
-
similarItems: number[];
|
|
34
|
-
upsellItems: number[];
|
|
35
|
-
allergens_list?: import("@open-tender/types").MenuItemAllergens | undefined;
|
|
36
|
-
cals: number | null;
|
|
37
|
-
groups: import("@open-tender/types").CartItemGroups;
|
|
38
|
-
id: number;
|
|
39
|
-
imageUrl: string | null;
|
|
40
|
-
increment: number;
|
|
41
|
-
ingredients: string | null;
|
|
42
|
-
isSoldOut: boolean;
|
|
43
|
-
max: number;
|
|
44
|
-
min: number;
|
|
45
|
-
name: string;
|
|
46
|
-
nutritionalInfo: import("@open-tender/types").NutritionalInfo | null;
|
|
47
|
-
points: number | null;
|
|
48
|
-
price: number;
|
|
49
|
-
quantity: number;
|
|
50
|
-
shorthand: string | null;
|
|
51
|
-
shortDescription: string | null;
|
|
52
|
-
shortName: string;
|
|
53
|
-
slug: string;
|
|
54
|
-
tags_list?: import("@open-tender/types").MenuItemTags | undefined;
|
|
55
|
-
totalCals: number | null;
|
|
56
|
-
totalPrice: number | null;
|
|
57
|
-
};
|
|
1
|
+
import { Auth, CartItem, ConfigDisplaySetting, FavoritesLookup } from '@open-tender/types';
|
|
2
|
+
export declare const useMenuItem: (builtItem: CartItem, auth: Auth | null, lookup: FavoritesLookup, cartId: number | null, displaySettings?: ConfigDisplaySetting) => {
|
|
3
|
+
description: string | null;
|
|
4
|
+
tags: string[];
|
|
5
|
+
allergens: string[];
|
|
6
|
+
displayPrice: string;
|
|
7
|
+
displayCals: number | null;
|
|
8
|
+
totalPoints: number | null;
|
|
9
|
+
totalAllergens: string[];
|
|
10
|
+
auth: Auth | null;
|
|
11
|
+
favoriteId: number | null;
|
|
12
|
+
isIncomplete: boolean;
|
|
13
|
+
hasTagsAllergens: boolean;
|
|
14
|
+
hasTags: boolean;
|
|
15
|
+
hasAllergens: boolean;
|
|
16
|
+
hasGroups: boolean;
|
|
17
|
+
sizeGroup: import("@open-tender/types").CartItemGroup | null | undefined;
|
|
18
|
+
sizeSelected: boolean;
|
|
19
|
+
nonSizeGroups: import("@open-tender/types").CartItemGroup[] | null;
|
|
20
|
+
requiresCustomization: boolean;
|
|
21
|
+
hasCals: boolean;
|
|
22
|
+
hasIngredients: boolean | "" | null;
|
|
23
|
+
hasInfo: boolean | "" | null;
|
|
24
|
+
hasMadeFor: boolean;
|
|
25
|
+
hasNotes: boolean;
|
|
26
|
+
hasSelections: boolean;
|
|
27
|
+
cartGuestId: number | null;
|
|
28
|
+
customerId: number | null;
|
|
29
|
+
index?: number | undefined;
|
|
30
|
+
madeFor: string | null;
|
|
31
|
+
notes: string | null;
|
|
32
|
+
signature?: string | undefined;
|
|
33
|
+
similarItems: number[];
|
|
34
|
+
upsellItems: number[];
|
|
35
|
+
allergens_list?: import("@open-tender/types").MenuItemAllergens | undefined;
|
|
36
|
+
cals: number | null;
|
|
37
|
+
groups: import("@open-tender/types").CartItemGroups;
|
|
38
|
+
id: number;
|
|
39
|
+
imageUrl: string | null;
|
|
40
|
+
increment: number;
|
|
41
|
+
ingredients: string | null;
|
|
42
|
+
isSoldOut: boolean;
|
|
43
|
+
max: number;
|
|
44
|
+
min: number;
|
|
45
|
+
name: string;
|
|
46
|
+
nutritionalInfo: import("@open-tender/types").NutritionalInfo | null;
|
|
47
|
+
points: number | null;
|
|
48
|
+
price: number;
|
|
49
|
+
quantity: number;
|
|
50
|
+
shorthand: string | null;
|
|
51
|
+
shortDescription: string | null;
|
|
52
|
+
shortName: string;
|
|
53
|
+
slug: string;
|
|
54
|
+
tags_list?: import("@open-tender/types").MenuItemTags | undefined;
|
|
55
|
+
totalCals: number | null;
|
|
56
|
+
totalPrice: number | null;
|
|
57
|
+
};
|
|
@@ -1,63 +1,63 @@
|
|
|
1
|
-
import { formatDollars, getItemOptions, hasGroupsBelowMin, makeItemSignature } from '../utils';
|
|
2
|
-
export const useMenuItem = (builtItem, auth, lookup, cartId, displaySettings) => {
|
|
3
|
-
const signature = makeItemSignature(builtItem);
|
|
4
|
-
const favoriteId = lookup && signature ? lookup[signature] : null;
|
|
5
|
-
const { calories: showCals = false, tags: showTags = false, allergens: showAllergens = false, madeFor: showMadeFor = true, notes: showNotes = true } = displaySettings || {};
|
|
6
|
-
const { description, quantity, price, totalPrice, cals, totalCals, totalPoints, tags, allergens, groups, ingredients, totalAllergens } = builtItem;
|
|
7
|
-
const hasTags = showTags && Array.isArray(tags) && tags.length ? true : false;
|
|
8
|
-
const hasAllergens = showAllergens && Array.isArray(allergens) && allergens.length ? true : false;
|
|
9
|
-
const hasTagsAllergens = hasTags || hasAllergens ? true : false;
|
|
10
|
-
const sizeGroup = groups ? groups.find(i => i.isSize) : null;
|
|
11
|
-
const sizeSelected = !sizeGroup || sizeGroup.options.filter(o => o.quantity > 0).length > 0;
|
|
12
|
-
const defaultOption = !sizeGroup
|
|
13
|
-
? null
|
|
14
|
-
: sizeGroup.options.find(i => i.isDefault) || sizeGroup.options[0];
|
|
15
|
-
const currentPrice = totalPrice
|
|
16
|
-
? totalPrice
|
|
17
|
-
: defaultOption
|
|
18
|
-
? defaultOption.price
|
|
19
|
-
: price;
|
|
20
|
-
const displayPrice = formatDollars(currentPrice.toString());
|
|
21
|
-
const displayCals = showCals ? (totalPrice ? totalCals : cals) : null;
|
|
22
|
-
const missingSize = sizeGroup
|
|
23
|
-
? !sizeGroup.options.find(i => i.quantity >= 1)
|
|
24
|
-
: false;
|
|
25
|
-
const hasGroups = groups ? groups.filter(g => !g.isSize).length > 0 : false;
|
|
26
|
-
const groupsBelowMin = hasGroupsBelowMin(null, groups);
|
|
27
|
-
const isIncomplete = quantity === 0 || groupsBelowMin;
|
|
28
|
-
const requiresCustomization = isIncomplete && !missingSize;
|
|
29
|
-
const nonSizeGroups = groups ? groups.filter(i => !i.isSize) : null;
|
|
30
|
-
const currentOptions = nonSizeGroups
|
|
31
|
-
? getItemOptions(Object.assign(Object.assign({}, builtItem), { groups: nonSizeGroups }))
|
|
32
|
-
: [];
|
|
33
|
-
const hasSelections = currentOptions.length > 0;
|
|
34
|
-
const hasMadeFor = showMadeFor && !cartId ? true : false;
|
|
35
|
-
const hasNotes = showNotes ? true : false;
|
|
36
|
-
const hasIngredients = ingredients && ingredients.length > 0;
|
|
37
|
-
const hasCals = displayCals !== null;
|
|
38
|
-
const hasInfo = hasCals || hasIngredients;
|
|
39
|
-
return Object.assign(Object.assign({}, builtItem), { description,
|
|
40
|
-
tags,
|
|
41
|
-
allergens,
|
|
42
|
-
displayPrice,
|
|
43
|
-
displayCals,
|
|
44
|
-
totalPoints,
|
|
45
|
-
totalAllergens,
|
|
46
|
-
auth,
|
|
47
|
-
favoriteId,
|
|
48
|
-
isIncomplete,
|
|
49
|
-
hasTagsAllergens,
|
|
50
|
-
hasTags,
|
|
51
|
-
hasAllergens,
|
|
52
|
-
hasGroups,
|
|
53
|
-
sizeGroup,
|
|
54
|
-
sizeSelected,
|
|
55
|
-
nonSizeGroups,
|
|
56
|
-
requiresCustomization,
|
|
57
|
-
hasCals,
|
|
58
|
-
hasIngredients,
|
|
59
|
-
hasInfo,
|
|
60
|
-
hasMadeFor,
|
|
61
|
-
hasNotes,
|
|
62
|
-
hasSelections });
|
|
63
|
-
};
|
|
1
|
+
import { formatDollars, getItemOptions, hasGroupsBelowMin, makeItemSignature } from '../utils';
|
|
2
|
+
export const useMenuItem = (builtItem, auth, lookup, cartId, displaySettings) => {
|
|
3
|
+
const signature = makeItemSignature(builtItem);
|
|
4
|
+
const favoriteId = lookup && signature ? lookup[signature] : null;
|
|
5
|
+
const { calories: showCals = false, tags: showTags = false, allergens: showAllergens = false, madeFor: showMadeFor = true, notes: showNotes = true } = displaySettings || {};
|
|
6
|
+
const { description, quantity, price, totalPrice, cals, totalCals, totalPoints, tags, allergens, groups, ingredients, totalAllergens } = builtItem;
|
|
7
|
+
const hasTags = showTags && Array.isArray(tags) && tags.length ? true : false;
|
|
8
|
+
const hasAllergens = showAllergens && Array.isArray(allergens) && allergens.length ? true : false;
|
|
9
|
+
const hasTagsAllergens = hasTags || hasAllergens ? true : false;
|
|
10
|
+
const sizeGroup = groups ? groups.find(i => i.isSize) : null;
|
|
11
|
+
const sizeSelected = !sizeGroup || sizeGroup.options.filter(o => o.quantity > 0).length > 0;
|
|
12
|
+
const defaultOption = !sizeGroup
|
|
13
|
+
? null
|
|
14
|
+
: sizeGroup.options.find(i => i.isDefault) || sizeGroup.options[0];
|
|
15
|
+
const currentPrice = totalPrice
|
|
16
|
+
? totalPrice
|
|
17
|
+
: defaultOption
|
|
18
|
+
? defaultOption.price
|
|
19
|
+
: price;
|
|
20
|
+
const displayPrice = formatDollars(currentPrice.toString());
|
|
21
|
+
const displayCals = showCals ? (totalPrice ? totalCals : cals) : null;
|
|
22
|
+
const missingSize = sizeGroup
|
|
23
|
+
? !sizeGroup.options.find(i => i.quantity >= 1)
|
|
24
|
+
: false;
|
|
25
|
+
const hasGroups = groups ? groups.filter(g => !g.isSize).length > 0 : false;
|
|
26
|
+
const groupsBelowMin = hasGroupsBelowMin(null, groups);
|
|
27
|
+
const isIncomplete = quantity === 0 || groupsBelowMin;
|
|
28
|
+
const requiresCustomization = isIncomplete && !missingSize;
|
|
29
|
+
const nonSizeGroups = groups ? groups.filter(i => !i.isSize) : null;
|
|
30
|
+
const currentOptions = nonSizeGroups
|
|
31
|
+
? getItemOptions(Object.assign(Object.assign({}, builtItem), { groups: nonSizeGroups }))
|
|
32
|
+
: [];
|
|
33
|
+
const hasSelections = currentOptions.length > 0;
|
|
34
|
+
const hasMadeFor = showMadeFor && !cartId ? true : false;
|
|
35
|
+
const hasNotes = showNotes ? true : false;
|
|
36
|
+
const hasIngredients = ingredients && ingredients.length > 0;
|
|
37
|
+
const hasCals = displayCals !== null;
|
|
38
|
+
const hasInfo = hasCals || hasIngredients;
|
|
39
|
+
return Object.assign(Object.assign({}, builtItem), { description,
|
|
40
|
+
tags,
|
|
41
|
+
allergens,
|
|
42
|
+
displayPrice,
|
|
43
|
+
displayCals,
|
|
44
|
+
totalPoints,
|
|
45
|
+
totalAllergens,
|
|
46
|
+
auth,
|
|
47
|
+
favoriteId,
|
|
48
|
+
isIncomplete,
|
|
49
|
+
hasTagsAllergens,
|
|
50
|
+
hasTags,
|
|
51
|
+
hasAllergens,
|
|
52
|
+
hasGroups,
|
|
53
|
+
sizeGroup,
|
|
54
|
+
sizeSelected,
|
|
55
|
+
nonSizeGroups,
|
|
56
|
+
requiresCustomization,
|
|
57
|
+
hasCals,
|
|
58
|
+
hasIngredients,
|
|
59
|
+
hasInfo,
|
|
60
|
+
hasMadeFor,
|
|
61
|
+
hasNotes,
|
|
62
|
+
hasSelections });
|
|
63
|
+
};
|