@open-tender/utils 0.4.30 → 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 -55
- package/dist/cjs/hooks/useMenuItem.js +67 -67
- package/dist/cjs/hooks/useModifier.d.ts +53 -51
- 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 -46
- 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 -198
- package/dist/cjs/utils/cart.js +909 -905
- 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 -113
- 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 -55
- package/dist/esm/hooks/useMenuItem.js +63 -63
- package/dist/esm/hooks/useModifier.d.ts +53 -51
- 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 -46
- 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 -198
- package/dist/esm/utils/cart.js +868 -864
- 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 -113
- 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
package/LICENSE.md
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2020 Open Tender Inc.
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2020 Open Tender Inc.
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
# Open Tender Utils
|
|
2
|
-
|
|
1
|
+
# Open Tender Utils
|
|
2
|
+
|
|
3
3
|
A library of utils for use with Open Tender applications that utilize our cloud-based Order API.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export {};
|
|
1
|
+
export {};
|
|
@@ -1,96 +1,96 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const utils_1 = require("../../utils");
|
|
4
|
-
describe('formatPercentage', () => {
|
|
5
|
-
it('formats percentage when decimal is undefined', () => {
|
|
6
|
-
expect((0, utils_1.formatPercentage)('0')).toBe('0');
|
|
7
|
-
expect((0, utils_1.formatPercentage)('0.45')).toBe('0.45');
|
|
8
|
-
expect((0, utils_1.formatPercentage)('0.5')).toBe('0.5');
|
|
9
|
-
expect((0, utils_1.formatPercentage)('1')).toBe('1');
|
|
10
|
-
expect((0, utils_1.formatPercentage)('1.55')).toBe('1.55');
|
|
11
|
-
});
|
|
12
|
-
it('formats percentage with 0 decimal points', () => {
|
|
13
|
-
expect((0, utils_1.formatPercentage)('0', 0)).toBe('0');
|
|
14
|
-
expect((0, utils_1.formatPercentage)('0.45', 0)).toBe('0');
|
|
15
|
-
expect((0, utils_1.formatPercentage)('0.5', 0)).toBe('1');
|
|
16
|
-
expect((0, utils_1.formatPercentage)('1', 0)).toBe('1');
|
|
17
|
-
expect((0, utils_1.formatPercentage)('1.55', 0)).toBe('2');
|
|
18
|
-
});
|
|
19
|
-
it('formats percentage with 2 decimal points', () => {
|
|
20
|
-
expect((0, utils_1.formatPercentage)('0', 2)).toBe('0.00');
|
|
21
|
-
expect((0, utils_1.formatPercentage)('0.45', 2)).toBe('0.45');
|
|
22
|
-
expect((0, utils_1.formatPercentage)('0.5', 2)).toBe('0.50');
|
|
23
|
-
expect((0, utils_1.formatPercentage)('1', 2)).toBe('1.00');
|
|
24
|
-
expect((0, utils_1.formatPercentage)('1.55', 2)).toBe('1.55');
|
|
25
|
-
});
|
|
26
|
-
});
|
|
27
|
-
describe('formatQuantity', () => {
|
|
28
|
-
it('formats quantity', () => {
|
|
29
|
-
expect((0, utils_1.formatQuantity)('0')).toBe('0');
|
|
30
|
-
expect((0, utils_1.formatQuantity)('0.45')).toBe('0');
|
|
31
|
-
expect((0, utils_1.formatQuantity)('0.5')).toBe('1');
|
|
32
|
-
expect((0, utils_1.formatQuantity)('1')).toBe('1');
|
|
33
|
-
expect((0, utils_1.formatQuantity)('1.55')).toBe('2');
|
|
34
|
-
});
|
|
35
|
-
});
|
|
36
|
-
describe('containsAny', () => {
|
|
37
|
-
it('returns true when array contains any of the items', () => {
|
|
38
|
-
expect((0, utils_1.containsAny)(['a', 'b', 'c'], ['a', 'd'])).toBe(true);
|
|
39
|
-
expect((0, utils_1.containsAny)(['a', 'b', 'c'], ['d', 'e', 'f'])).toBe(false);
|
|
40
|
-
expect((0, utils_1.containsAny)(['a', 'b', 'c'], ['a', 'b', 'c'])).toBe(true);
|
|
41
|
-
expect((0, utils_1.containsAny)(['a', 'b', 'c'], ['a', 'b', 'c', 'd'])).toBe(true);
|
|
42
|
-
});
|
|
43
|
-
it('returns false when array does not contain any of the items', () => {
|
|
44
|
-
expect((0, utils_1.containsAny)(['a', 'b', 'c'], ['d', 'e'])).toBe(false);
|
|
45
|
-
expect((0, utils_1.containsAny)(['a', 'b', 'c'], ['d', 'e', 'f'])).toBe(false);
|
|
46
|
-
});
|
|
47
|
-
it('returns false when array is empty', () => {
|
|
48
|
-
expect((0, utils_1.containsAny)([], ['a', 'b', 'c'])).toBe(false);
|
|
49
|
-
});
|
|
50
|
-
it('returns true when items is empty', () => {
|
|
51
|
-
expect((0, utils_1.containsAny)(['a', 'b', 'c'], [])).toBe(true);
|
|
52
|
-
expect((0, utils_1.containsAny)([], [])).toBe(true);
|
|
53
|
-
});
|
|
54
|
-
});
|
|
55
|
-
describe('containsAll', () => {
|
|
56
|
-
it('returns true when array contains all of the items', () => {
|
|
57
|
-
expect((0, utils_1.containsAll)(['a', 'b', 'c'], ['a', 'b'])).toBe(true);
|
|
58
|
-
expect((0, utils_1.containsAll)(['a', 'b', 'c'], ['a', 'b', 'c'])).toBe(true);
|
|
59
|
-
});
|
|
60
|
-
it('returns false when array does not contain all of the items', () => {
|
|
61
|
-
expect((0, utils_1.containsAll)(['a', 'b', 'c'], ['a', 'e'])).toBe(false);
|
|
62
|
-
expect((0, utils_1.containsAll)(['a', 'b', 'c'], ['d', 'e', 'f'])).toBe(false);
|
|
63
|
-
expect((0, utils_1.containsAll)(['a', 'b', 'c'], ['a', 'b', 'c', 'd'])).toBe(false);
|
|
64
|
-
});
|
|
65
|
-
it('returns false when array is empty', () => {
|
|
66
|
-
expect((0, utils_1.containsAll)([], ['a', 'b', 'c'])).toBe(false);
|
|
67
|
-
});
|
|
68
|
-
it('returns true when items is empty', () => {
|
|
69
|
-
expect((0, utils_1.containsAll)(['a', 'b', 'c'], [])).toBe(true);
|
|
70
|
-
expect((0, utils_1.containsAll)([], [])).toBe(true);
|
|
71
|
-
});
|
|
72
|
-
});
|
|
73
|
-
describe('range', () => {
|
|
74
|
-
it('returns numbers array', () => {
|
|
75
|
-
expect((0, utils_1.range)(5)).toStrictEqual([0, 1, 2, 3, 4]);
|
|
76
|
-
expect((0, utils_1.range)(1, 5)).toStrictEqual([1, 2, 3, 4]);
|
|
77
|
-
expect((0, utils_1.range)(0, 20, 5)).toStrictEqual([0, 5, 10, 15]);
|
|
78
|
-
expect((0, utils_1.range)(0, -4, -1)).toStrictEqual([0, -1, -2, -3]);
|
|
79
|
-
});
|
|
80
|
-
});
|
|
81
|
-
describe('sample', () => {
|
|
82
|
-
it('returns undefined for an empty array', () => {
|
|
83
|
-
expect((0, utils_1.sample)([])).toBeUndefined();
|
|
84
|
-
});
|
|
85
|
-
it('returns a random element from the array', () => {
|
|
86
|
-
const numbers = [1, 2, 3, 4, 5];
|
|
87
|
-
const result = (0, utils_1.sample)(numbers);
|
|
88
|
-
expect(numbers.includes(result)).toBe(true);
|
|
89
|
-
});
|
|
90
|
-
it('returns only one of the elements of the array', () => {
|
|
91
|
-
const numbers = [1, 2, 3, 4, 5];
|
|
92
|
-
const result = (0, utils_1.sample)(numbers);
|
|
93
|
-
expect(numbers).toContain(result);
|
|
94
|
-
expect(numbers.indexOf(result)).not.toBe(-1);
|
|
95
|
-
});
|
|
96
|
-
});
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const utils_1 = require("../../utils");
|
|
4
|
+
describe('formatPercentage', () => {
|
|
5
|
+
it('formats percentage when decimal is undefined', () => {
|
|
6
|
+
expect((0, utils_1.formatPercentage)('0')).toBe('0');
|
|
7
|
+
expect((0, utils_1.formatPercentage)('0.45')).toBe('0.45');
|
|
8
|
+
expect((0, utils_1.formatPercentage)('0.5')).toBe('0.5');
|
|
9
|
+
expect((0, utils_1.formatPercentage)('1')).toBe('1');
|
|
10
|
+
expect((0, utils_1.formatPercentage)('1.55')).toBe('1.55');
|
|
11
|
+
});
|
|
12
|
+
it('formats percentage with 0 decimal points', () => {
|
|
13
|
+
expect((0, utils_1.formatPercentage)('0', 0)).toBe('0');
|
|
14
|
+
expect((0, utils_1.formatPercentage)('0.45', 0)).toBe('0');
|
|
15
|
+
expect((0, utils_1.formatPercentage)('0.5', 0)).toBe('1');
|
|
16
|
+
expect((0, utils_1.formatPercentage)('1', 0)).toBe('1');
|
|
17
|
+
expect((0, utils_1.formatPercentage)('1.55', 0)).toBe('2');
|
|
18
|
+
});
|
|
19
|
+
it('formats percentage with 2 decimal points', () => {
|
|
20
|
+
expect((0, utils_1.formatPercentage)('0', 2)).toBe('0.00');
|
|
21
|
+
expect((0, utils_1.formatPercentage)('0.45', 2)).toBe('0.45');
|
|
22
|
+
expect((0, utils_1.formatPercentage)('0.5', 2)).toBe('0.50');
|
|
23
|
+
expect((0, utils_1.formatPercentage)('1', 2)).toBe('1.00');
|
|
24
|
+
expect((0, utils_1.formatPercentage)('1.55', 2)).toBe('1.55');
|
|
25
|
+
});
|
|
26
|
+
});
|
|
27
|
+
describe('formatQuantity', () => {
|
|
28
|
+
it('formats quantity', () => {
|
|
29
|
+
expect((0, utils_1.formatQuantity)('0')).toBe('0');
|
|
30
|
+
expect((0, utils_1.formatQuantity)('0.45')).toBe('0');
|
|
31
|
+
expect((0, utils_1.formatQuantity)('0.5')).toBe('1');
|
|
32
|
+
expect((0, utils_1.formatQuantity)('1')).toBe('1');
|
|
33
|
+
expect((0, utils_1.formatQuantity)('1.55')).toBe('2');
|
|
34
|
+
});
|
|
35
|
+
});
|
|
36
|
+
describe('containsAny', () => {
|
|
37
|
+
it('returns true when array contains any of the items', () => {
|
|
38
|
+
expect((0, utils_1.containsAny)(['a', 'b', 'c'], ['a', 'd'])).toBe(true);
|
|
39
|
+
expect((0, utils_1.containsAny)(['a', 'b', 'c'], ['d', 'e', 'f'])).toBe(false);
|
|
40
|
+
expect((0, utils_1.containsAny)(['a', 'b', 'c'], ['a', 'b', 'c'])).toBe(true);
|
|
41
|
+
expect((0, utils_1.containsAny)(['a', 'b', 'c'], ['a', 'b', 'c', 'd'])).toBe(true);
|
|
42
|
+
});
|
|
43
|
+
it('returns false when array does not contain any of the items', () => {
|
|
44
|
+
expect((0, utils_1.containsAny)(['a', 'b', 'c'], ['d', 'e'])).toBe(false);
|
|
45
|
+
expect((0, utils_1.containsAny)(['a', 'b', 'c'], ['d', 'e', 'f'])).toBe(false);
|
|
46
|
+
});
|
|
47
|
+
it('returns false when array is empty', () => {
|
|
48
|
+
expect((0, utils_1.containsAny)([], ['a', 'b', 'c'])).toBe(false);
|
|
49
|
+
});
|
|
50
|
+
it('returns true when items is empty', () => {
|
|
51
|
+
expect((0, utils_1.containsAny)(['a', 'b', 'c'], [])).toBe(true);
|
|
52
|
+
expect((0, utils_1.containsAny)([], [])).toBe(true);
|
|
53
|
+
});
|
|
54
|
+
});
|
|
55
|
+
describe('containsAll', () => {
|
|
56
|
+
it('returns true when array contains all of the items', () => {
|
|
57
|
+
expect((0, utils_1.containsAll)(['a', 'b', 'c'], ['a', 'b'])).toBe(true);
|
|
58
|
+
expect((0, utils_1.containsAll)(['a', 'b', 'c'], ['a', 'b', 'c'])).toBe(true);
|
|
59
|
+
});
|
|
60
|
+
it('returns false when array does not contain all of the items', () => {
|
|
61
|
+
expect((0, utils_1.containsAll)(['a', 'b', 'c'], ['a', 'e'])).toBe(false);
|
|
62
|
+
expect((0, utils_1.containsAll)(['a', 'b', 'c'], ['d', 'e', 'f'])).toBe(false);
|
|
63
|
+
expect((0, utils_1.containsAll)(['a', 'b', 'c'], ['a', 'b', 'c', 'd'])).toBe(false);
|
|
64
|
+
});
|
|
65
|
+
it('returns false when array is empty', () => {
|
|
66
|
+
expect((0, utils_1.containsAll)([], ['a', 'b', 'c'])).toBe(false);
|
|
67
|
+
});
|
|
68
|
+
it('returns true when items is empty', () => {
|
|
69
|
+
expect((0, utils_1.containsAll)(['a', 'b', 'c'], [])).toBe(true);
|
|
70
|
+
expect((0, utils_1.containsAll)([], [])).toBe(true);
|
|
71
|
+
});
|
|
72
|
+
});
|
|
73
|
+
describe('range', () => {
|
|
74
|
+
it('returns numbers array', () => {
|
|
75
|
+
expect((0, utils_1.range)(5)).toStrictEqual([0, 1, 2, 3, 4]);
|
|
76
|
+
expect((0, utils_1.range)(1, 5)).toStrictEqual([1, 2, 3, 4]);
|
|
77
|
+
expect((0, utils_1.range)(0, 20, 5)).toStrictEqual([0, 5, 10, 15]);
|
|
78
|
+
expect((0, utils_1.range)(0, -4, -1)).toStrictEqual([0, -1, -2, -3]);
|
|
79
|
+
});
|
|
80
|
+
});
|
|
81
|
+
describe('sample', () => {
|
|
82
|
+
it('returns undefined for an empty array', () => {
|
|
83
|
+
expect((0, utils_1.sample)([])).toBeUndefined();
|
|
84
|
+
});
|
|
85
|
+
it('returns a random element from the array', () => {
|
|
86
|
+
const numbers = [1, 2, 3, 4, 5];
|
|
87
|
+
const result = (0, utils_1.sample)(numbers);
|
|
88
|
+
expect(numbers.includes(result)).toBe(true);
|
|
89
|
+
});
|
|
90
|
+
it('returns only one of the elements of the array', () => {
|
|
91
|
+
const numbers = [1, 2, 3, 4, 5];
|
|
92
|
+
const result = (0, utils_1.sample)(numbers);
|
|
93
|
+
expect(numbers).toContain(result);
|
|
94
|
+
expect(numbers.indexOf(result)).not.toBe(-1);
|
|
95
|
+
});
|
|
96
|
+
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export {};
|
|
1
|
+
export {};
|
|
@@ -1,37 +1,37 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const utils_1 = require("../../utils");
|
|
4
|
-
describe('remsToPixels', () => {
|
|
5
|
-
it('should return 0 if rems is undefined', () => {
|
|
6
|
-
expect((0, utils_1.remsToPixels)()).toBe('0');
|
|
7
|
-
});
|
|
8
|
-
it('should return 0 without unit if rems is 0', () => {
|
|
9
|
-
expect((0, utils_1.remsToPixels)('0')).toBe('0');
|
|
10
|
-
});
|
|
11
|
-
it('should convert rems to pixels for single values without unit', () => {
|
|
12
|
-
expect((0, utils_1.remsToPixels)('1')).toBe('10px');
|
|
13
|
-
expect((0, utils_1.remsToPixels)('1.5')).toBe('15px');
|
|
14
|
-
expect((0, utils_1.remsToPixels)('2')).toBe('20px');
|
|
15
|
-
expect((0, utils_1.remsToPixels)('2.5')).toBe('25px');
|
|
16
|
-
});
|
|
17
|
-
it('should convert rems to pixels for single values', () => {
|
|
18
|
-
expect((0, utils_1.remsToPixels)('1rem')).toBe('10px');
|
|
19
|
-
expect((0, utils_1.remsToPixels)('1.5rem')).toBe('15px');
|
|
20
|
-
expect((0, utils_1.remsToPixels)('2rem')).toBe('20px');
|
|
21
|
-
expect((0, utils_1.remsToPixels)('2.5rem')).toBe('25px');
|
|
22
|
-
});
|
|
23
|
-
it('should preseve negative values', () => {
|
|
24
|
-
expect((0, utils_1.remsToPixels)('-1rem')).toBe('-10px');
|
|
25
|
-
expect((0, utils_1.remsToPixels)('-1.5rem')).toBe('-15px');
|
|
26
|
-
});
|
|
27
|
-
it('should convert multiple values rems to pixels', () => {
|
|
28
|
-
expect((0, utils_1.remsToPixels)('1rem 2rem')).toBe('10px 20px');
|
|
29
|
-
expect((0, utils_1.remsToPixels)('1rem 2rem 3rem')).toBe('10px 20px 30px');
|
|
30
|
-
expect((0, utils_1.remsToPixels)('1rem 2rem 3rem 4rem')).toBe('10px 20px 30px 40px');
|
|
31
|
-
});
|
|
32
|
-
it('should ignore whitespaces around the input', () => {
|
|
33
|
-
expect((0, utils_1.remsToPixels)(' ')).toBe('0');
|
|
34
|
-
expect((0, utils_1.remsToPixels)(' 1.5rem ')).toBe('15px');
|
|
35
|
-
expect((0, utils_1.remsToPixels)(' 1.5rem 2rem')).toBe('15px 20px');
|
|
36
|
-
});
|
|
37
|
-
});
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const utils_1 = require("../../utils");
|
|
4
|
+
describe('remsToPixels', () => {
|
|
5
|
+
it('should return 0 if rems is undefined', () => {
|
|
6
|
+
expect((0, utils_1.remsToPixels)()).toBe('0');
|
|
7
|
+
});
|
|
8
|
+
it('should return 0 without unit if rems is 0', () => {
|
|
9
|
+
expect((0, utils_1.remsToPixels)('0')).toBe('0');
|
|
10
|
+
});
|
|
11
|
+
it('should convert rems to pixels for single values without unit', () => {
|
|
12
|
+
expect((0, utils_1.remsToPixels)('1')).toBe('10px');
|
|
13
|
+
expect((0, utils_1.remsToPixels)('1.5')).toBe('15px');
|
|
14
|
+
expect((0, utils_1.remsToPixels)('2')).toBe('20px');
|
|
15
|
+
expect((0, utils_1.remsToPixels)('2.5')).toBe('25px');
|
|
16
|
+
});
|
|
17
|
+
it('should convert rems to pixels for single values', () => {
|
|
18
|
+
expect((0, utils_1.remsToPixels)('1rem')).toBe('10px');
|
|
19
|
+
expect((0, utils_1.remsToPixels)('1.5rem')).toBe('15px');
|
|
20
|
+
expect((0, utils_1.remsToPixels)('2rem')).toBe('20px');
|
|
21
|
+
expect((0, utils_1.remsToPixels)('2.5rem')).toBe('25px');
|
|
22
|
+
});
|
|
23
|
+
it('should preseve negative values', () => {
|
|
24
|
+
expect((0, utils_1.remsToPixels)('-1rem')).toBe('-10px');
|
|
25
|
+
expect((0, utils_1.remsToPixels)('-1.5rem')).toBe('-15px');
|
|
26
|
+
});
|
|
27
|
+
it('should convert multiple values rems to pixels', () => {
|
|
28
|
+
expect((0, utils_1.remsToPixels)('1rem 2rem')).toBe('10px 20px');
|
|
29
|
+
expect((0, utils_1.remsToPixels)('1rem 2rem 3rem')).toBe('10px 20px 30px');
|
|
30
|
+
expect((0, utils_1.remsToPixels)('1rem 2rem 3rem 4rem')).toBe('10px 20px 30px 40px');
|
|
31
|
+
});
|
|
32
|
+
it('should ignore whitespaces around the input', () => {
|
|
33
|
+
expect((0, utils_1.remsToPixels)(' ')).toBe('0');
|
|
34
|
+
expect((0, utils_1.remsToPixels)(' 1.5rem ')).toBe('15px');
|
|
35
|
+
expect((0, utils_1.remsToPixels)(' 1.5rem 2rem')).toBe('15px 20px');
|
|
36
|
+
});
|
|
37
|
+
});
|
|
@@ -1,35 +1,35 @@
|
|
|
1
|
-
export * from './types';
|
|
2
|
-
export * from './useAccordion';
|
|
3
|
-
export * from './useAddressForm';
|
|
4
|
-
export * from './useAllergenForm';
|
|
5
|
-
export * from './useBuilder';
|
|
6
|
-
export * from './useCartGuestForm';
|
|
7
|
-
export * from './useCartPoints';
|
|
8
|
-
export * from './useLoginForm';
|
|
9
|
-
export * from './useCreditCard';
|
|
10
|
-
export * from './useCreditCardForm';
|
|
11
|
-
export * from './useCurbside';
|
|
12
|
-
export * from './useDineInForm';
|
|
13
|
-
export * from './useDonationForm';
|
|
14
|
-
export * from './useFirstTimes';
|
|
15
|
-
export * from './useGiftCardAssignForm';
|
|
16
|
-
export * from './useGiftCardAssignOtherForm';
|
|
17
|
-
export * from './useGiftCardForm';
|
|
18
|
-
export * from './useGiftCardsForm';
|
|
19
|
-
export * from './useGuestForm';
|
|
20
|
-
export * from './useGuestCheckoutForm';
|
|
21
|
-
export * from './useImage';
|
|
22
|
-
export * from './useMenuItem';
|
|
23
|
-
export * from './useModifier';
|
|
24
|
-
export * from './useModifierGroup';
|
|
25
|
-
export * from './useOneTimePasscodeForm';
|
|
26
|
-
export * from './useOrderFulfillmentForm';
|
|
27
|
-
export * from './useOrderItem';
|
|
28
|
-
export * from './useOrderRating';
|
|
29
|
-
export * from './useOrderRatingForm';
|
|
30
|
-
export * from './useProfileForm';
|
|
31
|
-
export * from './useResetPasswordForm';
|
|
32
|
-
export * from './useSendResetForm';
|
|
33
|
-
export * from './useSigninForm';
|
|
34
|
-
export * from './useSignUpGuestForm';
|
|
35
|
-
export * from './useSignUpForm';
|
|
1
|
+
export * from './types';
|
|
2
|
+
export * from './useAccordion';
|
|
3
|
+
export * from './useAddressForm';
|
|
4
|
+
export * from './useAllergenForm';
|
|
5
|
+
export * from './useBuilder';
|
|
6
|
+
export * from './useCartGuestForm';
|
|
7
|
+
export * from './useCartPoints';
|
|
8
|
+
export * from './useLoginForm';
|
|
9
|
+
export * from './useCreditCard';
|
|
10
|
+
export * from './useCreditCardForm';
|
|
11
|
+
export * from './useCurbside';
|
|
12
|
+
export * from './useDineInForm';
|
|
13
|
+
export * from './useDonationForm';
|
|
14
|
+
export * from './useFirstTimes';
|
|
15
|
+
export * from './useGiftCardAssignForm';
|
|
16
|
+
export * from './useGiftCardAssignOtherForm';
|
|
17
|
+
export * from './useGiftCardForm';
|
|
18
|
+
export * from './useGiftCardsForm';
|
|
19
|
+
export * from './useGuestForm';
|
|
20
|
+
export * from './useGuestCheckoutForm';
|
|
21
|
+
export * from './useImage';
|
|
22
|
+
export * from './useMenuItem';
|
|
23
|
+
export * from './useModifier';
|
|
24
|
+
export * from './useModifierGroup';
|
|
25
|
+
export * from './useOneTimePasscodeForm';
|
|
26
|
+
export * from './useOrderFulfillmentForm';
|
|
27
|
+
export * from './useOrderItem';
|
|
28
|
+
export * from './useOrderRating';
|
|
29
|
+
export * from './useOrderRatingForm';
|
|
30
|
+
export * from './useProfileForm';
|
|
31
|
+
export * from './useResetPasswordForm';
|
|
32
|
+
export * from './useSendResetForm';
|
|
33
|
+
export * from './useSigninForm';
|
|
34
|
+
export * from './useSignUpGuestForm';
|
|
35
|
+
export * from './useSignUpForm';
|
package/dist/cjs/hooks/index.js
CHANGED
|
@@ -1,38 +1,38 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const tslib_1 = require("tslib");
|
|
4
|
-
tslib_1.__exportStar(require("./types"), exports);
|
|
5
|
-
tslib_1.__exportStar(require("./useAccordion"), exports);
|
|
6
|
-
tslib_1.__exportStar(require("./useAddressForm"), exports);
|
|
7
|
-
tslib_1.__exportStar(require("./useAllergenForm"), exports);
|
|
8
|
-
tslib_1.__exportStar(require("./useBuilder"), exports);
|
|
9
|
-
tslib_1.__exportStar(require("./useCartGuestForm"), exports);
|
|
10
|
-
tslib_1.__exportStar(require("./useCartPoints"), exports);
|
|
11
|
-
tslib_1.__exportStar(require("./useLoginForm"), exports);
|
|
12
|
-
tslib_1.__exportStar(require("./useCreditCard"), exports);
|
|
13
|
-
tslib_1.__exportStar(require("./useCreditCardForm"), exports);
|
|
14
|
-
tslib_1.__exportStar(require("./useCurbside"), exports);
|
|
15
|
-
tslib_1.__exportStar(require("./useDineInForm"), exports);
|
|
16
|
-
tslib_1.__exportStar(require("./useDonationForm"), exports);
|
|
17
|
-
tslib_1.__exportStar(require("./useFirstTimes"), exports);
|
|
18
|
-
tslib_1.__exportStar(require("./useGiftCardAssignForm"), exports);
|
|
19
|
-
tslib_1.__exportStar(require("./useGiftCardAssignOtherForm"), exports);
|
|
20
|
-
tslib_1.__exportStar(require("./useGiftCardForm"), exports);
|
|
21
|
-
tslib_1.__exportStar(require("./useGiftCardsForm"), exports);
|
|
22
|
-
tslib_1.__exportStar(require("./useGuestForm"), exports);
|
|
23
|
-
tslib_1.__exportStar(require("./useGuestCheckoutForm"), exports);
|
|
24
|
-
tslib_1.__exportStar(require("./useImage"), exports);
|
|
25
|
-
tslib_1.__exportStar(require("./useMenuItem"), exports);
|
|
26
|
-
tslib_1.__exportStar(require("./useModifier"), exports);
|
|
27
|
-
tslib_1.__exportStar(require("./useModifierGroup"), exports);
|
|
28
|
-
tslib_1.__exportStar(require("./useOneTimePasscodeForm"), exports);
|
|
29
|
-
tslib_1.__exportStar(require("./useOrderFulfillmentForm"), exports);
|
|
30
|
-
tslib_1.__exportStar(require("./useOrderItem"), exports);
|
|
31
|
-
tslib_1.__exportStar(require("./useOrderRating"), exports);
|
|
32
|
-
tslib_1.__exportStar(require("./useOrderRatingForm"), exports);
|
|
33
|
-
tslib_1.__exportStar(require("./useProfileForm"), exports);
|
|
34
|
-
tslib_1.__exportStar(require("./useResetPasswordForm"), exports);
|
|
35
|
-
tslib_1.__exportStar(require("./useSendResetForm"), exports);
|
|
36
|
-
tslib_1.__exportStar(require("./useSigninForm"), exports);
|
|
37
|
-
tslib_1.__exportStar(require("./useSignUpGuestForm"), exports);
|
|
38
|
-
tslib_1.__exportStar(require("./useSignUpForm"), exports);
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
tslib_1.__exportStar(require("./types"), exports);
|
|
5
|
+
tslib_1.__exportStar(require("./useAccordion"), exports);
|
|
6
|
+
tslib_1.__exportStar(require("./useAddressForm"), exports);
|
|
7
|
+
tslib_1.__exportStar(require("./useAllergenForm"), exports);
|
|
8
|
+
tslib_1.__exportStar(require("./useBuilder"), exports);
|
|
9
|
+
tslib_1.__exportStar(require("./useCartGuestForm"), exports);
|
|
10
|
+
tslib_1.__exportStar(require("./useCartPoints"), exports);
|
|
11
|
+
tslib_1.__exportStar(require("./useLoginForm"), exports);
|
|
12
|
+
tslib_1.__exportStar(require("./useCreditCard"), exports);
|
|
13
|
+
tslib_1.__exportStar(require("./useCreditCardForm"), exports);
|
|
14
|
+
tslib_1.__exportStar(require("./useCurbside"), exports);
|
|
15
|
+
tslib_1.__exportStar(require("./useDineInForm"), exports);
|
|
16
|
+
tslib_1.__exportStar(require("./useDonationForm"), exports);
|
|
17
|
+
tslib_1.__exportStar(require("./useFirstTimes"), exports);
|
|
18
|
+
tslib_1.__exportStar(require("./useGiftCardAssignForm"), exports);
|
|
19
|
+
tslib_1.__exportStar(require("./useGiftCardAssignOtherForm"), exports);
|
|
20
|
+
tslib_1.__exportStar(require("./useGiftCardForm"), exports);
|
|
21
|
+
tslib_1.__exportStar(require("./useGiftCardsForm"), exports);
|
|
22
|
+
tslib_1.__exportStar(require("./useGuestForm"), exports);
|
|
23
|
+
tslib_1.__exportStar(require("./useGuestCheckoutForm"), exports);
|
|
24
|
+
tslib_1.__exportStar(require("./useImage"), exports);
|
|
25
|
+
tslib_1.__exportStar(require("./useMenuItem"), exports);
|
|
26
|
+
tslib_1.__exportStar(require("./useModifier"), exports);
|
|
27
|
+
tslib_1.__exportStar(require("./useModifierGroup"), exports);
|
|
28
|
+
tslib_1.__exportStar(require("./useOneTimePasscodeForm"), exports);
|
|
29
|
+
tslib_1.__exportStar(require("./useOrderFulfillmentForm"), exports);
|
|
30
|
+
tslib_1.__exportStar(require("./useOrderItem"), exports);
|
|
31
|
+
tslib_1.__exportStar(require("./useOrderRating"), exports);
|
|
32
|
+
tslib_1.__exportStar(require("./useOrderRatingForm"), exports);
|
|
33
|
+
tslib_1.__exportStar(require("./useProfileForm"), exports);
|
|
34
|
+
tslib_1.__exportStar(require("./useResetPasswordForm"), exports);
|
|
35
|
+
tslib_1.__exportStar(require("./useSendResetForm"), exports);
|
|
36
|
+
tslib_1.__exportStar(require("./useSigninForm"), exports);
|
|
37
|
+
tslib_1.__exportStar(require("./useSignUpGuestForm"), exports);
|
|
38
|
+
tslib_1.__exportStar(require("./useSignUpForm"), exports);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export interface Field {
|
|
2
|
-
blur?: () => void;
|
|
3
|
-
focus?: () => void;
|
|
4
|
-
}
|
|
1
|
+
export interface Field {
|
|
2
|
+
blur?: () => void;
|
|
3
|
+
focus?: () => void;
|
|
4
|
+
}
|
package/dist/cjs/hooks/types.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { CartItem, CartLevels, ConfigAccordion } from '@open-tender/types';
|
|
3
|
-
export declare const useAccordion: (builtItem: CartItem, toggleOption: (levels: CartLevels) => void, cartId?: number | null, config?: ConfigAccordion) => {
|
|
4
|
-
open: string | null;
|
|
5
|
-
setOpen: import("react").Dispatch<import("react").SetStateAction<string | null>>;
|
|
6
|
-
groups: import("@open-tender/types").CartItemGroups;
|
|
7
|
-
ingredients: string | null;
|
|
8
|
-
totalCals: number | null;
|
|
9
|
-
madeFor: string | null;
|
|
10
|
-
notes: string | null;
|
|
11
|
-
hasMadeFor: boolean;
|
|
12
|
-
hasNotes: boolean;
|
|
13
|
-
hasInstructions: boolean;
|
|
14
|
-
hasCals: boolean;
|
|
15
|
-
nutritionalInfo: import("@open-tender/types").NutritionalInfo | null;
|
|
16
|
-
hasIngredients: boolean;
|
|
17
|
-
instructionsTitle: string;
|
|
18
|
-
sizeGroup: import("@open-tender/types").CartItemGroup | null | undefined;
|
|
19
|
-
selectedSize: import("@open-tender/types").CartItemOption | null | undefined;
|
|
20
|
-
showAccordion: boolean | import("@open-tender/types").CartItemGroup;
|
|
21
|
-
toggleSize: (optionId: number) => void;
|
|
22
|
-
};
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { CartItem, CartLevels, ConfigAccordion } from '@open-tender/types';
|
|
3
|
+
export declare const useAccordion: (builtItem: CartItem, toggleOption: (levels: CartLevels) => void, cartId?: number | null, config?: ConfigAccordion) => {
|
|
4
|
+
open: string | null;
|
|
5
|
+
setOpen: import("react").Dispatch<import("react").SetStateAction<string | null>>;
|
|
6
|
+
groups: import("@open-tender/types").CartItemGroups;
|
|
7
|
+
ingredients: string | null;
|
|
8
|
+
totalCals: number | null;
|
|
9
|
+
madeFor: string | null;
|
|
10
|
+
notes: string | null;
|
|
11
|
+
hasMadeFor: boolean;
|
|
12
|
+
hasNotes: boolean;
|
|
13
|
+
hasInstructions: boolean;
|
|
14
|
+
hasCals: boolean;
|
|
15
|
+
nutritionalInfo: import("@open-tender/types").NutritionalInfo | null;
|
|
16
|
+
hasIngredients: boolean;
|
|
17
|
+
instructionsTitle: string;
|
|
18
|
+
sizeGroup: import("@open-tender/types").CartItemGroup | null | undefined;
|
|
19
|
+
selectedSize: import("@open-tender/types").CartItemOption | null | undefined;
|
|
20
|
+
showAccordion: boolean | import("@open-tender/types").CartItemGroup;
|
|
21
|
+
toggleSize: (optionId: number) => void;
|
|
22
|
+
};
|