merchi_cart 0.0.4-a → 0.0.4-c
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 +64 -30
- package/lib/CartAlert.js +42 -14
- package/lib/CartHeader.js +32 -8
- package/lib/CartProvider.js +313 -164
- package/lib/CartTotals.js +98 -33
- package/lib/MerchiSDK/constants/auto_assign_production_on_actions.js +11 -8
- package/lib/MerchiSDK/constants/call_to_actions.js +19 -16
- package/lib/MerchiSDK/constants/discount_types.js +8 -5
- package/lib/MerchiSDK/constants/domain_types.js +17 -14
- package/lib/MerchiSDK/constants/errors.js +37 -34
- package/lib/MerchiSDK/constants/event_types.js +10 -7
- package/lib/MerchiSDK/constants/field_types.js +18 -15
- package/lib/MerchiSDK/constants/input_types.js +18 -15
- package/lib/MerchiSDK/constants/inventory_statuses.js +11 -8
- package/lib/MerchiSDK/constants/invoice_types.js +10 -7
- package/lib/MerchiSDK/constants/item_types.js +10 -7
- package/lib/MerchiSDK/constants/job/drafting_status.js +12 -9
- package/lib/MerchiSDK/constants/job/payment_status.js +12 -9
- package/lib/MerchiSDK/constants/job/production_status.js +17 -14
- package/lib/MerchiSDK/constants/job/shipment_status.js +16 -13
- package/lib/MerchiSDK/constants/job/supply_chain_request_status.js +11 -8
- package/lib/MerchiSDK/constants/job_priorities.js +11 -8
- package/lib/MerchiSDK/constants/job_status.js +54 -51
- package/lib/MerchiSDK/constants/job_types.js +20 -17
- package/lib/MerchiSDK/constants/notification_sections.js +18 -15
- package/lib/MerchiSDK/constants/notification_types.js +102 -99
- package/lib/MerchiSDK/constants/notification_urgencies.js +11 -8
- package/lib/MerchiSDK/constants/payment_types.js +15 -12
- package/lib/MerchiSDK/constants/platform.js +10 -7
- package/lib/MerchiSDK/constants/product_types.js +30 -27
- package/lib/MerchiSDK/constants/rights.js +10 -7
- package/lib/MerchiSDK/constants/robots_meta_directives.js +5 -12
- package/lib/MerchiSDK/constants/roles.js +30 -35
- package/lib/MerchiSDK/constants/shipment_companies.js +23 -20
- package/lib/MerchiSDK/constants/shipment_services.js +8 -5
- package/lib/MerchiSDK/constants/system_roles.js +8 -5
- package/lib/MerchiSDK/constants/theme_foundations.js +11 -8
- package/lib/MerchiSDK/constants/theme_status.js +10 -7
- package/lib/MerchiSDK/constants/user_types.js +22 -19
- package/lib/MerchiSDK/constants/white_label_accessibilities.js +10 -7
- package/lib/MerchiSDK/cookie.js +19 -16
- package/lib/MerchiSDK/entities/address.js +169 -102
- package/lib/MerchiSDK/entities/assignment.js +187 -124
- package/lib/MerchiSDK/entities/automatic_payment_relationship.js +80 -48
- package/lib/MerchiSDK/entities/backup.js +47 -28
- package/lib/MerchiSDK/entities/bank.js +119 -78
- package/lib/MerchiSDK/entities/cart.js +204 -134
- package/lib/MerchiSDK/entities/cart_item.js +153 -108
- package/lib/MerchiSDK/entities/cart_shipment_group.js +65 -38
- package/lib/MerchiSDK/entities/cart_shipment_quote.js +88 -59
- package/lib/MerchiSDK/entities/category.js +95 -63
- package/lib/MerchiSDK/entities/company.js +651 -435
- package/lib/MerchiSDK/entities/company_invitation.js +85 -59
- package/lib/MerchiSDK/entities/component.js +211 -144
- package/lib/MerchiSDK/entities/component_tag.js +53 -33
- package/lib/MerchiSDK/entities/component_version.js +83 -53
- package/lib/MerchiSDK/entities/country_tax.js +112 -69
- package/lib/MerchiSDK/entities/discount.js +79 -52
- package/lib/MerchiSDK/entities/discount_group.js +77 -47
- package/lib/MerchiSDK/entities/domain.js +536 -371
- package/lib/MerchiSDK/entities/domain_invitation.js +93 -64
- package/lib/MerchiSDK/entities/domain_tag.js +103 -68
- package/lib/MerchiSDK/entities/draft.js +179 -121
- package/lib/MerchiSDK/entities/draft_comment.js +135 -90
- package/lib/MerchiSDK/entities/draft_template.js +108 -70
- package/lib/MerchiSDK/entities/email_address.js +71 -42
- package/lib/MerchiSDK/entities/email_counter.js +59 -38
- package/lib/MerchiSDK/entities/enrolled_domain.js +87 -60
- package/lib/MerchiSDK/entities/exchange_rate.js +65 -42
- package/lib/MerchiSDK/entities/file.js +385 -248
- package/lib/MerchiSDK/entities/internal_tag.js +123 -77
- package/lib/MerchiSDK/entities/inventory.js +122 -79
- package/lib/MerchiSDK/entities/inventory_unit_variation.js +66 -44
- package/lib/MerchiSDK/entities/invoice.js +423 -285
- package/lib/MerchiSDK/entities/item.js +104 -68
- package/lib/MerchiSDK/entities/job.js +743 -522
- package/lib/MerchiSDK/entities/job_comment.js +123 -84
- package/lib/MerchiSDK/entities/matching_inventory.js +80 -50
- package/lib/MerchiSDK/entities/menu.js +81 -53
- package/lib/MerchiSDK/entities/menu_item.js +79 -53
- package/lib/MerchiSDK/entities/notification.js +237 -163
- package/lib/MerchiSDK/entities/page.js +87 -58
- package/lib/MerchiSDK/entities/payment.js +143 -99
- package/lib/MerchiSDK/entities/payment_device.js +90 -53
- package/lib/MerchiSDK/entities/phone_number.js +101 -62
- package/lib/MerchiSDK/entities/product.js +801 -583
- package/lib/MerchiSDK/entities/production_comment.js +123 -84
- package/lib/MerchiSDK/entities/quote.js +205 -138
- package/lib/MerchiSDK/entities/quote_item.js +120 -84
- package/lib/MerchiSDK/entities/seo_domain_page.js +85 -59
- package/lib/MerchiSDK/entities/session.js +80 -50
- package/lib/MerchiSDK/entities/shipment.js +400 -265
- package/lib/MerchiSDK/entities/shipment_item.js +52 -28
- package/lib/MerchiSDK/entities/shipment_item_fulfillment.js +51 -29
- package/lib/MerchiSDK/entities/shipment_method.js +149 -101
- package/lib/MerchiSDK/entities/shipment_method_variation.js +107 -68
- package/lib/MerchiSDK/entities/short_url.js +98 -63
- package/lib/MerchiSDK/entities/subscription_plan.js +175 -124
- package/lib/MerchiSDK/entities/supply_domain.js +76 -49
- package/lib/MerchiSDK/entities/system_role.js +53 -33
- package/lib/MerchiSDK/entities/theme.js +615 -420
- package/lib/MerchiSDK/entities/theme_css_setting.js +70 -43
- package/lib/MerchiSDK/entities/user.js +734 -482
- package/lib/MerchiSDK/entities/user_company.js +81 -49
- package/lib/MerchiSDK/entities/variation.js +150 -101
- package/lib/MerchiSDK/entities/variation_field.js +311 -236
- package/lib/MerchiSDK/entities/variation_fields_option.js +191 -133
- package/lib/MerchiSDK/entities/variation_option.js +132 -92
- package/lib/MerchiSDK/entities/variations_group.js +114 -70
- package/lib/MerchiSDK/entity.js +852 -756
- package/lib/MerchiSDK/merchi.js +326 -301
- package/lib/MerchiSDK/request.js +133 -109
- package/lib/MerchiSDK/test_util.js +22 -16
- package/lib/MerchiSDK/toasts.js +31 -14
- package/lib/MerchiSDK/util/float.js +27 -13
- package/lib/MerchiSDK/util/query_string.js +14 -12
- package/lib/MerchiSDK/util/validation.js +7 -3
- package/lib/MerchiSDK/uuid.js +12 -10
- package/lib/buttons/Button.js +31 -8
- package/lib/buttons/ButtonBack.js +45 -22
- package/lib/buttons/ButtonClearCart.js +21 -9
- package/lib/buttons/ButtonInvoiceDownload.js +95 -23
- package/lib/buttons/ButtonNext.js +50 -17
- package/lib/buttons/ButtonNextDynamic.js +28 -15
- package/lib/buttons/ButtonPay.js +34 -10
- package/lib/buttons/ButtonShipmentTabNext.js +39 -14
- package/lib/buttons/index.js +47 -14
- package/lib/components/Alert.js +34 -18
- package/lib/components/CartBody.js +22 -8
- package/lib/components/CartClient.js +58 -25
- package/lib/components/CartFooter.js +20 -8
- package/lib/components/CartItemRow.js +132 -27
- package/lib/components/CartPaymentSettingsInvalid.js +20 -5
- package/lib/components/CartShipment.js +59 -20
- package/lib/components/CartTabContent.js +20 -8
- package/lib/components/CartTabPanel.js +28 -18
- package/lib/components/CartTableContainer.js +20 -8
- package/lib/components/Collapse.js +39 -11
- package/lib/components/LoadingTemplate.js +27 -12
- package/lib/components/NoCartItems.js +26 -7
- package/lib/components/ShipmentGroupCard.js +145 -46
- package/lib/components/Table.js +16 -8
- package/lib/components/Title.js +34 -9
- package/lib/components/containers.js +38 -18
- package/lib/components/index.js +105 -29
- package/lib/forms/FormNewCustomer.js +161 -47
- package/lib/forms/FormReturningCustomer.js +93 -24
- package/lib/forms/FormShipmentAddressAndNotes.js +116 -46
- package/lib/forms/FormSquarePayment.js +18 -8
- package/lib/forms/FormStripePayment.js +18 -8
- package/lib/forms/InputAcceptUserTermsAndConditions.js +39 -7
- package/lib/forms/InputError.js +23 -10
- package/lib/forms/InputSelect.js +53 -16
- package/lib/forms/InputText.js +61 -19
- package/lib/forms/InputsAddress.js +225 -63
- package/lib/index.js +27 -8
- package/lib/panels/PanelCartItems.js +59 -11
- package/lib/panels/PanelCartShipment.js +71 -16
- package/lib/panels/PanelClearCart.js +49 -12
- package/lib/panels/PanelClientCheckout.js +79 -23
- package/lib/panels/PanelEditCartItem.js +64 -20
- package/lib/panels/PanelPaymentSuccess.js +70 -19
- package/lib/panels/index.js +47 -14
- package/lib/slices/sliceCart.js +172 -143
- package/lib/slices/sliceCartAlert.js +44 -37
- package/lib/slices/sliceCartItem.js +31 -25
- package/lib/slices/sliceCartPayment.js +46 -37
- package/lib/slices/sliceCartShipment.js +73 -64
- package/lib/slices/sliceFormReturningCustomer.js +25 -21
- package/lib/slices/sliceNewCustomerForm.js +24 -20
- package/lib/square/SquareCard.js +54 -39
- package/lib/square/actions.js +56 -27
- package/lib/square/slices/reducersSquare.js +12 -7
- package/lib/square/slices/sliceSquareAlerts.js +35 -25
- package/lib/square/slices/sliceSquareForm.js +31 -25
- package/lib/store.js +685 -355
- package/lib/stripe/StripeCardFields.js +133 -35
- package/lib/stripe/StripeCardForm.js +144 -50
- package/lib/stripe/StripePaymentButtons.js +100 -65
- package/lib/stripe/actions.js +204 -64
- package/lib/stripe/slices/sliceStripeAlerts.js +35 -25
- package/lib/stripe/slices/sliceStripeCardForm.js +12 -7
- package/lib/stripe/slices/sliceStripeForm.js +59 -53
- package/lib/stripe/utils.js +22 -20
- package/lib/tabs/CartNav.js +38 -12
- package/lib/tabs/NavTab.js +43 -16
- package/lib/utilities/address.js +341 -334
- package/lib/utilities/cart.js +84 -55
- package/lib/utilities/company.js +9 -8
- package/lib/utilities/cookie.js +138 -54
- package/lib/utilities/currency.js +214 -205
- package/lib/utilities/helpers.js +208 -162
- package/lib/utilities/invoice.js +123 -46
- package/lib/utilities/product.js +10 -8
- package/lib/utilities/user.js +77 -24
- package/lib/utilities/variations.js +48 -47
- package/package.json +7 -6
package/lib/Cart.js
CHANGED
|
@@ -1,35 +1,69 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
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");
|
|
17
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
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
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 () {
|
|
42
|
+
if (initialiseCart && domainId) {
|
|
43
|
+
if (includeTheme) {
|
|
44
|
+
(0, _store.actionFetchTheme)(domainId);
|
|
45
|
+
}
|
|
46
|
+
(0, _store.initMerchiCart)(domainId);
|
|
47
|
+
}
|
|
48
|
+
}, [domainId, includeTheme, initialiseCart]);
|
|
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", {
|
|
51
|
+
className: "merchi-tab-pane",
|
|
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, {})]
|
|
57
|
+
})]
|
|
58
|
+
})]
|
|
59
|
+
})]
|
|
60
|
+
});
|
|
31
61
|
}
|
|
32
62
|
function Cart(props) {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
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, {})
|
|
67
|
+
})
|
|
68
|
+
}));
|
|
69
|
+
}
|
package/lib/CartAlert.js
CHANGED
|
@@ -1,17 +1,45 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
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
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
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, {
|
|
27
|
+
alertType: alert.type,
|
|
28
|
+
children: [icon && /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactFontawesome.FontAwesomeIcon, {
|
|
29
|
+
icon: icon
|
|
30
|
+
}), " ", /*#__PURE__*/(0, _jsxRuntime.jsx)("strong", {
|
|
31
|
+
children: title
|
|
32
|
+
}), " ", message, /*#__PURE__*/(0, _jsxRuntime.jsx)("button", {
|
|
33
|
+
type: "button",
|
|
34
|
+
className: classNameBtnClose,
|
|
35
|
+
"data-bs-dismiss": "alert",
|
|
36
|
+
"aria-label": "Close",
|
|
37
|
+
onClick: _store.closeAlert,
|
|
38
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactFontawesome.FontAwesomeIcon, {
|
|
39
|
+
icon: _freeSolidSvgIcons.faTimes
|
|
40
|
+
})
|
|
41
|
+
})]
|
|
42
|
+
})
|
|
43
|
+
});
|
|
16
44
|
}
|
|
17
|
-
exports
|
|
45
|
+
var _default = exports["default"] = CartAlert;
|
package/lib/CartHeader.js
CHANGED
|
@@ -1,11 +1,35 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
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
|
-
|
|
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", {
|
|
21
|
+
className: classNameCartHeader,
|
|
22
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactFontawesome.FontAwesomeIcon, {
|
|
23
|
+
icon: _freeSolidSvgIcons.faShoppingCart
|
|
24
|
+
}), " Shopping cart", /*#__PURE__*/(0, _jsxRuntime.jsx)("button", {
|
|
25
|
+
type: "button",
|
|
26
|
+
className: classNameBtnClose,
|
|
27
|
+
"aria-label": "Close",
|
|
28
|
+
onClick: onClickClose,
|
|
29
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactFontawesome.FontAwesomeIcon, {
|
|
30
|
+
icon: _freeSolidSvgIcons.faTimes
|
|
31
|
+
})
|
|
32
|
+
})]
|
|
33
|
+
});
|
|
10
34
|
}
|
|
11
|
-
exports
|
|
35
|
+
var _default = exports["default"] = CartHeader;
|