@merchi/cart 1.4.4
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 +21 -0
- package/README.md +134 -0
- package/esm/Cart.js +62 -0
- package/esm/CartAlert.js +47 -0
- package/esm/CartHeader.js +29 -0
- package/esm/CartProvider.js +1101 -0
- package/esm/CartTotals.js +89 -0
- package/esm/assets/merchi-monster-loader.gif +0 -0
- package/esm/assets/merchi-swipe-outline.png +0 -0
- package/esm/assets/product-not-found.png +0 -0
- package/esm/assets/stripe-payment-secure.png +0 -0
- package/esm/buttons/Button.js +23 -0
- package/esm/buttons/ButtonBack.js +35 -0
- package/esm/buttons/ButtonClearCart.js +17 -0
- package/esm/buttons/ButtonInvoiceDownload.js +88 -0
- package/esm/buttons/ButtonNext.js +39 -0
- package/esm/buttons/ButtonNextDynamic.js +19 -0
- package/esm/buttons/ButtonOpenCartMerchiCartModal.js +47 -0
- package/esm/buttons/ButtonPay.js +26 -0
- package/esm/buttons/ButtonShipmentTabNext.js +28 -0
- package/esm/buttons/index.js +7 -0
- package/esm/components/Alert.js +26 -0
- package/esm/components/CartBody.js +14 -0
- package/esm/components/CartClient.js +62 -0
- package/esm/components/CartFooter.js +12 -0
- package/esm/components/CartItemRow.js +230 -0
- package/esm/components/CartPaymentSettingsInvalid.js +13 -0
- package/esm/components/CartShipment.js +52 -0
- package/esm/components/CartTabContent.js +12 -0
- package/esm/components/CartTabPanel.js +25 -0
- package/esm/components/CartTableContainer.js +12 -0
- package/esm/components/CartTitle.js +26 -0
- package/esm/components/CartTotalsListGroup.js +71 -0
- package/esm/components/Collapse.js +32 -0
- package/esm/components/CustomCartProductForm.js +128 -0
- package/esm/components/CustomerCheckoutMethodTabs.js +94 -0
- package/esm/components/DiscountInputGroup.js +293 -0
- package/esm/components/LoadingTemplate.js +23 -0
- package/esm/components/NoCartItems.js +20 -0
- package/esm/components/ShipmentGroupCard.js +207 -0
- package/esm/components/Table.js +13 -0
- package/esm/components/containers.js +31 -0
- package/esm/components/index.js +18 -0
- package/esm/components/product-form-sdk-externals.js +36 -0
- package/esm/forms/FormNewCustomer.js +243 -0
- package/esm/forms/FormReturningCustomer.js +165 -0
- package/esm/forms/FormShipmentAddressAndNotes.js +195 -0
- package/esm/forms/FormSquarePayment.js +19 -0
- package/esm/forms/FormStripePayment.js +19 -0
- package/esm/forms/FormWhatsappCustomer.js +253 -0
- package/esm/forms/InputAcceptUserTermsAndConditions.js +35 -0
- package/esm/forms/InputError.js +16 -0
- package/esm/forms/InputSelect.js +48 -0
- package/esm/forms/InputText.js +56 -0
- package/esm/forms/InputsAddress.js +476 -0
- package/esm/forms/index.js +8 -0
- package/esm/index.js +13 -0
- package/esm/modals.js +51 -0
- package/esm/panels/PanelCartItems.js +49 -0
- package/esm/panels/PanelCartShipment.js +66 -0
- package/esm/panels/PanelClearCart.js +56 -0
- package/esm/panels/PanelClientCheckout.js +81 -0
- package/esm/panels/PanelEditCartItem.js +199 -0
- package/esm/panels/PanelPaymentSuccess.js +63 -0
- package/esm/panels/index.js +7 -0
- package/esm/square/SquareCard.js +106 -0
- package/esm/stripe/LegacyStripeCardForm.js +157 -0
- package/esm/stripe/StripeCardFields.js +126 -0
- package/esm/stripe/StripeCardForm.js +33 -0
- package/esm/stripe/StripePaymentButtons.js +98 -0
- package/esm/stripe/actions.js +192 -0
- package/esm/stripe/utils.js +20 -0
- package/esm/styles/globals.css +463 -0
- package/esm/styles/globals.css.map +1 -0
- package/esm/tabs/CartNav.js +28 -0
- package/esm/tabs/NavTab.js +31 -0
- package/esm/types/assets.d.js +0 -0
- package/esm/types/index.js +1 -0
- package/esm/types/merchi_product_form/index.d.js +0 -0
- package/esm/types/merchi_sdk_ts/index.d.js +0 -0
- package/esm/types/react-redux/index.d.js +0 -0
- package/esm/utilities/address.js +457 -0
- package/esm/utilities/area.js +297 -0
- package/esm/utilities/cart.js +95 -0
- package/esm/utilities/company.js +6 -0
- package/esm/utilities/cookie.js +156 -0
- package/esm/utilities/currency.js +219 -0
- package/esm/utilities/customForm.js +57 -0
- package/esm/utilities/helpers.js +229 -0
- package/esm/utilities/index.js +14 -0
- package/esm/utilities/invoice.js +112 -0
- package/esm/utilities/job.js +9 -0
- package/esm/utilities/local_storage.js +85 -0
- package/esm/utilities/product.js +13 -0
- package/esm/utilities/shipment.js +11 -0
- package/esm/utilities/tabs.js +51 -0
- package/esm/utilities/user.js +65 -0
- package/esm/utilities/variations.js +58 -0
- package/lib/Cart.d.ts +9 -0
- package/lib/Cart.js +69 -0
- package/lib/CartAlert.d.ts +3 -0
- package/lib/CartAlert.js +53 -0
- package/lib/CartHeader.d.ts +3 -0
- package/lib/CartHeader.js +37 -0
- package/lib/CartProvider.d.ts +236 -0
- package/lib/CartProvider.js +1107 -0
- package/lib/CartTotals.d.ts +7 -0
- package/lib/CartTotals.js +96 -0
- package/lib/assets/merchi-monster-loader.gif +0 -0
- package/lib/assets/merchi-swipe-outline.png +0 -0
- package/lib/assets/product-not-found.png +0 -0
- package/lib/assets/stripe-payment-secure.png +0 -0
- package/lib/buttons/Button.d.ts +11 -0
- package/lib/buttons/Button.js +31 -0
- package/lib/buttons/ButtonBack.d.ts +6 -0
- package/lib/buttons/ButtonBack.js +44 -0
- package/lib/buttons/ButtonClearCart.d.ts +3 -0
- package/lib/buttons/ButtonClearCart.js +24 -0
- package/lib/buttons/ButtonInvoiceDownload.d.ts +3 -0
- package/lib/buttons/ButtonInvoiceDownload.js +96 -0
- package/lib/buttons/ButtonNext.d.ts +3 -0
- package/lib/buttons/ButtonNext.js +48 -0
- package/lib/buttons/ButtonNextDynamic.d.ts +3 -0
- package/lib/buttons/ButtonNextDynamic.js +28 -0
- package/lib/buttons/ButtonOpenCartMerchiCartModal.d.ts +9 -0
- package/lib/buttons/ButtonOpenCartMerchiCartModal.js +57 -0
- package/lib/buttons/ButtonPay.d.ts +7 -0
- package/lib/buttons/ButtonPay.js +35 -0
- package/lib/buttons/ButtonShipmentTabNext.d.ts +2 -0
- package/lib/buttons/ButtonShipmentTabNext.js +37 -0
- package/lib/buttons/index.d.ts +7 -0
- package/lib/buttons/index.js +48 -0
- package/lib/components/Alert.d.ts +7 -0
- package/lib/components/Alert.js +34 -0
- package/lib/components/CartBody.d.ts +7 -0
- package/lib/components/CartBody.js +22 -0
- package/lib/components/CartClient.d.ts +4 -0
- package/lib/components/CartClient.js +71 -0
- package/lib/components/CartFooter.d.ts +6 -0
- package/lib/components/CartFooter.js +20 -0
- package/lib/components/CartItemRow.d.ts +7 -0
- package/lib/components/CartItemRow.js +236 -0
- package/lib/components/CartPaymentSettingsInvalid.d.ts +2 -0
- package/lib/components/CartPaymentSettingsInvalid.js +21 -0
- package/lib/components/CartShipment.d.ts +6 -0
- package/lib/components/CartShipment.js +59 -0
- package/lib/components/CartTabContent.d.ts +6 -0
- package/lib/components/CartTabContent.js +20 -0
- package/lib/components/CartTabPanel.d.ts +7 -0
- package/lib/components/CartTabPanel.js +31 -0
- package/lib/components/CartTableContainer.d.ts +6 -0
- package/lib/components/CartTableContainer.js +20 -0
- package/lib/components/CartTitle.d.ts +2 -0
- package/lib/components/CartTitle.js +34 -0
- package/lib/components/CartTotalsListGroup.d.ts +3 -0
- package/lib/components/CartTotalsListGroup.js +78 -0
- package/lib/components/Collapse.d.ts +3 -0
- package/lib/components/Collapse.js +40 -0
- package/lib/components/CustomCartProductForm.d.ts +18 -0
- package/lib/components/CustomCartProductForm.js +136 -0
- package/lib/components/CustomerCheckoutMethodTabs.d.ts +6 -0
- package/lib/components/CustomerCheckoutMethodTabs.js +103 -0
- package/lib/components/DiscountInputGroup.d.ts +2 -0
- package/lib/components/DiscountInputGroup.js +301 -0
- package/lib/components/LoadingTemplate.d.ts +7 -0
- package/lib/components/LoadingTemplate.js +30 -0
- package/lib/components/NoCartItems.d.ts +3 -0
- package/lib/components/NoCartItems.js +27 -0
- package/lib/components/ShipmentGroupCard.d.ts +7 -0
- package/lib/components/ShipmentGroupCard.js +215 -0
- package/lib/components/Table.d.ts +7 -0
- package/lib/components/Table.js +19 -0
- package/lib/components/containers.d.ts +14 -0
- package/lib/components/containers.js +40 -0
- package/lib/components/index.d.ts +18 -0
- package/lib/components/index.js +133 -0
- package/lib/components/product-form-sdk-externals.d.ts +46 -0
- package/lib/components/product-form-sdk-externals.js +43 -0
- package/lib/forms/FormNewCustomer.d.ts +4 -0
- package/lib/forms/FormNewCustomer.js +252 -0
- package/lib/forms/FormReturningCustomer.d.ts +3 -0
- package/lib/forms/FormReturningCustomer.js +173 -0
- package/lib/forms/FormShipmentAddressAndNotes.d.ts +15 -0
- package/lib/forms/FormShipmentAddressAndNotes.js +203 -0
- package/lib/forms/FormSquarePayment.d.ts +3 -0
- package/lib/forms/FormSquarePayment.js +27 -0
- package/lib/forms/FormStripePayment.d.ts +3 -0
- package/lib/forms/FormStripePayment.js +27 -0
- package/lib/forms/FormWhatsappCustomer.d.ts +3 -0
- package/lib/forms/FormWhatsappCustomer.js +261 -0
- package/lib/forms/InputAcceptUserTermsAndConditions.d.ts +7 -0
- package/lib/forms/InputAcceptUserTermsAndConditions.js +41 -0
- package/lib/forms/InputError.d.ts +8 -0
- package/lib/forms/InputError.js +24 -0
- package/lib/forms/InputSelect.d.ts +14 -0
- package/lib/forms/InputSelect.js +55 -0
- package/lib/forms/InputText.d.ts +12 -0
- package/lib/forms/InputText.js +63 -0
- package/lib/forms/InputsAddress.d.ts +11 -0
- package/lib/forms/InputsAddress.js +485 -0
- package/lib/forms/index.d.ts +8 -0
- package/lib/forms/index.js +63 -0
- package/lib/index.d.ts +13 -0
- package/lib/index.js +93 -0
- package/lib/modals.d.ts +17 -0
- package/lib/modals.js +59 -0
- package/lib/panels/PanelCartItems.d.ts +3 -0
- package/lib/panels/PanelCartItems.js +56 -0
- package/lib/panels/PanelCartShipment.d.ts +3 -0
- package/lib/panels/PanelCartShipment.js +72 -0
- package/lib/panels/PanelClearCart.d.ts +3 -0
- package/lib/panels/PanelClearCart.js +62 -0
- package/lib/panels/PanelClientCheckout.d.ts +3 -0
- package/lib/panels/PanelClientCheckout.js +88 -0
- package/lib/panels/PanelEditCartItem.d.ts +6 -0
- package/lib/panels/PanelEditCartItem.js +206 -0
- package/lib/panels/PanelPaymentSuccess.d.ts +3 -0
- package/lib/panels/PanelPaymentSuccess.js +69 -0
- package/lib/panels/index.d.ts +7 -0
- package/lib/panels/index.js +48 -0
- package/lib/square/SquareCard.d.ts +3 -0
- package/lib/square/SquareCard.js +114 -0
- package/lib/stripe/LegacyStripeCardForm.d.ts +3 -0
- package/lib/stripe/LegacyStripeCardForm.js +166 -0
- package/lib/stripe/StripeCardFields.d.ts +15 -0
- package/lib/stripe/StripeCardFields.js +135 -0
- package/lib/stripe/StripeCardForm.d.ts +2 -0
- package/lib/stripe/StripeCardForm.js +42 -0
- package/lib/stripe/StripePaymentButtons.d.ts +8 -0
- package/lib/stripe/StripePaymentButtons.js +106 -0
- package/lib/stripe/actions.d.ts +4 -0
- package/lib/stripe/actions.js +200 -0
- package/lib/stripe/utils.d.ts +18 -0
- package/lib/stripe/utils.js +27 -0
- package/lib/styles/globals.css +463 -0
- package/lib/styles/globals.css.map +1 -0
- package/lib/tabs/CartNav.d.ts +3 -0
- package/lib/tabs/CartNav.js +36 -0
- package/lib/tabs/NavTab.d.ts +9 -0
- package/lib/tabs/NavTab.js +39 -0
- package/lib/types/index.d.ts +13 -0
- package/lib/types/index.js +1 -0
- package/lib/utilities/address.d.ts +30 -0
- package/lib/utilities/address.js +468 -0
- package/lib/utilities/area.d.ts +77 -0
- package/lib/utilities/area.js +328 -0
- package/lib/utilities/cart.d.ts +9 -0
- package/lib/utilities/cart.js +108 -0
- package/lib/utilities/company.d.ts +2 -0
- package/lib/utilities/company.js +13 -0
- package/lib/utilities/cookie.d.ts +4 -0
- package/lib/utilities/cookie.js +165 -0
- package/lib/utilities/currency.d.ts +5 -0
- package/lib/utilities/currency.js +229 -0
- package/lib/utilities/customForm.d.ts +17 -0
- package/lib/utilities/customForm.js +64 -0
- package/lib/utilities/helpers.d.ts +24 -0
- package/lib/utilities/helpers.js +240 -0
- package/lib/utilities/index.d.ts +14 -0
- package/lib/utilities/index.js +159 -0
- package/lib/utilities/invoice.d.ts +3 -0
- package/lib/utilities/invoice.js +118 -0
- package/lib/utilities/job.d.ts +1 -0
- package/lib/utilities/job.js +15 -0
- package/lib/utilities/local_storage.d.ts +31 -0
- package/lib/utilities/local_storage.js +96 -0
- package/lib/utilities/product.d.ts +2 -0
- package/lib/utilities/product.js +21 -0
- package/lib/utilities/shipment.d.ts +2 -0
- package/lib/utilities/shipment.js +18 -0
- package/lib/utilities/tabs.d.ts +14 -0
- package/lib/utilities/tabs.js +60 -0
- package/lib/utilities/user.d.ts +5 -0
- package/lib/utilities/user.js +75 -0
- package/lib/utilities/variations.d.ts +18 -0
- package/lib/utilities/variations.js +66 -0
- package/package.json +109 -0
- package/src/Cart.tsx +96 -0
- package/src/CartAlert.tsx +35 -0
- package/src/CartHeader.tsx +28 -0
- package/src/CartProvider.tsx +992 -0
- package/src/CartTotals.tsx +102 -0
- package/src/assets/merchi-monster-loader.gif +0 -0
- package/src/assets/merchi-swipe-outline.png +0 -0
- package/src/assets/product-not-found.png +0 -0
- package/src/assets/stripe-payment-secure.png +0 -0
- package/src/buttons/Button.tsx +35 -0
- package/src/buttons/ButtonBack.tsx +42 -0
- package/src/buttons/ButtonClearCart.tsx +17 -0
- package/src/buttons/ButtonInvoiceDownload.tsx +60 -0
- package/src/buttons/ButtonNext.tsx +35 -0
- package/src/buttons/ButtonNextDynamic.tsx +31 -0
- package/src/buttons/ButtonOpenCartMerchiCartModal.tsx +61 -0
- package/src/buttons/ButtonPay.tsx +32 -0
- package/src/buttons/ButtonShipmentTabNext.tsx +24 -0
- package/src/buttons/index.ts +15 -0
- package/src/components/Alert.tsx +31 -0
- package/src/components/CartBody.tsx +16 -0
- package/src/components/CartClient.tsx +52 -0
- package/src/components/CartFooter.tsx +15 -0
- package/src/components/CartItemRow.tsx +212 -0
- package/src/components/CartPaymentSettingsInvalid.tsx +12 -0
- package/src/components/CartShipment.tsx +56 -0
- package/src/components/CartTabContent.tsx +15 -0
- package/src/components/CartTabPanel.tsx +25 -0
- package/src/components/CartTableContainer.tsx +15 -0
- package/src/components/CartTitle.tsx +22 -0
- package/src/components/CartTotalsListGroup.tsx +58 -0
- package/src/components/Collapse.tsx +23 -0
- package/src/components/CustomCartProductForm.tsx +123 -0
- package/src/components/CustomerCheckoutMethodTabs.tsx +106 -0
- package/src/components/DiscountInputGroup.tsx +160 -0
- package/src/components/LoadingTemplate.tsx +22 -0
- package/src/components/NoCartItems.tsx +20 -0
- package/src/components/ShipmentGroupCard.tsx +170 -0
- package/src/components/Table.tsx +15 -0
- package/src/components/containers.tsx +40 -0
- package/src/components/index.ts +38 -0
- package/src/components/product-form-sdk-externals.ts +67 -0
- package/src/forms/FormNewCustomer.tsx +170 -0
- package/src/forms/FormReturningCustomer.tsx +117 -0
- package/src/forms/FormShipmentAddressAndNotes.tsx +165 -0
- package/src/forms/FormSquarePayment.tsx +19 -0
- package/src/forms/FormStripePayment.tsx +19 -0
- package/src/forms/FormWhatsappCustomer.tsx +179 -0
- package/src/forms/InputAcceptUserTermsAndConditions.tsx +43 -0
- package/src/forms/InputError.tsx +23 -0
- package/src/forms/InputSelect.tsx +58 -0
- package/src/forms/InputText.tsx +56 -0
- package/src/forms/InputsAddress.tsx +438 -0
- package/src/forms/index.ts +18 -0
- package/src/index.ts +31 -0
- package/src/modals.tsx +65 -0
- package/src/panels/PanelCartItems.tsx +56 -0
- package/src/panels/PanelCartShipment.tsx +86 -0
- package/src/panels/PanelClearCart.tsx +50 -0
- package/src/panels/PanelClientCheckout.tsx +102 -0
- package/src/panels/PanelEditCartItem.tsx +172 -0
- package/src/panels/PanelPaymentSuccess.tsx +66 -0
- package/src/panels/index.ts +15 -0
- package/src/square/SquareCard.tsx +84 -0
- package/src/stripe/LegacyStripeCardForm.tsx +91 -0
- package/src/stripe/StripeCardFields.tsx +173 -0
- package/src/stripe/StripeCardForm.tsx +18 -0
- package/src/stripe/StripePaymentButtons.tsx +117 -0
- package/src/stripe/actions.ts +94 -0
- package/src/stripe/utils.ts +22 -0
- package/src/styles/globals.scss +475 -0
- package/src/tabs/CartNav.tsx +18 -0
- package/src/tabs/NavTab.tsx +36 -0
- package/src/types/assets.d.ts +4 -0
- package/src/types/index.ts +15 -0
- package/src/types/merchi_product_form/index.d.ts +1 -0
- package/src/types/merchi_sdk_ts/index.d.ts +1 -0
- package/src/types/react-redux/index.d.ts +0 -0
- package/src/utilities/address.ts +463 -0
- package/src/utilities/area.ts +359 -0
- package/src/utilities/cart.ts +80 -0
- package/src/utilities/company.ts +8 -0
- package/src/utilities/cookie.ts +58 -0
- package/src/utilities/currency.ts +216 -0
- package/src/utilities/customForm.ts +71 -0
- package/src/utilities/helpers.ts +213 -0
- package/src/utilities/index.ts +14 -0
- package/src/utilities/invoice.ts +60 -0
- package/src/utilities/job.ts +13 -0
- package/src/utilities/local_storage.ts +130 -0
- package/src/utilities/product.ts +14 -0
- package/src/utilities/shipment.ts +11 -0
- package/src/utilities/tabs.ts +38 -0
- package/src/utilities/user.ts +33 -0
- package/src/utilities/variations.ts +80 -0
|
@@ -0,0 +1,301 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports["default"] = DiscountInputGroup;
|
|
8
|
+
var React = _interopRequireWildcard(require("react"));
|
|
9
|
+
var _reactHookForm = require("react-hook-form");
|
|
10
|
+
var _sdk = require("@merchi/sdk");
|
|
11
|
+
var _reactFontawesome = require("@fortawesome/react-fontawesome");
|
|
12
|
+
var _freeSolidSvgIcons = require("@fortawesome/free-solid-svg-icons");
|
|
13
|
+
var _CartProvider = require("../CartProvider");
|
|
14
|
+
var _CartTitle = _interopRequireDefault(require("./CartTitle"));
|
|
15
|
+
var _cart2 = require("../utilities/cart");
|
|
16
|
+
var _helpers = require("../utilities/helpers");
|
|
17
|
+
var _cookie = require("../utilities/cookie");
|
|
18
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
19
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
20
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, "default": e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t3 in e) "default" !== _t3 && {}.hasOwnProperty.call(e, _t3) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t3)) && (i.get || i.set) ? o(f, _t3, i) : f[_t3] = e[_t3]); return f; })(e, t); }
|
|
21
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
22
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
23
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
24
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
25
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
26
|
+
function _regenerator() { /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ var e, t, r = "function" == typeof Symbol ? Symbol : {}, n = r.iterator || "@@iterator", o = r.toStringTag || "@@toStringTag"; function i(r, n, o, i) { var c = n && n.prototype instanceof Generator ? n : Generator, u = Object.create(c.prototype); return _regeneratorDefine2(u, "_invoke", function (r, n, o) { var i, c, u, f = 0, p = o || [], y = !1, G = { p: 0, n: 0, v: e, a: d, f: d.bind(e, 4), d: function d(t, r) { return i = t, c = 0, u = e, G.n = r, a; } }; function d(r, n) { for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) { var o, i = p[t], d = G.p, l = i[2]; r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0)); } if (o || r > 1) return a; throw y = !0, n; } return function (o, p, l) { if (f > 1) throw TypeError("Generator is already running"); for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) { i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u); try { if (f = 2, i) { if (c || (o = "next"), t = i[o]) { if (!(t = t.call(i, u))) throw TypeError("iterator result is not an object"); if (!t.done) return t; u = t.value, c < 2 && (c = 0); } else 1 === c && (t = i["return"]) && t.call(i), c < 2 && (u = TypeError("The iterator does not provide a '" + o + "' method"), c = 1); i = e; } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break; } catch (t) { i = e, c = 1, u = t; } finally { f = 1; } } return { value: t, done: y }; }; }(r, o, i), !0), u; } var a = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} t = Object.getPrototypeOf; var c = [][n] ? t(t([][n]())) : (_regeneratorDefine2(t = {}, n, function () { return this; }), t), u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c); function f(e) { return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, _regeneratorDefine2(e, o, "GeneratorFunction")), e.prototype = Object.create(u), e; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, _regeneratorDefine2(u, "constructor", GeneratorFunctionPrototype), _regeneratorDefine2(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = "GeneratorFunction", _regeneratorDefine2(GeneratorFunctionPrototype, o, "GeneratorFunction"), _regeneratorDefine2(u), _regeneratorDefine2(u, o, "Generator"), _regeneratorDefine2(u, n, function () { return this; }), _regeneratorDefine2(u, "toString", function () { return "[object Generator]"; }), (_regenerator = function _regenerator() { return { w: i, m: f }; })(); }
|
|
27
|
+
function _regeneratorDefine2(e, r, n, t) { var i = Object.defineProperty; try { i({}, "", {}); } catch (e) { i = 0; } _regeneratorDefine2 = function _regeneratorDefine(e, r, n, t) { function o(r, n) { _regeneratorDefine2(e, r, function (e) { return this._invoke(r, n, e); }); } r ? i ? i(e, r, { value: n, enumerable: !t, configurable: !t, writable: !t }) : e[r] = n : (o("next", 0), o("throw", 1), o("return", 2)); }, _regeneratorDefine2(e, r, n, t); }
|
|
28
|
+
function asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }
|
|
29
|
+
function _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; }
|
|
30
|
+
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
31
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
32
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
33
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
34
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
35
|
+
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
36
|
+
function DiscountInputGroup() {
|
|
37
|
+
var _codes;
|
|
38
|
+
var _useCartContext = (0, _CartProvider.useCartContext)(),
|
|
39
|
+
alertError = _useCartContext.alertError,
|
|
40
|
+
cart = _useCartContext.cart,
|
|
41
|
+
setCart = _useCartContext.setCart,
|
|
42
|
+
_useCartContext$disco = _useCartContext.discountButtonText,
|
|
43
|
+
discountButtonText = _useCartContext$disco === void 0 ? 'Apply' : _useCartContext$disco,
|
|
44
|
+
_useCartContext$disco2 = _useCartContext.discountClassName,
|
|
45
|
+
discountClassName = _useCartContext$disco2 === void 0 ? 'merchi-discount-group-container' : _useCartContext$disco2,
|
|
46
|
+
_useCartContext$disco3 = _useCartContext.discountClassNameButton,
|
|
47
|
+
discountClassNameButton = _useCartContext$disco3 === void 0 ? 'btn btn-primary' : _useCartContext$disco3,
|
|
48
|
+
_useCartContext$disco4 = _useCartContext.discountClassNameButtonContainer,
|
|
49
|
+
discountClassNameButtonContainer = _useCartContext$disco4 === void 0 ? 'col-auto' : _useCartContext$disco4,
|
|
50
|
+
_useCartContext$disco5 = _useCartContext.discountClassNameButtonItemRemove,
|
|
51
|
+
discountClassNameButtonItemRemove = _useCartContext$disco5 === void 0 ? 'btn btn-lg btn-link' : _useCartContext$disco5,
|
|
52
|
+
_useCartContext$disco6 = _useCartContext.discountClassNameErrorMessage,
|
|
53
|
+
discountClassNameErrorMessage = _useCartContext$disco6 === void 0 ? 'text-danger' : _useCartContext$disco6,
|
|
54
|
+
_useCartContext$disco7 = _useCartContext.discountClassNameInput,
|
|
55
|
+
discountClassNameInput = _useCartContext$disco7 === void 0 ? 'form-control input-lg' : _useCartContext$disco7,
|
|
56
|
+
discountClassNameInputContainer = _useCartContext.discountClassNameInputContainer,
|
|
57
|
+
_useCartContext$disco8 = _useCartContext.discountClassNameListItem,
|
|
58
|
+
discountClassNameListItem = _useCartContext$disco8 === void 0 ? 'list-group-item d-flex align-items-center justify-content-between mt-2' : _useCartContext$disco8,
|
|
59
|
+
_useCartContext$disco9 = _useCartContext.discountClassNameListItems,
|
|
60
|
+
discountClassNameListItems = _useCartContext$disco9 === void 0 ? 'list-group' : _useCartContext$disco9,
|
|
61
|
+
discountClassNameMainContainer = _useCartContext.discountClassNameMainContainer,
|
|
62
|
+
discountShowAppliedItems = _useCartContext.discountShowAppliedItems,
|
|
63
|
+
domainId = _useCartContext.domainId;
|
|
64
|
+
var _cart$discountItems = cart.discountItems,
|
|
65
|
+
discountItems = _cart$discountItems === void 0 ? [] : _cart$discountItems;
|
|
66
|
+
var defaultCodes = discountItems.map(function (i) {
|
|
67
|
+
return i.code;
|
|
68
|
+
}).join(',');
|
|
69
|
+
var merchi = new _sdk.Merchi();
|
|
70
|
+
var hookForm = (0, _reactHookForm.useForm)({
|
|
71
|
+
defaultValues: {
|
|
72
|
+
codes: defaultCodes
|
|
73
|
+
}
|
|
74
|
+
});
|
|
75
|
+
var getValues = hookForm.getValues,
|
|
76
|
+
register = hookForm.register,
|
|
77
|
+
setValue = hookForm.setValue,
|
|
78
|
+
trigger = hookForm.trigger,
|
|
79
|
+
errors = hookForm.formState.errors;
|
|
80
|
+
var _React$useState = React.useState(false),
|
|
81
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
82
|
+
loading = _React$useState2[0],
|
|
83
|
+
setLoading = _React$useState2[1];
|
|
84
|
+
var _React$useState3 = React.useState({}),
|
|
85
|
+
_React$useState4 = _slicedToArray(_React$useState3, 2),
|
|
86
|
+
error = _React$useState4[0],
|
|
87
|
+
setError = _React$useState4[1];
|
|
88
|
+
var onSubmit = /*#__PURE__*/function () {
|
|
89
|
+
var _ref = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(data) {
|
|
90
|
+
var validate;
|
|
91
|
+
return _regenerator().w(function (_context) {
|
|
92
|
+
while (1) switch (_context.n) {
|
|
93
|
+
case 0:
|
|
94
|
+
_context.n = 1;
|
|
95
|
+
return trigger();
|
|
96
|
+
case 1:
|
|
97
|
+
validate = _context.v;
|
|
98
|
+
if (!validate) {
|
|
99
|
+
_context.n = 2;
|
|
100
|
+
break;
|
|
101
|
+
}
|
|
102
|
+
_context.n = 2;
|
|
103
|
+
return validateCodes(data.codes);
|
|
104
|
+
case 2:
|
|
105
|
+
return _context.a(2);
|
|
106
|
+
}
|
|
107
|
+
}, _callee);
|
|
108
|
+
}));
|
|
109
|
+
return function onSubmit(_x) {
|
|
110
|
+
return _ref.apply(this, arguments);
|
|
111
|
+
};
|
|
112
|
+
}();
|
|
113
|
+
function actionPatchCart(_x2) {
|
|
114
|
+
return _actionPatchCart.apply(this, arguments);
|
|
115
|
+
}
|
|
116
|
+
function _actionPatchCart() {
|
|
117
|
+
_actionPatchCart = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2(cartEnt) {
|
|
118
|
+
var _cart, _t;
|
|
119
|
+
return _regenerator().w(function (_context2) {
|
|
120
|
+
while (1) switch (_context2.p = _context2.n) {
|
|
121
|
+
case 0:
|
|
122
|
+
_context2.p = 0;
|
|
123
|
+
_context2.n = 1;
|
|
124
|
+
return cartEnt.save({
|
|
125
|
+
embed: _helpers.cartEmbed
|
|
126
|
+
});
|
|
127
|
+
case 1:
|
|
128
|
+
_cart = _context2.v;
|
|
129
|
+
setCart(_cart.toJson());
|
|
130
|
+
_context2.n = 3;
|
|
131
|
+
break;
|
|
132
|
+
case 2:
|
|
133
|
+
_context2.p = 2;
|
|
134
|
+
_t = _context2.v;
|
|
135
|
+
alertError(_t.errorMessage || _t.message || 'nknown server error.');
|
|
136
|
+
case 3:
|
|
137
|
+
return _context2.a(2);
|
|
138
|
+
}
|
|
139
|
+
}, _callee2, null, [[0, 2]]);
|
|
140
|
+
}));
|
|
141
|
+
return _actionPatchCart.apply(this, arguments);
|
|
142
|
+
}
|
|
143
|
+
function validateCodes(_x3) {
|
|
144
|
+
return _validateCodes.apply(this, arguments);
|
|
145
|
+
}
|
|
146
|
+
function _validateCodes() {
|
|
147
|
+
_validateCodes = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee3(codes) {
|
|
148
|
+
var query, cartToken, url, r, updatedItems, cartEnt, _cartEnt, _discountItems, _t2;
|
|
149
|
+
return _regenerator().w(function (_context3) {
|
|
150
|
+
while (1) switch (_context3.p = _context3.n) {
|
|
151
|
+
case 0:
|
|
152
|
+
query = [['codes', codes]];
|
|
153
|
+
setLoading(true);
|
|
154
|
+
setError({});
|
|
155
|
+
_context3.n = 1;
|
|
156
|
+
return (0, _cookie.getCartCookieToken)(domainId);
|
|
157
|
+
case 1:
|
|
158
|
+
cartToken = _context3.v;
|
|
159
|
+
_context3.p = 2;
|
|
160
|
+
url = "/carts/".concat(cart.id, "/check_discount_code/");
|
|
161
|
+
_context3.n = 3;
|
|
162
|
+
return merchi.authenticatedFetch(url, {
|
|
163
|
+
query: query
|
|
164
|
+
});
|
|
165
|
+
case 3:
|
|
166
|
+
r = _context3.v;
|
|
167
|
+
updatedItems = r.items || [];
|
|
168
|
+
setItems(updatedItems);
|
|
169
|
+
cartEnt = (0, _cart2.makeCart)(_objectSpread({}, cart), false, cartToken);
|
|
170
|
+
cartEnt.discountItems = updatedItems.map(function (r) {
|
|
171
|
+
return (0, _cart2.makeDiscountItem)(_objectSpread({}, r), true);
|
|
172
|
+
});
|
|
173
|
+
actionPatchCart(cartEnt);
|
|
174
|
+
_context3.n = 5;
|
|
175
|
+
break;
|
|
176
|
+
case 4:
|
|
177
|
+
_context3.p = 4;
|
|
178
|
+
_t2 = _context3.v;
|
|
179
|
+
setError({
|
|
180
|
+
message: "Error: ".concat(_t2.errorMessage || _t2.message || 'Unexpected error.')
|
|
181
|
+
});
|
|
182
|
+
_cartEnt = (0, _cart2.makeCart)(_objectSpread(_objectSpread({}, cart), {}, {
|
|
183
|
+
discountItems: []
|
|
184
|
+
}), false, cartToken);
|
|
185
|
+
_discountItems = _cartEnt.discountItems;
|
|
186
|
+
_cartEnt.discountItems = _discountItems;
|
|
187
|
+
actionPatchCart(_cartEnt);
|
|
188
|
+
case 5:
|
|
189
|
+
_context3.p = 5;
|
|
190
|
+
setLoading(false);
|
|
191
|
+
return _context3.f(5);
|
|
192
|
+
case 6:
|
|
193
|
+
return _context3.a(2);
|
|
194
|
+
}
|
|
195
|
+
}, _callee3, null, [[2, 4, 5, 6]]);
|
|
196
|
+
}));
|
|
197
|
+
return _validateCodes.apply(this, arguments);
|
|
198
|
+
}
|
|
199
|
+
function handleClick() {
|
|
200
|
+
return _handleClick.apply(this, arguments);
|
|
201
|
+
}
|
|
202
|
+
function _handleClick() {
|
|
203
|
+
_handleClick = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee4() {
|
|
204
|
+
var _getValues, codes;
|
|
205
|
+
return _regenerator().w(function (_context4) {
|
|
206
|
+
while (1) switch (_context4.n) {
|
|
207
|
+
case 0:
|
|
208
|
+
_getValues = getValues(), codes = _getValues.codes;
|
|
209
|
+
_context4.n = 1;
|
|
210
|
+
return onSubmit({
|
|
211
|
+
codes: codes
|
|
212
|
+
});
|
|
213
|
+
case 1:
|
|
214
|
+
return _context4.a(2);
|
|
215
|
+
}
|
|
216
|
+
}, _callee4);
|
|
217
|
+
}));
|
|
218
|
+
return _handleClick.apply(this, arguments);
|
|
219
|
+
}
|
|
220
|
+
var _React$useState5 = React.useState(discountItems || []),
|
|
221
|
+
_React$useState6 = _slicedToArray(_React$useState5, 2),
|
|
222
|
+
items = _React$useState6[0],
|
|
223
|
+
setItems = _React$useState6[1];
|
|
224
|
+
function removeItem(_x4) {
|
|
225
|
+
return _removeItem.apply(this, arguments);
|
|
226
|
+
}
|
|
227
|
+
function _removeItem() {
|
|
228
|
+
_removeItem = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee5(index) {
|
|
229
|
+
var item, codes, newValues;
|
|
230
|
+
return _regenerator().w(function (_context5) {
|
|
231
|
+
while (1) switch (_context5.n) {
|
|
232
|
+
case 0:
|
|
233
|
+
item = _objectSpread({}, items[index]);
|
|
234
|
+
codes = getValues('codes');
|
|
235
|
+
newValues = codes.replace(item.code, "");
|
|
236
|
+
setValue('codes', newValues);
|
|
237
|
+
_context5.n = 1;
|
|
238
|
+
return validateCodes(newValues);
|
|
239
|
+
case 1:
|
|
240
|
+
return _context5.a(2);
|
|
241
|
+
}
|
|
242
|
+
}, _callee5);
|
|
243
|
+
}));
|
|
244
|
+
return _removeItem.apply(this, arguments);
|
|
245
|
+
}
|
|
246
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
247
|
+
className: discountClassNameMainContainer,
|
|
248
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_CartTitle["default"], {
|
|
249
|
+
icon: _freeSolidSvgIcons.faTags,
|
|
250
|
+
title: "Apply discount code"
|
|
251
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
252
|
+
className: discountClassName,
|
|
253
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
254
|
+
className: discountClassNameInputContainer,
|
|
255
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("input", _objectSpread({
|
|
256
|
+
type: "text",
|
|
257
|
+
className: discountClassNameInput,
|
|
258
|
+
placeholder: "discount20,discount10"
|
|
259
|
+
}, register('codes', {
|
|
260
|
+
required: 'Codes must be provided.'
|
|
261
|
+
})))
|
|
262
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
263
|
+
className: discountClassNameButtonContainer,
|
|
264
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("button", {
|
|
265
|
+
className: discountClassNameButton,
|
|
266
|
+
disabled: loading,
|
|
267
|
+
onClick: handleClick,
|
|
268
|
+
children: loading ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactFontawesome.FontAwesomeIcon, {
|
|
269
|
+
icon: _freeSolidSvgIcons.faCircleNotch
|
|
270
|
+
}) : discountButtonText
|
|
271
|
+
})
|
|
272
|
+
})]
|
|
273
|
+
}), error.message && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
274
|
+
className: discountClassNameErrorMessage,
|
|
275
|
+
children: error.message
|
|
276
|
+
}), errors.codes && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
277
|
+
className: discountClassNameErrorMessage,
|
|
278
|
+
children: errors === null || errors === void 0 || (_codes = errors.codes) === null || _codes === void 0 ? void 0 : _codes.message
|
|
279
|
+
}), discountShowAppliedItems && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
280
|
+
className: discountClassNameListItems,
|
|
281
|
+
children: items.map(function (item, index) {
|
|
282
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
283
|
+
className: discountClassNameListItem,
|
|
284
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
285
|
+
children: [item.code, " ", item.description]
|
|
286
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
287
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("button", {
|
|
288
|
+
className: discountClassNameButtonItemRemove,
|
|
289
|
+
onClick: function onClick() {
|
|
290
|
+
return removeItem(index);
|
|
291
|
+
},
|
|
292
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactFontawesome.FontAwesomeIcon, {
|
|
293
|
+
icon: _freeSolidSvgIcons.faTimes
|
|
294
|
+
})
|
|
295
|
+
})
|
|
296
|
+
})]
|
|
297
|
+
}, index);
|
|
298
|
+
})
|
|
299
|
+
})]
|
|
300
|
+
});
|
|
301
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.LoadingTemplateSm = LoadingTemplateSm;
|
|
7
|
+
exports["default"] = LoadingTemplate;
|
|
8
|
+
var _CartProvider = require("../CartProvider");
|
|
9
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
10
|
+
function LoadingTemplate(_ref) {
|
|
11
|
+
var height = _ref.height;
|
|
12
|
+
var _useCartContext = (0, _CartProvider.useCartContext)(),
|
|
13
|
+
classNameLoadingTemplate = _useCartContext.classNameLoadingTemplate,
|
|
14
|
+
classNameLoadingTemplateContainer = _useCartContext.classNameLoadingTemplateContainer;
|
|
15
|
+
var style = height ? {
|
|
16
|
+
height: height
|
|
17
|
+
} : {};
|
|
18
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
19
|
+
className: classNameLoadingTemplateContainer,
|
|
20
|
+
style: style,
|
|
21
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
22
|
+
className: classNameLoadingTemplate
|
|
23
|
+
})
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
function LoadingTemplateSm() {
|
|
27
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(LoadingTemplate, {
|
|
28
|
+
height: 300
|
|
29
|
+
});
|
|
30
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports["default"] = void 0;
|
|
7
|
+
var _react = _interopRequireDefault(require("react"));
|
|
8
|
+
var _CartProvider = require("../CartProvider");
|
|
9
|
+
var _productNotFound = _interopRequireDefault(require("../assets/product-not-found.png"));
|
|
10
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
11
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
12
|
+
function NoCartItems() {
|
|
13
|
+
var _useCartContext = (0, _CartProvider.useCartContext)(),
|
|
14
|
+
classNameNoItems = _useCartContext.classNameNoItems;
|
|
15
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
16
|
+
className: classNameNoItems,
|
|
17
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("img", {
|
|
18
|
+
src: (_productNotFound["default"] === null || _productNotFound["default"] === void 0 ? void 0 : _productNotFound["default"].src) || _productNotFound["default"] || '',
|
|
19
|
+
alt: "Cart items not found",
|
|
20
|
+
width: 276,
|
|
21
|
+
height: 215
|
|
22
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("p", {
|
|
23
|
+
children: "No cart items."
|
|
24
|
+
})]
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
var _default = exports["default"] = NoCartItems;
|
|
@@ -0,0 +1,215 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports["default"] = void 0;
|
|
8
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
+
var _address = require("../utilities/address");
|
|
10
|
+
var _currency = require("../utilities/currency");
|
|
11
|
+
var _CartProvider = require("../CartProvider");
|
|
12
|
+
var _productNotFound = _interopRequireDefault(require("../assets/product-not-found.png"));
|
|
13
|
+
var _cart = require("../utilities/cart");
|
|
14
|
+
var _helpers = require("../utilities/helpers");
|
|
15
|
+
var _reactFontawesome = require("@fortawesome/react-fontawesome");
|
|
16
|
+
var _freeSolidSvgIcons = require("@fortawesome/free-solid-svg-icons");
|
|
17
|
+
var _cookie = require("../utilities/cookie");
|
|
18
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
19
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
20
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, "default": e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t2 in e) "default" !== _t2 && {}.hasOwnProperty.call(e, _t2) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t2)) && (i.get || i.set) ? o(f, _t2, i) : f[_t2] = e[_t2]); return f; })(e, t); }
|
|
21
|
+
function _regenerator() { /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ var e, t, r = "function" == typeof Symbol ? Symbol : {}, n = r.iterator || "@@iterator", o = r.toStringTag || "@@toStringTag"; function i(r, n, o, i) { var c = n && n.prototype instanceof Generator ? n : Generator, u = Object.create(c.prototype); return _regeneratorDefine2(u, "_invoke", function (r, n, o) { var i, c, u, f = 0, p = o || [], y = !1, G = { p: 0, n: 0, v: e, a: d, f: d.bind(e, 4), d: function d(t, r) { return i = t, c = 0, u = e, G.n = r, a; } }; function d(r, n) { for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) { var o, i = p[t], d = G.p, l = i[2]; r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0)); } if (o || r > 1) return a; throw y = !0, n; } return function (o, p, l) { if (f > 1) throw TypeError("Generator is already running"); for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) { i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u); try { if (f = 2, i) { if (c || (o = "next"), t = i[o]) { if (!(t = t.call(i, u))) throw TypeError("iterator result is not an object"); if (!t.done) return t; u = t.value, c < 2 && (c = 0); } else 1 === c && (t = i["return"]) && t.call(i), c < 2 && (u = TypeError("The iterator does not provide a '" + o + "' method"), c = 1); i = e; } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break; } catch (t) { i = e, c = 1, u = t; } finally { f = 1; } } return { value: t, done: y }; }; }(r, o, i), !0), u; } var a = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} t = Object.getPrototypeOf; var c = [][n] ? t(t([][n]())) : (_regeneratorDefine2(t = {}, n, function () { return this; }), t), u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c); function f(e) { return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, _regeneratorDefine2(e, o, "GeneratorFunction")), e.prototype = Object.create(u), e; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, _regeneratorDefine2(u, "constructor", GeneratorFunctionPrototype), _regeneratorDefine2(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = "GeneratorFunction", _regeneratorDefine2(GeneratorFunctionPrototype, o, "GeneratorFunction"), _regeneratorDefine2(u), _regeneratorDefine2(u, o, "Generator"), _regeneratorDefine2(u, n, function () { return this; }), _regeneratorDefine2(u, "toString", function () { return "[object Generator]"; }), (_regenerator = function _regenerator() { return { w: i, m: f }; })(); }
|
|
22
|
+
function _regeneratorDefine2(e, r, n, t) { var i = Object.defineProperty; try { i({}, "", {}); } catch (e) { i = 0; } _regeneratorDefine2 = function _regeneratorDefine(e, r, n, t) { function o(r, n) { _regeneratorDefine2(e, r, function (e) { return this._invoke(r, n, e); }); } r ? i ? i(e, r, { value: n, enumerable: !t, configurable: !t, writable: !t }) : e[r] = n : (o("next", 0), o("throw", 1), o("return", 2)); }, _regeneratorDefine2(e, r, n, t); }
|
|
23
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
24
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
25
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
26
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
27
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
28
|
+
function asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }
|
|
29
|
+
function _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; }
|
|
30
|
+
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
31
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
32
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
33
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
34
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
35
|
+
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
36
|
+
function NoCartShipmentOptionsFound() {
|
|
37
|
+
var _useCartContext = (0, _CartProvider.useCartContext)(),
|
|
38
|
+
classNameNoItems = _useCartContext.classNameNoItems;
|
|
39
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
40
|
+
className: classNameNoItems,
|
|
41
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("img", {
|
|
42
|
+
src: (_productNotFound["default"] && "src" in _productNotFound["default"] ? _productNotFound["default"].src : _productNotFound["default"]) || "",
|
|
43
|
+
width: 276,
|
|
44
|
+
height: 215
|
|
45
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("p", {
|
|
46
|
+
children: "No shipment options found."
|
|
47
|
+
})]
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
function PickupInfo(_ref) {
|
|
51
|
+
var originAddress = _ref.originAddress;
|
|
52
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("small", {
|
|
53
|
+
children: ["Pick up from: ", (0, _address.addressInOneLine)(originAddress)]
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
function ShipmentPrice(_ref2) {
|
|
57
|
+
var quote = _ref2.quote;
|
|
58
|
+
var shipmentMethod = quote.shipmentMethod,
|
|
59
|
+
taxType = quote.taxType,
|
|
60
|
+
totalCost = quote.totalCost;
|
|
61
|
+
var currency = shipmentMethod.currency;
|
|
62
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
63
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("small", {
|
|
64
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("strong", {
|
|
65
|
+
children: totalCost > 0 ? (0, _currency.currencyTaxAndCost)(currency, taxType, totalCost) : ""
|
|
66
|
+
})
|
|
67
|
+
})
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
function ShipmentOptionInfo(_ref3) {
|
|
71
|
+
var quote = _ref3.quote;
|
|
72
|
+
var _useCartContext2 = (0, _CartProvider.useCartContext)(),
|
|
73
|
+
classNameShipmentOption = _useCartContext2.classNameShipmentOption;
|
|
74
|
+
var name = quote.name,
|
|
75
|
+
shipmentMethod = quote.shipmentMethod;
|
|
76
|
+
var originAddress = shipmentMethod.originAddress,
|
|
77
|
+
pickUp = shipmentMethod.pickUp,
|
|
78
|
+
transportCompanyName = shipmentMethod.transportCompanyName;
|
|
79
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
80
|
+
className: classNameShipmentOption,
|
|
81
|
+
children: [!name ? /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
82
|
+
children: [transportCompanyName && /*#__PURE__*/(0, _jsxRuntime.jsx)("p", {
|
|
83
|
+
className: "mb-0",
|
|
84
|
+
children: shipmentMethod.name
|
|
85
|
+
}), pickUp ? /*#__PURE__*/(0, _jsxRuntime.jsx)(PickupInfo, {
|
|
86
|
+
originAddress: originAddress
|
|
87
|
+
}) : /*#__PURE__*/(0, _jsxRuntime.jsx)("small", {
|
|
88
|
+
children: transportCompanyName
|
|
89
|
+
})]
|
|
90
|
+
}) : /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
91
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("p", {
|
|
92
|
+
className: "m-0",
|
|
93
|
+
children: name
|
|
94
|
+
}), pickUp && /*#__PURE__*/(0, _jsxRuntime.jsx)(PickupInfo, {
|
|
95
|
+
originAddress: originAddress
|
|
96
|
+
})]
|
|
97
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(ShipmentPrice, {
|
|
98
|
+
quote: quote
|
|
99
|
+
})]
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
function ShipmentQuote(_ref4) {
|
|
103
|
+
var isSelected = _ref4.isSelected,
|
|
104
|
+
doClick = _ref4.doClick,
|
|
105
|
+
quote = _ref4.quote;
|
|
106
|
+
var _useCartContext3 = (0, _CartProvider.useCartContext)(),
|
|
107
|
+
classNameListItem = _useCartContext3.classNameListItem;
|
|
108
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
109
|
+
className: classNameListItem,
|
|
110
|
+
onClick: doClick,
|
|
111
|
+
style: {
|
|
112
|
+
cursor: "pointer"
|
|
113
|
+
},
|
|
114
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
115
|
+
style: {
|
|
116
|
+
alignItems: "center",
|
|
117
|
+
display: "flex",
|
|
118
|
+
justifyContent: "space-between"
|
|
119
|
+
},
|
|
120
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(ShipmentOptionInfo, {
|
|
121
|
+
quote: quote
|
|
122
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
123
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactFontawesome.FontAwesomeIcon, {
|
|
124
|
+
icon: isSelected ? _freeSolidSvgIcons.faCheckSquare : _freeSolidSvgIcons.faSquare
|
|
125
|
+
})
|
|
126
|
+
})]
|
|
127
|
+
})
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
function ShipmentGroupCard(_ref5) {
|
|
131
|
+
var group = _ref5.group,
|
|
132
|
+
groupIndex = _ref5.groupIndex;
|
|
133
|
+
var _useCartContext4 = (0, _CartProvider.useCartContext)(),
|
|
134
|
+
alertError = _useCartContext4.alertError,
|
|
135
|
+
cart = _useCartContext4.cart,
|
|
136
|
+
classNameList = _useCartContext4.classNameList,
|
|
137
|
+
classNameListInline = _useCartContext4.classNameListInline,
|
|
138
|
+
domainId = _useCartContext4.domainId,
|
|
139
|
+
setCart = _useCartContext4.setCart;
|
|
140
|
+
var cartItems = group.cartItems,
|
|
141
|
+
_group$quotes = group.quotes,
|
|
142
|
+
quotes = _group$quotes === void 0 ? [] : _group$quotes;
|
|
143
|
+
var _useState = (0, _react.useState)(group.selectedQuote || {}),
|
|
144
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
145
|
+
selectedQuote = _useState2[0],
|
|
146
|
+
setSelectedQuote = _useState2[1];
|
|
147
|
+
function _doClick2(_x, _x2) {
|
|
148
|
+
return _doClick.apply(this, arguments);
|
|
149
|
+
}
|
|
150
|
+
function _doClick() {
|
|
151
|
+
_doClick = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(groupIndex, quote) {
|
|
152
|
+
var token, cartEnt, cartShipmentQuote, cartJson, _t;
|
|
153
|
+
return _regenerator().w(function (_context) {
|
|
154
|
+
while (1) switch (_context.p = _context.n) {
|
|
155
|
+
case 0:
|
|
156
|
+
setSelectedQuote(quote);
|
|
157
|
+
_context.p = 1;
|
|
158
|
+
_context.n = 2;
|
|
159
|
+
return (0, _cookie.getCartCookieToken)(domainId);
|
|
160
|
+
case 2:
|
|
161
|
+
token = _context.v;
|
|
162
|
+
cartEnt = (0, _cart.makeCart)(_objectSpread({}, cart), false, token);
|
|
163
|
+
cartShipmentQuote = (0, _cart.makeCartShipmentQuote)(_objectSpread({}, quote));
|
|
164
|
+
cartEnt.shipmentGroups[groupIndex].selectedQuote = cartShipmentQuote;
|
|
165
|
+
_context.n = 3;
|
|
166
|
+
return cartEnt.save({
|
|
167
|
+
embed: _helpers.cartEmbed
|
|
168
|
+
});
|
|
169
|
+
case 3:
|
|
170
|
+
_context.n = 4;
|
|
171
|
+
return cartEnt.toJson();
|
|
172
|
+
case 4:
|
|
173
|
+
cartJson = _context.v;
|
|
174
|
+
setCart(_objectSpread(_objectSpread({}, cart), cartJson));
|
|
175
|
+
_context.n = 6;
|
|
176
|
+
break;
|
|
177
|
+
case 5:
|
|
178
|
+
_context.p = 5;
|
|
179
|
+
_t = _context.v;
|
|
180
|
+
alertError(_t.errorMessage || _t.message || "Unable to select shipment option.");
|
|
181
|
+
setSelectedQuote({});
|
|
182
|
+
case 6:
|
|
183
|
+
return _context.a(2);
|
|
184
|
+
}
|
|
185
|
+
}, _callee, null, [[1, 5]]);
|
|
186
|
+
}));
|
|
187
|
+
return _doClick.apply(this, arguments);
|
|
188
|
+
}
|
|
189
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
190
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("ul", {
|
|
191
|
+
className: classNameListInline,
|
|
192
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("li", {
|
|
193
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("strong", {
|
|
194
|
+
children: ["Shipment ", groupIndex + 1, " contents:"]
|
|
195
|
+
})
|
|
196
|
+
}), cartItems.map(function (item, index) {
|
|
197
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)("li", {
|
|
198
|
+
children: item.product.name
|
|
199
|
+
}, index);
|
|
200
|
+
})]
|
|
201
|
+
}), quotes.length ? /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
202
|
+
className: classNameList,
|
|
203
|
+
children: quotes.map(function (q, i) {
|
|
204
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(ShipmentQuote, {
|
|
205
|
+
quote: q,
|
|
206
|
+
isSelected: (selectedQuote === null || selectedQuote === void 0 ? void 0 : selectedQuote.id) === q.id,
|
|
207
|
+
doClick: function doClick() {
|
|
208
|
+
return _doClick2(groupIndex, q);
|
|
209
|
+
}
|
|
210
|
+
}, "".concat(i, "-group-quote"));
|
|
211
|
+
})
|
|
212
|
+
}) : /*#__PURE__*/(0, _jsxRuntime.jsx)(NoCartShipmentOptionsFound, {})]
|
|
213
|
+
});
|
|
214
|
+
}
|
|
215
|
+
var _default = exports["default"] = ShipmentGroupCard;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports["default"] = Table;
|
|
7
|
+
var _CartProvider = require("../CartProvider");
|
|
8
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
9
|
+
function Table(_ref) {
|
|
10
|
+
var children = _ref.children,
|
|
11
|
+
_ref$className = _ref.className,
|
|
12
|
+
className = _ref$className === void 0 ? '' : _ref$className;
|
|
13
|
+
var _useCartContext = (0, _CartProvider.useCartContext)(),
|
|
14
|
+
classNameTable = _useCartContext.classNameTable;
|
|
15
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)("table", {
|
|
16
|
+
className: "".concat(classNameTable, " ").concat(className),
|
|
17
|
+
children: children
|
|
18
|
+
});
|
|
19
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
interface CheckoutContainerProps {
|
|
3
|
+
children: any;
|
|
4
|
+
textAlign?: any;
|
|
5
|
+
}
|
|
6
|
+
export declare function CheckoutContainer({ children, textAlign }: CheckoutContainerProps): React.JSX.Element;
|
|
7
|
+
interface InnerProps {
|
|
8
|
+
children: any;
|
|
9
|
+
paddingBottom?: string;
|
|
10
|
+
paddingTop?: string;
|
|
11
|
+
width?: number;
|
|
12
|
+
}
|
|
13
|
+
export declare function InnerContainer({ children, paddingBottom, paddingTop, width }: InnerProps): React.JSX.Element;
|
|
14
|
+
export {};
|