merchi_cart 0.0.5 → 0.0.6-b
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/lib/Cart.js +55 -44
- package/lib/CartAlert.js +32 -30
- package/lib/CartHeader.js +25 -18
- package/lib/CartProvider.js +235 -157
- package/lib/CartTotals.js +71 -66
- package/lib/buttons/Button.js +25 -17
- package/lib/buttons/ButtonBack.js +40 -29
- package/lib/buttons/ButtonClearCart.js +19 -11
- package/lib/buttons/ButtonInvoiceDownload.js +82 -41
- package/lib/buttons/ButtonNext.js +41 -28
- package/lib/buttons/ButtonNextDynamic.js +29 -19
- package/lib/buttons/ButtonPay.js +26 -22
- package/lib/buttons/ButtonShipmentTabNext.js +30 -21
- package/lib/buttons/index.js +48 -7
- package/lib/components/Alert.js +22 -16
- package/lib/components/CartBody.js +18 -12
- package/lib/components/CartClient.js +44 -40
- package/lib/components/CartFooter.js +17 -11
- package/lib/components/CartItemRow.js +90 -93
- package/lib/components/CartPaymentSettingsInvalid.js +15 -7
- package/lib/components/CartShipment.js +38 -37
- package/lib/components/CartTabContent.js +17 -11
- package/lib/components/CartTabPanel.js +23 -19
- package/lib/components/CartTableContainer.js +17 -11
- package/lib/components/Collapse.js +31 -15
- package/lib/components/LoadingTemplate.js +20 -16
- package/lib/components/NoCartItems.js +21 -13
- package/lib/components/ShipmentGroupCard.js +95 -105
- package/lib/components/Table.js +13 -10
- package/lib/components/Title.js +24 -19
- package/lib/components/containers.js +24 -16
- package/lib/components/index.js +106 -14
- package/lib/forms/FormNewCustomer.js +103 -66
- package/lib/forms/FormReturningCustomer.js +74 -48
- package/lib/forms/FormShipmentAddressAndNotes.js +77 -65
- package/lib/forms/FormSquarePayment.js +18 -11
- package/lib/forms/FormStripePayment.js +18 -11
- package/lib/forms/InputAcceptUserTermsAndConditions.js +23 -19
- package/lib/forms/InputError.js +18 -12
- package/lib/forms/InputSelect.js +48 -40
- package/lib/forms/InputText.js +53 -43
- package/lib/forms/InputsAddress.js +113 -98
- package/lib/index.js +49543 -3
- package/lib/panels/PanelCartItems.js +41 -32
- package/lib/panels/PanelCartShipment.js +43 -36
- package/lib/panels/PanelClearCart.js +35 -31
- package/lib/panels/PanelClientCheckout.js +55 -51
- package/lib/panels/PanelEditCartItem.js +45 -34
- package/lib/panels/PanelPaymentSuccess.js +50 -47
- package/lib/panels/index.js +48 -7
- package/lib/slices/sliceCart.js +70 -60
- package/lib/slices/sliceCartAlert.js +26 -16
- package/lib/slices/sliceCartItem.js +16 -11
- package/lib/slices/sliceCartPayment.js +23 -16
- package/lib/slices/sliceCartShipment.js +33 -24
- package/lib/slices/sliceFormReturningCustomer.js +13 -7
- package/lib/slices/sliceNewCustomerForm.js +12 -6
- package/lib/square/SquareCard.js +36 -28
- package/lib/square/actions.js +57 -27
- package/lib/square/slices/reducersSquare.js +13 -6
- package/lib/square/slices/sliceSquareAlerts.js +22 -10
- package/lib/square/slices/sliceSquareForm.js +15 -10
- package/lib/src/Cart.d.ts +3 -0
- package/lib/src/CartAlert.d.ts +2 -0
- package/lib/src/CartHeader.d.ts +2 -0
- package/lib/src/CartProvider.d.ts +147 -0
- package/lib/src/CartTotals.d.ts +2 -0
- package/lib/src/buttons/Button.d.ts +10 -0
- package/lib/src/buttons/ButtonBack.d.ts +5 -0
- package/lib/src/buttons/ButtonClearCart.d.ts +2 -0
- package/lib/src/buttons/ButtonInvoiceDownload.d.ts +2 -0
- package/lib/src/buttons/ButtonNext.d.ts +2 -0
- package/lib/src/buttons/ButtonNextDynamic.d.ts +2 -0
- package/lib/src/buttons/ButtonPay.d.ts +6 -0
- package/lib/src/buttons/ButtonShipmentTabNext.d.ts +1 -0
- package/lib/src/buttons/index.d.ts +7 -0
- package/lib/src/components/Alert.d.ts +6 -0
- package/lib/src/components/CartBody.d.ts +6 -0
- package/lib/src/components/CartClient.d.ts +6 -0
- package/lib/src/components/CartFooter.d.ts +5 -0
- package/lib/src/components/CartItemRow.d.ts +7 -0
- package/lib/src/components/CartPaymentSettingsInvalid.d.ts +1 -0
- package/lib/src/components/CartShipment.d.ts +5 -0
- package/lib/src/components/CartTabContent.d.ts +5 -0
- package/lib/src/components/CartTabPanel.d.ts +6 -0
- package/lib/src/components/CartTableContainer.d.ts +5 -0
- package/lib/src/components/Collapse.d.ts +2 -0
- package/lib/src/components/LoadingTemplate.d.ts +6 -0
- package/lib/src/components/NoCartItems.d.ts +2 -0
- package/lib/src/components/ShipmentGroupCard.d.ts +6 -0
- package/lib/src/components/Table.d.ts +5 -0
- package/lib/src/components/Title.d.ts +1 -0
- package/lib/src/components/containers.d.ts +13 -0
- package/lib/src/components/index.d.ts +14 -0
- package/lib/src/forms/FormNewCustomer.d.ts +3 -0
- package/lib/src/forms/FormReturningCustomer.d.ts +2 -0
- package/lib/src/forms/FormShipmentAddressAndNotes.d.ts +15 -0
- package/lib/src/forms/FormSquarePayment.d.ts +2 -0
- package/lib/src/forms/FormStripePayment.d.ts +2 -0
- package/lib/src/forms/InputAcceptUserTermsAndConditions.d.ts +6 -0
- package/lib/src/forms/InputError.d.ts +8 -0
- package/lib/src/forms/InputSelect.d.ts +13 -0
- package/lib/src/forms/InputText.d.ts +11 -0
- package/lib/src/forms/InputsAddress.d.ts +10 -0
- package/lib/src/index.d.ts +3 -0
- package/lib/src/panels/PanelCartItems.d.ts +2 -0
- package/lib/src/panels/PanelCartShipment.d.ts +2 -0
- package/lib/src/panels/PanelClearCart.d.ts +2 -0
- package/lib/src/panels/PanelClientCheckout.d.ts +2 -0
- package/lib/src/panels/PanelEditCartItem.d.ts +2 -0
- package/lib/src/panels/PanelPaymentSuccess.d.ts +2 -0
- package/lib/src/panels/index.d.ts +7 -0
- package/lib/src/slices/sliceCart.d.ts +52 -0
- package/lib/src/slices/sliceCartAlert.d.ts +23 -0
- package/lib/src/slices/sliceCartItem.d.ts +18 -0
- package/lib/src/slices/sliceCartPayment.d.ts +17 -0
- package/lib/src/slices/sliceCartShipment.d.ts +36 -0
- package/lib/src/slices/sliceFormReturningCustomer.d.ts +14 -0
- package/lib/src/slices/sliceNewCustomerForm.d.ts +13 -0
- package/lib/src/square/SquareCard.d.ts +2 -0
- package/lib/src/square/actions.d.ts +4 -0
- package/lib/src/square/slices/reducersSquare.d.ts +13 -0
- package/lib/src/square/slices/sliceSquareAlerts.d.ts +11 -0
- package/lib/src/square/slices/sliceSquareForm.d.ts +19 -0
- package/lib/src/store.d.ts +189 -0
- package/lib/src/stripe/StripeCardFields.d.ts +13 -0
- package/lib/src/stripe/StripeCardForm.d.ts +2 -0
- package/lib/src/stripe/StripePaymentButtons.d.ts +7 -0
- package/lib/src/stripe/actions.d.ts +4 -0
- package/lib/src/stripe/slices/sliceStripeAlerts.d.ts +11 -0
- package/lib/src/stripe/slices/sliceStripeCardForm.d.ts +15 -0
- package/lib/src/stripe/slices/sliceStripeForm.d.ts +31 -0
- package/lib/src/stripe/utils.d.ts +17 -0
- package/lib/src/tabs/CartNav.d.ts +2 -0
- package/lib/src/tabs/NavTab.d.ts +8 -0
- package/lib/src/utilities/address.d.ts +11 -0
- package/lib/src/utilities/cart.d.ts +8 -0
- package/lib/src/utilities/company.d.ts +2 -0
- package/lib/src/utilities/cookie.d.ts +3 -0
- package/lib/src/utilities/currency.d.ts +5 -0
- package/lib/src/utilities/helpers.d.ts +24 -0
- package/lib/src/utilities/invoice.d.ts +3 -0
- package/lib/src/utilities/product.d.ts +1 -0
- package/lib/src/utilities/user.d.ts +5 -0
- package/lib/src/utilities/variations.d.ts +15 -0
- package/lib/store.js +637 -402
- package/lib/stripe/StripeCardFields.js +71 -63
- package/lib/stripe/StripeCardForm.js +128 -64
- package/lib/stripe/StripePaymentButtons.js +57 -38
- package/lib/stripe/actions.js +204 -75
- package/lib/stripe/slices/sliceStripeAlerts.js +22 -10
- package/lib/stripe/slices/sliceStripeCardForm.js +13 -6
- package/lib/stripe/slices/sliceStripeForm.js +23 -18
- package/lib/stripe/utils.js +9 -2
- package/lib/tabs/CartNav.js +37 -19
- package/lib/tabs/NavTab.js +34 -28
- package/lib/utilities/address.js +43 -36
- package/lib/utilities/cart.js +70 -39
- package/lib/utilities/company.js +9 -2
- package/lib/utilities/cookie.js +139 -47
- package/lib/utilities/currency.js +39 -33
- package/lib/utilities/helpers.js +75 -45
- package/lib/utilities/invoice.js +120 -45
- package/lib/utilities/product.js +11 -6
- package/lib/utilities/user.js +77 -29
- package/lib/utilities/variations.js +24 -18
- package/package.json +16 -18
- package/lib/MerchiSDK/constants/auto_assign_production_on_actions.js +0 -7
- package/lib/MerchiSDK/constants/call_to_actions.js +0 -15
- package/lib/MerchiSDK/constants/discount_types.js +0 -4
- package/lib/MerchiSDK/constants/domain_types.js +0 -13
- package/lib/MerchiSDK/constants/errors.js +0 -32
- package/lib/MerchiSDK/constants/event_types.js +0 -6
- package/lib/MerchiSDK/constants/field_types.js +0 -14
- package/lib/MerchiSDK/constants/input_types.js +0 -14
- package/lib/MerchiSDK/constants/inventory_statuses.js +0 -7
- package/lib/MerchiSDK/constants/invoice_types.js +0 -6
- package/lib/MerchiSDK/constants/item_types.js +0 -6
- package/lib/MerchiSDK/constants/job/drafting_status.js +0 -8
- package/lib/MerchiSDK/constants/job/payment_status.js +0 -8
- package/lib/MerchiSDK/constants/job/production_status.js +0 -13
- package/lib/MerchiSDK/constants/job/shipment_status.js +0 -12
- package/lib/MerchiSDK/constants/job/supply_chain_request_status.js +0 -7
- package/lib/MerchiSDK/constants/job_priorities.js +0 -7
- package/lib/MerchiSDK/constants/job_status.js +0 -50
- package/lib/MerchiSDK/constants/job_types.js +0 -16
- package/lib/MerchiSDK/constants/notification_sections.js +0 -14
- package/lib/MerchiSDK/constants/notification_types.js +0 -98
- package/lib/MerchiSDK/constants/notification_urgencies.js +0 -7
- package/lib/MerchiSDK/constants/payment_types.js +0 -11
- package/lib/MerchiSDK/constants/platform.js +0 -5
- package/lib/MerchiSDK/constants/product_types.js +0 -26
- package/lib/MerchiSDK/constants/rights.js +0 -6
- package/lib/MerchiSDK/constants/robots_meta_directives.js +0 -1
- package/lib/MerchiSDK/constants/roles.js +0 -19
- package/lib/MerchiSDK/constants/shipment_companies.js +0 -19
- package/lib/MerchiSDK/constants/shipment_services.js +0 -4
- package/lib/MerchiSDK/constants/system_roles.js +0 -4
- package/lib/MerchiSDK/constants/theme_foundations.js +0 -7
- package/lib/MerchiSDK/constants/theme_status.js +0 -6
- package/lib/MerchiSDK/constants/user_types.js +0 -18
- package/lib/MerchiSDK/constants/white_label_accessibilities.js +0 -6
- package/lib/MerchiSDK/cookie.js +0 -16
- package/lib/MerchiSDK/entities/address.js +0 -167
- package/lib/MerchiSDK/entities/assignment.js +0 -190
- package/lib/MerchiSDK/entities/automatic_payment_relationship.js +0 -89
- package/lib/MerchiSDK/entities/backup.js +0 -60
- package/lib/MerchiSDK/entities/bank.js +0 -122
- package/lib/MerchiSDK/entities/cart.js +0 -193
- package/lib/MerchiSDK/entities/cart_item.js +0 -167
- package/lib/MerchiSDK/entities/cart_shipment_group.js +0 -76
- package/lib/MerchiSDK/entities/cart_shipment_quote.js +0 -95
- package/lib/MerchiSDK/entities/category.js +0 -101
- package/lib/MerchiSDK/entities/company.js +0 -583
- package/lib/MerchiSDK/entities/company_invitation.js +0 -92
- package/lib/MerchiSDK/entities/component.js +0 -208
- package/lib/MerchiSDK/entities/component_tag.js +0 -65
- package/lib/MerchiSDK/entities/component_version.js +0 -91
- package/lib/MerchiSDK/entities/country_tax.js +0 -120
- package/lib/MerchiSDK/entities/discount.js +0 -95
- package/lib/MerchiSDK/entities/discount_group.js +0 -86
- package/lib/MerchiSDK/entities/domain.js +0 -496
- package/lib/MerchiSDK/entities/domain_invitation.js +0 -99
- package/lib/MerchiSDK/entities/domain_tag.js +0 -108
- package/lib/MerchiSDK/entities/draft.js +0 -180
- package/lib/MerchiSDK/entities/draft_comment.js +0 -136
- package/lib/MerchiSDK/entities/draft_template.js +0 -113
- package/lib/MerchiSDK/entities/email_address.js +0 -81
- package/lib/MerchiSDK/entities/email_counter.js +0 -77
- package/lib/MerchiSDK/entities/enrolled_domain.js +0 -97
- package/lib/MerchiSDK/entities/exchange_rate.js +0 -75
- package/lib/MerchiSDK/entities/file.js +0 -372
- package/lib/MerchiSDK/entities/internal_tag.js +0 -126
- package/lib/MerchiSDK/entities/inventory.js +0 -130
- package/lib/MerchiSDK/entities/inventory_unit_variation.js +0 -83
- package/lib/MerchiSDK/entities/invoice.js +0 -386
- package/lib/MerchiSDK/entities/item.js +0 -117
- package/lib/MerchiSDK/entities/job.js +0 -684
- package/lib/MerchiSDK/entities/job_comment.js +0 -125
- package/lib/MerchiSDK/entities/matching_inventory.js +0 -89
- package/lib/MerchiSDK/entities/menu.js +0 -89
- package/lib/MerchiSDK/entities/menu_item.js +0 -87
- package/lib/MerchiSDK/entities/notification.js +0 -225
- package/lib/MerchiSDK/entities/page.js +0 -94
- package/lib/MerchiSDK/entities/payment.js +0 -150
- package/lib/MerchiSDK/entities/payment_device.js +0 -98
- package/lib/MerchiSDK/entities/phone_number.js +0 -107
- package/lib/MerchiSDK/entities/product.js +0 -759
- package/lib/MerchiSDK/entities/production_comment.js +0 -125
- package/lib/MerchiSDK/entities/quote.js +0 -238
- package/lib/MerchiSDK/entities/quote_item.js +0 -145
- package/lib/MerchiSDK/entities/seo_domain_page.js +0 -92
- package/lib/MerchiSDK/entities/session.js +0 -96
- package/lib/MerchiSDK/entities/shipment.js +0 -389
- package/lib/MerchiSDK/entities/shipment_item.js +0 -65
- package/lib/MerchiSDK/entities/shipment_item_fulfillment.js +0 -64
- package/lib/MerchiSDK/entities/shipment_method.js +0 -148
- package/lib/MerchiSDK/entities/shipment_method_variation.js +0 -112
- package/lib/MerchiSDK/entities/short_url.js +0 -104
- package/lib/MerchiSDK/entities/subscription_plan.js +0 -169
- package/lib/MerchiSDK/entities/supply_domain.js +0 -85
- package/lib/MerchiSDK/entities/system_role.js +0 -65
- package/lib/MerchiSDK/entities/theme.js +0 -566
- package/lib/MerchiSDK/entities/theme_css_setting.js +0 -80
- package/lib/MerchiSDK/entities/user.js +0 -680
- package/lib/MerchiSDK/entities/user_company.js +0 -90
- package/lib/MerchiSDK/entities/variation.js +0 -149
- package/lib/MerchiSDK/entities/variation_field.js +0 -296
- package/lib/MerchiSDK/entities/variation_fields_option.js +0 -200
- package/lib/MerchiSDK/entities/variation_option.js +0 -125
- package/lib/MerchiSDK/entities/variations_group.js +0 -119
- package/lib/MerchiSDK/entity.js +0 -799
- package/lib/MerchiSDK/merchi.js +0 -320
- package/lib/MerchiSDK/request.js +0 -108
- package/lib/MerchiSDK/test_util.js +0 -15
- package/lib/MerchiSDK/toasts.js +0 -25
- package/lib/MerchiSDK/util/float.js +0 -12
- package/lib/MerchiSDK/util/query_string.js +0 -11
- package/lib/MerchiSDK/util/validation.js +0 -1
- package/lib/MerchiSDK/uuid.js +0 -8
package/lib/Cart.js
CHANGED
|
@@ -1,58 +1,69 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports["default"] = Cart;
|
|
7
|
+
var React = _interopRequireWildcard(require("react"));
|
|
8
|
+
var _reactRedux = require("react-redux");
|
|
9
|
+
var _store = require("./store");
|
|
10
|
+
var _CartAlert = _interopRequireDefault(require("./CartAlert"));
|
|
11
|
+
var _CartHeader = _interopRequireDefault(require("./CartHeader"));
|
|
12
|
+
var _CartNav = _interopRequireDefault(require("./tabs/CartNav"));
|
|
13
|
+
var _CartTotals = _interopRequireDefault(require("./CartTotals"));
|
|
14
|
+
var _CartProvider = _interopRequireWildcard(require("./CartProvider"));
|
|
15
|
+
var _buttons = require("./buttons");
|
|
16
|
+
var _components = require("./components");
|
|
17
|
+
var _panels = require("./panels");
|
|
18
|
+
var _sliceCart = require("./slices/sliceCart");
|
|
19
|
+
require("./styles/globals.css");
|
|
20
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
21
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
22
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
23
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
|
|
24
|
+
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); }
|
|
25
|
+
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; }
|
|
26
|
+
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; }
|
|
27
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
28
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
29
|
+
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); }
|
|
18
30
|
function CartComponents() {
|
|
19
|
-
|
|
20
|
-
domainId,
|
|
21
|
-
includeTheme,
|
|
22
|
-
initialiseCart
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
React.useEffect(()
|
|
31
|
+
var _useCartContext = (0, _CartProvider.useCartContext)(),
|
|
32
|
+
domainId = _useCartContext.domainId,
|
|
33
|
+
includeTheme = _useCartContext.includeTheme,
|
|
34
|
+
initialiseCart = _useCartContext.initialiseCart;
|
|
35
|
+
var _useSelector = (0, _reactRedux.useSelector)(function (s) {
|
|
36
|
+
return s.stateCart;
|
|
37
|
+
}),
|
|
38
|
+
activeTab = _useSelector.activeTab,
|
|
39
|
+
cartSettingsInvalid = _useSelector.cartSettingsInvalid,
|
|
40
|
+
fetchingCart = _useSelector.fetchingCart;
|
|
41
|
+
React.useEffect(function () {
|
|
30
42
|
if (initialiseCart && domainId) {
|
|
31
43
|
if (includeTheme) {
|
|
32
|
-
actionFetchTheme(domainId);
|
|
44
|
+
(0, _store.actionFetchTheme)(domainId);
|
|
33
45
|
}
|
|
34
|
-
initMerchiCart(domainId);
|
|
46
|
+
(0, _store.initMerchiCart)(domainId);
|
|
35
47
|
}
|
|
36
48
|
}, [domainId, includeTheme, initialiseCart]);
|
|
37
|
-
return /*#__PURE__*/
|
|
38
|
-
children: [/*#__PURE__*/
|
|
49
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
50
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_CartHeader["default"], {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_CartAlert["default"], {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_CartNav["default"], {}), fetchingCart ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.LoadingTemplate, {}) : cartSettingsInvalid ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.CartPaymentSettingsInvalid, {}) : /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
39
51
|
className: "merchi-tab-pane",
|
|
40
|
-
children: [/*#__PURE__*/
|
|
41
|
-
children: [/*#__PURE__*/
|
|
42
|
-
children: /*#__PURE__*/
|
|
43
|
-
}), /*#__PURE__*/
|
|
44
|
-
children: [/*#__PURE__*/
|
|
52
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_panels.PanelClearCart, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_panels.PanelEditCartItem, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_panels.PanelCartItems, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_panels.PanelCartShipment, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_panels.PanelClientCheckout, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_panels.PanelPaymentSuccess, {}), ![_sliceCart.tabIdItem, _sliceCart.tabIdClearCart, _sliceCart.tabIdPaymentSuccess].includes(activeTab) && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
53
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_components.CartFooter, {
|
|
54
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_CartTotals["default"], {})
|
|
55
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_components.CartFooter, {
|
|
56
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_buttons.ButtonClearCart, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_buttons.ButtonBack, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_buttons.ButtonNextDynamic, {})]
|
|
45
57
|
})]
|
|
46
58
|
})]
|
|
47
59
|
})]
|
|
48
60
|
});
|
|
49
61
|
}
|
|
50
|
-
|
|
51
|
-
return /*#__PURE__*/
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
children: /*#__PURE__*/_jsx(CartComponents, {})
|
|
62
|
+
function Cart(props) {
|
|
63
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_CartProvider["default"], _objectSpread(_objectSpread({}, props), {}, {
|
|
64
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactRedux.Provider, {
|
|
65
|
+
store: _store.store,
|
|
66
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(CartComponents, {})
|
|
56
67
|
})
|
|
57
|
-
});
|
|
68
|
+
}));
|
|
58
69
|
}
|
package/lib/CartAlert.js
CHANGED
|
@@ -1,43 +1,45 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports["default"] = void 0;
|
|
7
|
+
var _reactRedux = require("react-redux");
|
|
8
|
+
var _reactFontawesome = require("@fortawesome/react-fontawesome");
|
|
9
|
+
var _freeSolidSvgIcons = require("@fortawesome/free-solid-svg-icons");
|
|
10
|
+
var _components = require("./components");
|
|
11
|
+
var _store = require("./store");
|
|
12
|
+
var _CartProvider = require("./CartProvider");
|
|
13
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
10
14
|
function CartAlert() {
|
|
11
|
-
|
|
12
|
-
classNameBtnClose
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
return /*#__PURE__*/_jsx(_Fragment, {
|
|
24
|
-
children: show && /*#__PURE__*/_jsxs(Alert, {
|
|
15
|
+
var _useCartContext = (0, _CartProvider.useCartContext)(),
|
|
16
|
+
classNameBtnClose = _useCartContext.classNameBtnClose;
|
|
17
|
+
var _useSelector = (0, _reactRedux.useSelector)(function (s) {
|
|
18
|
+
return s.stateCartAlert;
|
|
19
|
+
}),
|
|
20
|
+
alert = _useSelector.alert;
|
|
21
|
+
var icon = alert.icon,
|
|
22
|
+
message = alert.message,
|
|
23
|
+
show = alert.show,
|
|
24
|
+
title = alert.title;
|
|
25
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {
|
|
26
|
+
children: show && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_components.Alert, {
|
|
25
27
|
alertType: alert.type,
|
|
26
|
-
children: [icon && /*#__PURE__*/
|
|
28
|
+
children: [icon && /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactFontawesome.FontAwesomeIcon, {
|
|
27
29
|
icon: icon
|
|
28
|
-
}), " ", /*#__PURE__*/
|
|
30
|
+
}), " ", /*#__PURE__*/(0, _jsxRuntime.jsx)("strong", {
|
|
29
31
|
children: title
|
|
30
|
-
}), " ", message, /*#__PURE__*/
|
|
32
|
+
}), " ", message, /*#__PURE__*/(0, _jsxRuntime.jsx)("button", {
|
|
31
33
|
type: "button",
|
|
32
34
|
className: classNameBtnClose,
|
|
33
35
|
"data-bs-dismiss": "alert",
|
|
34
36
|
"aria-label": "Close",
|
|
35
|
-
onClick: closeAlert,
|
|
36
|
-
children: /*#__PURE__*/
|
|
37
|
-
icon: faTimes
|
|
37
|
+
onClick: _store.closeAlert,
|
|
38
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactFontawesome.FontAwesomeIcon, {
|
|
39
|
+
icon: _freeSolidSvgIcons.faTimes
|
|
38
40
|
})
|
|
39
41
|
})]
|
|
40
42
|
})
|
|
41
43
|
});
|
|
42
44
|
}
|
|
43
|
-
|
|
45
|
+
var _default = exports["default"] = CartAlert;
|
package/lib/CartHeader.js
CHANGED
|
@@ -1,28 +1,35 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
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 _reactFontawesome = require("@fortawesome/react-fontawesome");
|
|
10
|
+
var _freeSolidSvgIcons = require("@fortawesome/free-solid-svg-icons");
|
|
11
|
+
var _CartProvider = require("./CartProvider");
|
|
12
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
13
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
14
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
|
|
7
15
|
function CartHeader() {
|
|
8
|
-
|
|
9
|
-
classNameCartHeader,
|
|
10
|
-
classNameBtnClose,
|
|
11
|
-
onClickClose
|
|
12
|
-
|
|
13
|
-
return /*#__PURE__*/_jsxs("div", {
|
|
16
|
+
var _useCartContext = (0, _CartProvider.useCartContext)(),
|
|
17
|
+
classNameCartHeader = _useCartContext.classNameCartHeader,
|
|
18
|
+
classNameBtnClose = _useCartContext.classNameBtnClose,
|
|
19
|
+
onClickClose = _useCartContext.onClickClose;
|
|
20
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
14
21
|
className: classNameCartHeader,
|
|
15
|
-
children: [/*#__PURE__*/
|
|
16
|
-
icon: faShoppingCart
|
|
17
|
-
}), " Shopping cart", /*#__PURE__*/
|
|
22
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactFontawesome.FontAwesomeIcon, {
|
|
23
|
+
icon: _freeSolidSvgIcons.faShoppingCart
|
|
24
|
+
}), " Shopping cart", /*#__PURE__*/(0, _jsxRuntime.jsx)("button", {
|
|
18
25
|
type: "button",
|
|
19
26
|
className: classNameBtnClose,
|
|
20
27
|
"aria-label": "Close",
|
|
21
28
|
onClick: onClickClose,
|
|
22
|
-
children: /*#__PURE__*/
|
|
23
|
-
icon: faTimes
|
|
29
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactFontawesome.FontAwesomeIcon, {
|
|
30
|
+
icon: _freeSolidSvgIcons.faTimes
|
|
24
31
|
})
|
|
25
32
|
})]
|
|
26
33
|
});
|
|
27
34
|
}
|
|
28
|
-
|
|
35
|
+
var _default = exports["default"] = CartHeader;
|