merchi_cart 0.0.3-h → 0.0.3

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/README.md CHANGED
@@ -56,7 +56,7 @@ yarn add merchi_cart
56
56
  | `classNameCartFormCheckbox` | `string?` | `"form-check-input"` | `Class for form input checkbpx` |
57
57
  | `classNameCartHeader` | `string?` | `"merchi-cart-header"` | `Class for cart header container` |
58
58
  | `classNameCartInputError` | `string?` | `"text-danger"` | `Class for form error` |
59
- | `classNameCartNav` | `string?` | `"nav merchi-nav-tabs merchi-nav merchi-nav-fill merchi-nav-pills"` | `Class for cart nav` |
59
+ | `classNameCartNav` | `string?` | `"nav nav-tabs merchi-nav merchi-nav-fill merchi-nav-pills"` | `Class for cart nav` |
60
60
  | `classNameNoItems` | `string?` | `"merchi-no-cart-items"` | `Class for no items in cart` |
61
61
  | `classNameCartGoogleSuggestList` | `string?` | `"list-group m-b-0"` | `Class for google suggest list` |
62
62
  | `classNameCartGoogleSuggestListItem` | `string?` | `"list-group-item cursor-pointer"` | `Class for google suggest list item` |
@@ -70,7 +70,7 @@ yarn add merchi_cart
70
70
  | `classNameTableContainer` | `string?` | `"table-responsive"` | `Class for cart table container` |
71
71
  | `classNameCartTab` | `string?` | `"merchi-tab-content"` | `Class for cart tab container` |
72
72
  | `classNameCartTabItem` | `string?` | `"nav-item merchi-nav-item"` | `Class for cart tab item` |
73
- | `classNameCartTabItemLink` | `string?` | `"merchi-nav-link"` | `Class for cart tab item link |`
73
+ | `classNameCartTabItemLink` | `string?` | `"nav-link merchi-nav-link"` | `Class for cart tab item link |`
74
74
  | `classNameCartTitle` | `string?` | `"merchi-cart-title"` | `Class for cart Title container` |
75
75
  | `classNameCartTotalContainer` | `string?` | `"merchi-cart-total-container"` | `Class for totals container elements` |
76
76
  | `classNameCartTotalItem` | `string?` | `"merchi-cart-total-item"` | `Class for totals item elements` |
package/lib/Cart.js CHANGED
@@ -15,7 +15,6 @@ import { Provider, useSelector } from 'react-redux';
15
15
  import { store } from './store';
16
16
  import CartAlert from './CartAlert';
17
17
  import CartHeader from './CartHeader';
18
- import CartNav from './tabs/CartNav';
19
18
  import CartTotals from './CartTotals';
20
19
  import CartProvider, { useCartContext } from './CartProvider';
21
20
  import { ButtonBack, ButtonClearCart, ButtonNextDynamic, } from './buttons';
@@ -32,10 +31,11 @@ function CartComponents() {
32
31
  if (includeTheme) {
33
32
  actionFetchTheme(domainId);
34
33
  }
34
+ console.log(domainId, 'whjat os tjos');
35
35
  initMerchiCart(domainId);
36
36
  }
37
37
  }, [domainId, includeTheme, initialiseCart]);
38
- return (_jsxs(_Fragment, { children: [_jsx(CartHeader, {}), _jsx(CartAlert, {}), _jsx(CartNav, {}), fetchingCart ? (_jsx(LoadingTemplate, {})) : cartSettingsInvalid ? (_jsx(CartPaymentSettingsInvalid, {})) : (_jsxs("div", { className: 'merchi-tab-pane', children: [_jsx(PanelClearCart, {}), _jsx(PanelEditCartItem, {}), _jsx(PanelCartItems, {}), _jsx(PanelCartShipment, {}), _jsx(PanelClientCheckout, {}), _jsx(PanelPaymentSuccess, {}), ![tabIdItem, tabIdClearCart, tabIdPaymentSuccess].includes(activeTab) &&
38
+ return (_jsxs(_Fragment, { children: [_jsx(CartHeader, {}), _jsx(CartAlert, {}), fetchingCart ? (_jsx(LoadingTemplate, {})) : cartSettingsInvalid ? (_jsx(CartPaymentSettingsInvalid, {})) : (_jsxs("div", { className: 'merchi-tab-pane', children: [_jsx(PanelClearCart, {}), _jsx(PanelEditCartItem, {}), _jsx(PanelCartItems, {}), _jsx(PanelCartShipment, {}), _jsx(PanelClientCheckout, {}), _jsx(PanelPaymentSuccess, {}), ![tabIdItem, tabIdClearCart, tabIdPaymentSuccess].includes(activeTab) &&
39
39
  _jsxs(_Fragment, { children: [_jsx(CartFooter, { children: _jsx(CartTotals, {}) }), _jsxs(CartFooter, { children: [_jsx(ButtonClearCart, {}), _jsx(ButtonBack, {}), _jsx(ButtonNextDynamic, {})] })] })] }))] }));
40
40
  }
41
41
  export default function Cart(props) {
@@ -91,7 +91,7 @@ export var useCartContext = function () { return useContext(CartContext); };
91
91
  var CartProvider = function (_a) {
92
92
  var children = _a.children, _b = _a.classNameAlertError, classNameAlertError = _b === void 0 ? 'alert alert-danger' : _b, _c = _a.classNameAlertInfo, classNameAlertInfo = _c === void 0 ? 'alert alert-info' : _c, _d = _a.classNameAlertSuccess, classNameAlertSuccess = _d === void 0 ? 'alert alert-success' : _d, _e = _a.classNameAlertWarning, classNameAlertWarning = _e === void 0 ? 'alert alert-warning' : _e, _f = _a.classNameBtn, classNameBtn = _f === void 0 ? 'btn' : _f, _g = _a.classNameBtnBack, classNameBtnBack = _g === void 0 ? 'btn-lg btn-default pull-left' : _g, _h = _a.classNameBtnCartClear, classNameBtnCartClear = _h === void 0 ? 'btn-lg btn-danger mr-auto' : _h, _j = _a.classNameBtnClose, classNameBtnClose = _j === void 0 ? 'btn-close' : _j, _k = _a.classNameBtnDanger, classNameBtnDanger = _k === void 0 ? 'btn btn-md btn-danger' : _k, _l = _a.classNameBtnDefault, classNameBtnDefault = _l === void 0 ? 'btn btn-md btn-default' : _l, _m = _a.classNameBtnDownloadInvoice, classNameBtnDownloadInvoice = _m === void 0 ? 'btn btn-lg btn-primary' : _m, _o = _a.classNameBtnPrimary, classNameBtnPrimary = _o === void 0 ? 'btn btn-md btn-primary' : _o, _p = _a.classNameBtnLink, classNameBtnLink = _p === void 0 ? 'btn-md btn-link' : _p, _q = _a.classNameBtnNext, classNameBtnNext = _q === void 0 ? 'btn-lg btn-primary' : _q, _r = _a.classNameBtnNextComplete, classNameBtnNextComplete = _r === void 0 ? 'btn-lg btn-success' : _r, _s = _a.classNameBtnPay, classNameBtnPay = _s === void 0 ? 'btn-lg btn-primary width-full' : _s, _t = _a.classNameCartBody, classNameCartBody = _t === void 0 ? 'merchi-cart-body' : _t, _u = _a.classNameCartFooter, classNameCartFooter = _u === void 0 ? 'merchi-cart-footer' : _u, // add to sass
93
93
  _v = _a.classNameCartFormCheckbox, // add to sass
94
- classNameCartFormCheckbox = _v === void 0 ? 'form-check-input' : _v, _w = _a.classNameCartFormGroup, classNameCartFormGroup = _w === void 0 ? 'form-group' : _w, _x = _a.classNameCartFormGroupCheckbox, classNameCartFormGroupCheckbox = _x === void 0 ? 'form-check' : _x, _y = _a.classNameCartFormInput, classNameCartFormInput = _y === void 0 ? 'form-control' : _y, _z = _a.classNameCartFormLabelCheckbox, classNameCartFormLabelCheckbox = _z === void 0 ? '' : _z, _0 = _a.classNameCartInputError, classNameCartInputError = _0 === void 0 ? 'text-danger' : _0, _1 = _a.classNameCartNav, classNameCartNav = _1 === void 0 ? 'nav merchi-nav-tabs merchi-nav merchi-nav-fill merchi-nav-pills' : _1, _2 = _a.classNameCartRow, classNameCartRow = _2 === void 0 ? 'merchi-row' : _2, _3 = _a.classNameCartRowColumn, classNameCartRowColumn = _3 === void 0 ? 'merchi-column' : _3, _4 = _a.classNameCartTabItem, classNameCartTabItem = _4 === void 0 ? 'nav-item merchi-nav-item' : _4, _5 = _a.classNameCartTabItemLink, classNameCartTabItemLink = _5 === void 0 ? 'merchi-nav-link' : _5, _6 = _a.classNameCartGoogleSuggestList, classNameCartGoogleSuggestList = _6 === void 0 ? 'list-group m-b-0' : _6, _7 = _a.classNameCartGoogleSuggestListItem, classNameCartGoogleSuggestListItem = _7 === void 0 ? 'list-group-item cursor-pointer' : _7, _8 = _a.classNameCartHeader, classNameCartHeader = _8 === void 0 ? 'merchi-cart-header' : _8, // add to sass
94
+ classNameCartFormCheckbox = _v === void 0 ? 'form-check-input' : _v, _w = _a.classNameCartFormGroup, classNameCartFormGroup = _w === void 0 ? 'form-group' : _w, _x = _a.classNameCartFormGroupCheckbox, classNameCartFormGroupCheckbox = _x === void 0 ? 'form-check' : _x, _y = _a.classNameCartFormInput, classNameCartFormInput = _y === void 0 ? 'form-control' : _y, _z = _a.classNameCartFormLabelCheckbox, classNameCartFormLabelCheckbox = _z === void 0 ? '' : _z, _0 = _a.classNameCartInputError, classNameCartInputError = _0 === void 0 ? 'text-danger' : _0, _1 = _a.classNameCartNav, classNameCartNav = _1 === void 0 ? 'nav nav-tabs merchi-nav merchi-nav-fill merchi-nav-pills' : _1, _2 = _a.classNameCartRow, classNameCartRow = _2 === void 0 ? 'merchi-row' : _2, _3 = _a.classNameCartRowColumn, classNameCartRowColumn = _3 === void 0 ? 'merchi-column' : _3, _4 = _a.classNameCartTabItem, classNameCartTabItem = _4 === void 0 ? 'nav-item merchi-nav-item' : _4, _5 = _a.classNameCartTabItemLink, classNameCartTabItemLink = _5 === void 0 ? 'nav-link merchi-nav-link' : _5, _6 = _a.classNameCartGoogleSuggestList, classNameCartGoogleSuggestList = _6 === void 0 ? 'list-group m-b-0' : _6, _7 = _a.classNameCartGoogleSuggestListItem, classNameCartGoogleSuggestListItem = _7 === void 0 ? 'list-group-item cursor-pointer' : _7, _8 = _a.classNameCartHeader, classNameCartHeader = _8 === void 0 ? 'merchi-cart-header' : _8, // add to sass
95
95
  _9 = _a.classNameCartItemFeatureImage, // add to sass
96
96
  classNameCartItemFeatureImage = _9 === void 0 ? 'img-rounded m-10' : _9, _10 = _a.classNameCartItemInfo, classNameCartItemInfo = _10 === void 0 ? 'text-muted font-weight-normal font-italic' : _10, _11 = _a.classNameCartItemInfoCell, classNameCartItemInfoCell = _11 === void 0 ? 'border-0 align-middle' : _11, _12 = _a.classNameCartItemInfoCellRight, classNameCartItemInfoCellRight = _12 === void 0 ? 'border-0 align-middle text-right' : _12, _13 = _a.classNameCartItemInfoContainer, classNameCartItemInfoContainer = _13 === void 0 ? 'ml-3 d-inline-block align-middle' : _13, _14 = _a.classNameCartTab, classNameCartTab = _14 === void 0 ? 'merchi-tab-content' : _14, _15 = _a.classNameCartTabPanel, classNameCartTabPanel = _15 === void 0 ? 'merchi-tab-panel' : _15, _16 = _a.classNameCartTitle, classNameCartTitle = _16 === void 0 ? 'merchi-cart-title' : _16, // add to sass // paddingBottom: '0.5rem', paddingTop: '0.5rem', textAlign: 'center',
97
97
  _17 = _a.classNameCartTotalContainer, // add to sass // paddingBottom: '0.5rem', paddingTop: '0.5rem', textAlign: 'center',
package/lib/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import Cart from './Cart.js';
2
- import { actionGetMerchiCart as getMerchiCart, getMerchiCartValues, isMerchiCartFetching, } from './store.js';
1
+ import Cart from './Cart';
2
+ import { getMerchiCart, getMerchiCartValues, isMerchiCartFetching, } from './store';
3
3
  export { getMerchiCart, getMerchiCartValues, isMerchiCartFetching, };
4
4
  export default Cart;
@@ -2,13 +2,14 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { useSelector } from 'react-redux';
3
3
  import CartItemRow from '../components/CartItemRow';
4
4
  import { tabIdItems } from '../slices/sliceCart';
5
+ import CartNav from '../tabs/CartNav';
5
6
  import { CartBody, CartTabContent, CartTableContainer, CartTabPanel, NoCartItems, Table, } from '../components';
6
7
  function PanelCartItems() {
7
8
  var _a = useSelector(function (s) { return s.stateCart; }), cart = _a.cart, deletingCartItemIndex = _a.deletingCartItemIndex;
8
9
  var cartItems = cart.cartItems ? cart.cartItems : [];
9
10
  var hasItems = cartItems.length > 0;
10
- return (_jsx(CartTabPanel, { tabId: tabIdItems, children: _jsx(CartBody, { children: _jsx(CartTabContent, { children: hasItems ? (_jsx(CartTableContainer, { children: _jsxs(Table, { children: [_jsx("thead", { children: _jsxs("tr", { children: [_jsx("th", { scope: 'col', className: 'merchi-cart-item-table-head', children: "Product" }), _jsx("th", { scope: 'col', className: 'merchi-cart-item-table-head-right', children: "Quantity" }), _jsx("th", { scope: 'col', className: 'merchi-cart-item-table-head-right', children: "Price" }), _jsx("th", { scope: 'col', className: 'merchi-cart-item-table-head-right', children: "Actions" })] }) }), _jsx("tbody", { children: cartItems.map(function (cartItem, index) {
11
- return _jsx(CartItemRow, { cartItem: cartItem, index: index, loading: deletingCartItemIndex === index }, cartItem.id);
12
- }) })] }) })) : (_jsx(NoCartItems, {})) }) }) }));
11
+ return (_jsx(CartTabPanel, { tabId: tabIdItems, children: _jsxs(CartBody, { children: [_jsx(CartNav, {}), _jsx(CartTabContent, { children: hasItems ? (_jsx(CartTableContainer, { children: _jsxs(Table, { children: [_jsx("thead", { children: _jsxs("tr", { children: [_jsx("th", { scope: 'col', className: 'merchi-cart-item-table-head', children: "Product" }), _jsx("th", { scope: 'col', className: 'merchi-cart-item-table-head-right', children: "Quantity" }), _jsx("th", { scope: 'col', className: 'merchi-cart-item-table-head-right', children: "Price" }), _jsx("th", { scope: 'col', className: 'merchi-cart-item-table-head-right', children: "Actions" })] }) }), _jsx("tbody", { children: cartItems.map(function (cartItem, index) {
12
+ return _jsx(CartItemRow, { cartItem: cartItem, index: index, loading: deletingCartItemIndex === index }, cartItem.id);
13
+ }) })] }) })) : (_jsx(NoCartItems, {})) })] }) }));
13
14
  }
14
15
  export default PanelCartItems;
@@ -5,15 +5,16 @@ import { ActiveFormShipmentAddressAndNotes } from '../forms/FormShipmentAddressA
5
5
  import { CheckoutContainer, InnerContainer, } from '../components/containers';
6
6
  import { Alert, CartBody, CartTabPanel, LoadingTemplateSm, ShipmentGroupCard, Title, } from '../components';
7
7
  import { tabIdShipment } from '../slices/sliceCart';
8
+ import CartNav from '../tabs/CartNav';
8
9
  function PanelCartShipment() {
9
10
  var _a = useSelector(function (s) { return s.stateCartShipment; }), fetchingShipmentGroups = _a.fetchingShipmentGroups, shipmentGroups = _a.shipmentGroups;
10
- return (_jsx(CartTabPanel, { tabId: tabIdShipment, children: _jsx(CartBody, { style: { paddingTop: '2rem' }, children: _jsxs("div", { className: 'merchi-cart-tab-content', children: [_jsx(CheckoutContainer, { textAlign: 'left', children: _jsx(InnerContainer, { width: 700, paddingBottom: '3rem', children: _jsx(ActiveFormShipmentAddressAndNotes, {}) }) }), fetchingShipmentGroups ? (_jsx(CheckoutContainer, { children: _jsxs(InnerContainer, { width: 700, children: [_jsx(LoadingTemplateSm, {}), _jsx("p", { children: "Fetching shipping options." })] }) })) : (_jsxs(_Fragment, { children: [_jsx(CheckoutContainer, { textAlign: 'left', children: _jsx(InnerContainer, { paddingBottom: '1rem', width: 700, children: _jsx(Title, { icon: faTruck, title: shipmentGroups.length > 1 ?
11
- 'Select shipment methods'
12
- : shipmentGroups.length ?
13
- 'Select a shipment method'
14
- : '' }) }) }), _jsx(CheckoutContainer, { textAlign: 'left', children: _jsxs(InnerContainer, { paddingBottom: '1rem', width: 700, children: [shipmentGroups.length > 1 &&
15
- _jsx(Alert, { alertType: 'warning', children: "Items within this cart are warehoused in different locations and will be shipped separately. Please select how you would like your items to be shipped." }), shipmentGroups.map(function (group, index) {
16
- return _jsx(ShipmentGroupCard, { group: group, groupIndex: index }, "".concat(index, "-shipment-group"));
17
- })] }) })] }))] }) }) }));
11
+ return (_jsxs(CartTabPanel, { tabId: tabIdShipment, children: [_jsx(CartNav, {}), _jsx(CartBody, { style: { paddingTop: '2rem' }, children: _jsxs("div", { className: 'merchi-cart-tab-content', children: [_jsx(CheckoutContainer, { textAlign: 'left', children: _jsx(InnerContainer, { width: 700, paddingBottom: '3rem', children: _jsx(ActiveFormShipmentAddressAndNotes, {}) }) }), fetchingShipmentGroups ? (_jsx(CheckoutContainer, { children: _jsxs(InnerContainer, { width: 700, children: [_jsx(LoadingTemplateSm, {}), _jsx("p", { children: "Fetching shipping options." })] }) })) : (_jsxs(_Fragment, { children: [_jsx(CheckoutContainer, { textAlign: 'left', children: _jsx(InnerContainer, { paddingBottom: '1rem', width: 700, children: _jsx(Title, { icon: faTruck, title: shipmentGroups.length > 1 ?
12
+ 'Select shipment methods'
13
+ : shipmentGroups.length ?
14
+ 'Select a shipment method'
15
+ : '' }) }) }), _jsx(CheckoutContainer, { textAlign: 'left', children: _jsxs(InnerContainer, { paddingBottom: '1rem', width: 700, children: [shipmentGroups.length > 1 &&
16
+ _jsx(Alert, { alertType: 'warning', children: "Items within this cart are warehoused in different locations and will be shipped separately. Please select how you would like your items to be shipped." }), shipmentGroups.map(function (group, index) {
17
+ return _jsx(ShipmentGroupCard, { group: group, groupIndex: index }, "".concat(index, "-shipment-group"));
18
+ })] }) })] }))] }) })] }));
18
19
  }
19
20
  export default PanelCartShipment;
@@ -1,6 +1,7 @@
1
1
  import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { useSelector } from 'react-redux';
3
3
  import { tabIdCheckout } from '../slices/sliceCart';
4
+ import CartNav from '../tabs/CartNav';
4
5
  import { CheckoutContainer, InnerContainer, } from '../components/containers';
5
6
  import CartClient from '../components/CartClient';
6
7
  import CartShipment from '../components/CartShipment';
@@ -14,11 +15,11 @@ function PanelClientCheckout() {
14
15
  var _a = useSelector(function (s) { return s.stateCart; }), cart = _a.cart, needsShipping = _a.needsShipping;
15
16
  var client = cart.client, domain = cart.domain;
16
17
  var company = domain && domain.company;
17
- return (_jsx(CartTabPanel, { tabId: tabIdCheckout, children: _jsx(CartBody, { style: { paddingTop: '2rem' }, children: client && client.id > -1 ?
18
- _jsxs(_Fragment, { children: [_jsx(CheckoutContainer, { children: _jsx(InnerContainer, { paddingBottom: '3rem', children: _jsx(CartClient, { client: client }) }) }), needsShipping &&
19
- _jsx(CheckoutContainer, { children: _jsx(InnerContainer, { paddingBottom: '3rem', children: _jsx(CartShipment, { cart: cart }) }) }), Boolean(company) && company.acceptSquare &&
20
- _jsx(CheckoutContainer, { children: _jsx(InnerContainer, { paddingBottom: '3rem', children: _jsx(FormSquarePayment, {}) }) }), _jsx(CheckoutContainer, { children: _jsx(InnerContainer, { children: _jsx(FormStripePayment, {}) }) })] })
21
- :
22
- _jsxs(_Fragment, { children: [_jsx(CheckoutContainer, { children: _jsxs(InnerContainer, { paddingBottom: '3rem', children: [_jsx(Title, { icon: faUserPlus, Title: 'Checkout as new customer' }), _jsx(FormNewCustomer, {})] }) }), _jsx(CheckoutContainer, { children: _jsxs(InnerContainer, { paddingBottom: '3rem', children: [_jsx(Title, { icon: faUserTag, Title: 'Checkout as returning customer' }), _jsx(FormReturningCustomer, {})] }) })] }) }) }));
18
+ return (_jsxs(CartTabPanel, { tabId: tabIdCheckout, children: [_jsx(CartNav, {}), _jsx(CartBody, { style: { paddingTop: '2rem' }, children: client && client.id > -1 ?
19
+ _jsxs(_Fragment, { children: [_jsx(CheckoutContainer, { children: _jsx(InnerContainer, { paddingBottom: '3rem', children: _jsx(CartClient, { client: client }) }) }), needsShipping &&
20
+ _jsx(CheckoutContainer, { children: _jsx(InnerContainer, { paddingBottom: '3rem', children: _jsx(CartShipment, { cart: cart }) }) }), Boolean(company) && company.acceptSquare &&
21
+ _jsx(CheckoutContainer, { children: _jsx(InnerContainer, { paddingBottom: '3rem', children: _jsx(FormSquarePayment, {}) }) }), _jsx(CheckoutContainer, { children: _jsx(InnerContainer, { children: _jsx(FormStripePayment, {}) }) })] })
22
+ :
23
+ _jsxs(_Fragment, { children: [_jsx(CheckoutContainer, { children: _jsxs(InnerContainer, { paddingBottom: '3rem', children: [_jsx(Title, { icon: faUserPlus, Title: 'Checkout as new customer' }), _jsx(FormNewCustomer, {})] }) }), _jsx(CheckoutContainer, { children: _jsxs(InnerContainer, { paddingBottom: '3rem', children: [_jsx(Title, { icon: faUserTag, Title: 'Checkout as returning customer' }), _jsx(FormReturningCustomer, {})] }) })] }) })] }));
23
24
  }
24
25
  export default PanelClientCheckout;
@@ -174,7 +174,7 @@ export var sliceCart = createSlice({
174
174
  state.cart.client = action.payload;
175
175
  },
176
176
  setDomainId: function (state, action) {
177
- state.domainId = action.payload;
177
+ state.domainId = action.payload.domainId;
178
178
  },
179
179
  toggleCartOpen: function (state) {
180
180
  state.modalCartOpen = !state.modalCartOpen;
package/lib/store.js CHANGED
@@ -144,10 +144,11 @@ export function actionFetchTheme(id) {
144
144
  dispatch(fetchThemeError());
145
145
  });
146
146
  }
147
- function cartAndCookie(domainId) {
147
+ function cartAndCookie() {
148
148
  return __awaiter(this, void 0, void 0, function () {
149
- var cart;
149
+ var domainId, cart;
150
150
  return __generator(this, function (_a) {
151
+ domainId = getStore().stateCart.domainId;
151
152
  cart = makeCart({ domain: { id: domainId } }, true);
152
153
  return [2 /*return*/, cart.create({ embed: cartEmbed })
153
154
  .then(function (c) {
@@ -168,13 +169,13 @@ function cartAndCookie(domainId) {
168
169
  });
169
170
  });
170
171
  }
171
- export function createAndSetNewCartCookie(domainId) {
172
+ export function createAndSetNewCartCookie() {
172
173
  return __awaiter(this, void 0, void 0, function () {
173
174
  return __generator(this, function (_a) {
174
175
  switch (_a.label) {
175
176
  case 0:
176
177
  dispatch(fetchCart());
177
- return [4 /*yield*/, cartAndCookie(domainId)];
178
+ return [4 /*yield*/, cartAndCookie()];
178
179
  case 1:
179
180
  _a.sent();
180
181
  return [2 /*return*/];
@@ -184,14 +185,12 @@ export function createAndSetNewCartCookie(domainId) {
184
185
  }
185
186
  export function doClearCart() {
186
187
  return __awaiter(this, void 0, void 0, function () {
187
- var domainId;
188
188
  return __generator(this, function (_a) {
189
189
  switch (_a.label) {
190
190
  case 0:
191
- domainId = getStore().stateCart.domainId;
192
191
  dispatch(setCart({}));
193
192
  closeClearCart();
194
- return [4 /*yield*/, createAndSetNewCartCookie(domainId)];
193
+ return [4 /*yield*/, createAndSetNewCartCookie()];
195
194
  case 1:
196
195
  _a.sent();
197
196
  return [2 /*return*/];
@@ -457,7 +456,7 @@ function updateCartValues(cartJson) {
457
456
  dispatch(sliceCart.actions.fetchCartSuccess(cartJson));
458
457
  dispatch(initCartShipmentSlice(cartJson));
459
458
  }
460
- function getCart(domainId, cartIdAndToken) {
459
+ function getCart(cartIdAndToken) {
461
460
  var cartSettingsInvalid = sliceCart.actions.cartSettingsInvalid;
462
461
  var id = Number(cartIdAndToken[0]);
463
462
  if (cartIdAndToken[1]) {
@@ -479,10 +478,10 @@ function getCart(domainId, cartIdAndToken) {
479
478
  }
480
479
  })
481
480
  .catch(function (e) {
482
- createAndSetNewCartCookie(domainId);
481
+ createAndSetNewCartCookie();
483
482
  });
484
483
  }
485
- export function actionGetMerchiCart(domainId) {
484
+ export function getMerchiCart(domainId) {
486
485
  return __awaiter(this, void 0, void 0, function () {
487
486
  var cartIdAndToken;
488
487
  return __generator(this, function (_a) {
@@ -491,10 +490,10 @@ export function actionGetMerchiCart(domainId) {
491
490
  case 1:
492
491
  cartIdAndToken = _a.sent();
493
492
  if (cartIdAndToken) {
494
- getCart(domainId, cartIdAndToken);
493
+ getCart(cartIdAndToken);
495
494
  }
496
495
  else {
497
- createAndSetNewCartCookie(domainId);
496
+ createAndSetNewCartCookie();
498
497
  }
499
498
  return [2 /*return*/];
500
499
  }
@@ -528,13 +527,11 @@ export function getMerchiCartValues() {
528
527
  }
529
528
  export function doCartComplete() {
530
529
  return __awaiter(this, void 0, void 0, function () {
531
- var domainId;
532
530
  return __generator(this, function (_a) {
533
531
  switch (_a.label) {
534
532
  case 0:
535
- domainId = getStore().stateCart.domainId;
536
533
  dispatch(sliceCartPayment.actions.doCardComplete());
537
- return [4 /*yield*/, cartAndCookie(domainId).then(function () { return location.reload(); })];
534
+ return [4 /*yield*/, cartAndCookie().then(function () { return location.reload(); })];
538
535
  case 1:
539
536
  _a.sent();
540
537
  return [2 /*return*/];
@@ -544,9 +541,9 @@ export function doCartComplete() {
544
541
  }
545
542
  export function initMerchiCart(domainId) {
546
543
  dispatch(setDomainId(domainId));
547
- actionGetMerchiCart(domainId);
544
+ getMerchiCart(domainId);
548
545
  if (window && window !== undefined) {
549
- window.getCart = function () { return actionGetMerchiCart(domainId); };
546
+ window.getCart = function () { return getMerchiCart(domainId); };
550
547
  window.isMerchiCartFetching = isMerchiCartFetching;
551
548
  window.getMerchiCartValues = getMerchiCartValues;
552
549
  }
@@ -1,7 +1,3 @@
1
- .merchi-cart-header {
2
- margin-bottom: 1rem;
3
- }
4
-
5
1
  .merchi-cart-body {
6
2
  display: block;
7
3
  min-height: 100px;
@@ -124,9 +120,6 @@
124
120
  cursor: pointer;
125
121
  display: block;
126
122
  padding: 0.5rem 1rem;
127
- width: 100%;
128
- border: 0px;
129
- border-radius: 0.375rem;
130
123
  }
131
124
 
132
125
  .merchi-nav-link:hover, .merchi-nav-link:focus {
@@ -139,6 +132,10 @@
139
132
  cursor: default;
140
133
  }
141
134
 
135
+ .merchi-nav-tabs {
136
+ border-bottom: 1px solid #dee2e6;
137
+ }
138
+
142
139
  .merchi-nav-tabs .merchi-nav-item {
143
140
  margin-bottom: -1px;
144
141
  }
@@ -173,7 +170,7 @@
173
170
  .merchi-nav-pills .merchi-nav-link.active,
174
171
  .merchi-nav-pills .show > .merchi-nav-link {
175
172
  color: #fff;
176
- background-color: #303dbf;
173
+ background-color: #007bff;
177
174
  }
178
175
 
179
176
  .merchi-nav-fill .merchi-nav-item {
@@ -194,15 +191,7 @@
194
191
  border: 0px;
195
192
  cursor: pointer;
196
193
  color: inherit;
197
- float: right;
198
- }
199
-
200
- .merchi-loading-template {
201
- height: 500px;
202
- background: url("../assets/merchi-monster-loader.gif");
203
- background-repeat: no-repeat;
204
- background-position: center center;
205
- background-size: 150px 150px;
194
+ margin-left: auto;
206
195
  }
207
196
 
208
197
  /*# sourceMappingURL=globals.css.map */
@@ -1 +1 @@
1
- {"version":3,"sourceRoot":"","sources":["../../src/styles/globals.scss"],"names":[],"mappings":"AAAA;EACE;;;AAEF;EACE;EACA;EACA;;;AAEF;EACE;EACA;EACA;EACA;EACA;;;AAEF;EACE;EACA;EACA;;;AAEF;EACE;EACA;EACA;EACA;EACA;EACA;;;AAEF;EACE;EACA;;;AAEF;EACE;;;AAEF;EACE;;;AAEF;EACE;;;AAEF;EACE;EACA;EACA;;;AAEF;EACE;EACA;EACA;;;AAEF;EACE;EACA;EACA;EACA;EACA;EACA;;;AAEF;EACE;EACA;EACA;EACA;EACA;EACA;EACA;;;AAEF;EACE;EACA;EACA;;;AAGF;AACA;EACE;EACA;;;AAGF;EACE;IACE;;EAGF;IACE;IACA;;EAGF;IACE;IACA;;;AAIJ;EACE;;;AAGF;EACE;;;AAGF;EACE;EACA;EACA;EACA;EACA;;;AAGF;EACE;EACA;EACA;EACA;EACA;EACA;;;AAGF;EACE;;;AAGF;EACE;EACA;EACA;;;AAKF;EACE;;;AAGF;EACE;EACA;EACA;;;AAGF;EACE;;;AAGF;EACE;EACA;EACA;;;AAGF;AAAA;EAEE;EACA;EACA;;;AAGF;EACE;;;AAGF;AAAA;EAEE;EACA;;;AAGF;EACE;EACA;;;AAEF;EACE;EACA;EACA;EACA;EACA;;;AAGF;EACE;EACA;EACA;EACA;EACA;;;AAGF;EACE;EACA;EACA;EACA;EACA","file":"globals.css"}
1
+ {"version":3,"sourceRoot":"","sources":["../../src/styles/globals.scss"],"names":[],"mappings":"AAAA;EACE;EACA;EACA;;;AAEF;EACE;EACA;EACA;EACA;EACA;;;AAEF;EACE;EACA;EACA;;;AAEF;EACE;EACA;EACA;EACA;EACA;EACA;;;AAEF;EACE;EACA;;;AAEF;EACE;;;AAEF;EACE;;;AAEF;EACE;;;AAEF;EACE;EACA;EACA;;;AAEF;EACE;EACA;EACA;;;AAEF;EACE;EACA;EACA;EACA;EACA;EACA;;;AAEF;EACE;EACA;EACA;EACA;EACA;EACA;EACA;;;AAEF;EACE;EACA;EACA;;;AAGF;AACA;EACE;EACA;;;AAGF;EACE;IACE;;EAGF;IACE;IACA;;EAGF;IACE;IACA;;;AAIJ;EACE;;;AAGF;EACE;;;AAGF;EACE;EACA;EACA;EACA;EACA;;;AAGF;EACE;EACA;EACA;;;AAGF;EACE;;;AAGF;EACE;EACA;EACA;;;AAGF;EACE;;;AAGF;EACE;;;AAGF;EACE;EACA;EACA;;;AAGF;EACE;;;AAGF;EACE;EACA;EACA;;;AAGF;AAAA;EAEE;EACA;EACA;;;AAGF;EACE;;;AAGF;AAAA;EAEE;EACA;;;AAGF;EACE;EACA;;;AAEF;EACE;EACA;EACA;EACA;EACA;;;AAGF;EACE;EACA;EACA;EACA;EACA","file":"globals.css"}
@@ -12,6 +12,6 @@ function NavTab(_a) {
12
12
  dispatch(sliceCart.actions.setActiveTab(tabId));
13
13
  }
14
14
  var active = activeTab === tabId;
15
- return (_jsx("div", { className: classNameCartTabItem, children: _jsxs("button", { className: "".concat(classNameCartTabItemLink, " ").concat(active ? 'active' : ''), onClick: toggle, disabled: disabled, children: [_jsx(FontAwesomeIcon, { icon: icon }), " ", name] }) }));
15
+ return (_jsx("div", { className: classNameCartTabItem, children: _jsxs("button", { className: "".concat(classNameCartTabItemLink, " ").concat(active ? 'active' : '', " disClass"), onClick: toggle, disabled: disabled, children: [_jsx(FontAwesomeIcon, { icon: icon }), " ", name] }) }));
16
16
  }
17
17
  export default NavTab;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "merchi_cart",
3
- "version": "0.0.3-h",
3
+ "version": "0.0.3",
4
4
  "description": "Merchi's cart",
5
5
  "main": "lib/index.js",
6
6
  "module": "src/index.tsx",