@salesgenterp/ui-components 0.4.29 → 0.4.30

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.
@@ -2016,7 +2016,7 @@ var CheckoutSummary = function CheckoutSummary(_ref) {
2016
2016
  };
2017
2017
 
2018
2018
  var _templateObject$8, _templateObject2$8, _templateObject3$8, _templateObject4$6, _templateObject5$6, _templateObject6$5, _templateObject7$3, _templateObject8$1, _templateObject9, _templateObject10, _templateObject11, _templateObject12;
2019
- var StepContainer = styled.div(_templateObject$8 || (_templateObject$8 = _taggedTemplateLiteralLoose(["\n width: 100%;\n min-width: 57.43em;\n max-width: 57.43em;\n background: white;\n padding: 1em 2em;\n background: #ffffff;\n border-radius: 20px;\n margin-left: 2em;\n margin-top: -2em;\n margin-bottom: 1em;\n @media screen and (max-width: 1305px) {\n width: 80vw;\n min-width: 0;\n }\n @media screen and (max-width: 768px) {\n width: calc(100vw - 40px);\n margin-left: 1em;\n padding: 1em;\n }\n"])));
2019
+ var StepContainer = styled.div(_templateObject$8 || (_templateObject$8 = _taggedTemplateLiteralLoose(["\n width: 100%;\n min-width: 57.43em;\n max-width: 57.43em;\n background: white;\n padding: 1em 2em;\n background: #ffffff;\n border-radius: 20px;\n margin-left: 2em;\n margin-top: -2em;\n margin-bottom: 1em;\n @media screen and (max-width: 1305px) {\n width: 80vw;\n min-width: 0;\n }\n @media screen and (max-width: 768px) {\n width: 96%;\n margin-left: 1em;\n padding: 0;\n }\n"])));
2020
2020
  var StepsContent = styled.div(_templateObject2$8 || (_templateObject2$8 = _taggedTemplateLiteralLoose(["\n padding-left: 2.5em;\n min-height: max-content;\n .bold {\n text-transform: uppercase;\n word-spacing: 5px;\n margin-top: 1em;\n span {\n font-weight: 700;\n cursor: pointer;\n }\n .red {\n color: red;\n }\n }\n @media screen and (max-width: 768px) {\n padding: 0;\n width: 100%;\n }\n"])));
2021
2021
  var StepsHeaderContainer = styled.div(_templateObject3$8 || (_templateObject3$8 = _taggedTemplateLiteralLoose(["\n width: 100%;\n display: flex;\n flex-direction: row;\n align-items: center;\n justify-content: flex-start;\n font-family: 'karla-fonts';\n color: #323232;\n padding: ", ";\n margin-bottom: ", ";\n margin-top: ", ";\n margin-left: ", ";\n /* color: grey; */\n border-bottom: 1px solid #fff0ec;\n background: #ffffff;\n border-radius: 20px;\n max-width: 919px;\n h5 {\n font-size: 16px;\n font-weight: 700;\n text-transform: capitalize;\n }\n .icon {\n font-size: 1.3em;\n margin-right: 8px;\n }\n .dropIcon {\n font-size: 1.4em;\n cursor: pointer;\n transform: rotate(-90deg);\n transition: 0.3s;\n color: rgba(50, 50, 50, 0.75);\n }\n @media screen and (max-width: 768px) {\n max-width: 97%;\n margin-left: 1em;\n font-size: 12px;\n /* padding: 1.5em 2em; */\n }\n"])), function (props) {
2022
2022
  return props.single ? '1.8em 2em' : '1em 0';
@@ -2045,10 +2045,12 @@ var CheckBoxRow = styled.div(_templateObject7$3 || (_templateObject7$3 = _tagged
2045
2045
  });
2046
2046
  var DeliveryCard = styled.div(_templateObject8$1 || (_templateObject8$1 = _taggedTemplateLiteralLoose(["\n width: 100%;\n background: #fd0015;\n color: white;\n height: 34px;\n display: flex;\n flex-direction: row;\n align-items: center;\n justify-content: center;\n padding: 0.5em 1em;\n margin-right: 1em;\n margin-bottom: 1em;\n /* padding: 1em 0.4em; */\n cursor: pointer;\n img {\n width: 38px;\n height: 17px;\n margin-bottom: -5px;\n margin-right: 4px;\n }\n p {\n font-size: 10px;\n }\n .circle {\n width: 10px;\n height: 10px;\n border-radius: 1px solid black;\n background-color: white;\n display: grid;\n place-items: center;\n border-radius: 50%;\n margin-left: auto;\n margin-left: 5px;\n .smallCircle {\n width: 4px;\n height: 4px;\n background: black;\n border-radius: 50%;\n }\n }\n"])));
2047
2047
  var CreditCard = styled.div(_templateObject9 || (_templateObject9 = _taggedTemplateLiteralLoose(["\n width: 70px;\n min-height: 48px;\n max-height: 50px;\n background-color: white;\n border: 3px solid rgba(217, 217, 217, 0.1);\n display: grid;\n place-items: center;\n margin: auto;\n cursor: pointer;\n overflow: hidden;\n border-radius: 5px;\n transition: 0.1s;\n border: 1px solid transparent;\n text-align: center;\n p {\n font-size: 10px;\n }\n &:hover,\n &:focus {\n border: 1px solid black;\n }\n"])));
2048
- var StyledTableRow = styled(TableRow)(_templateObject10 || (_templateObject10 = _taggedTemplateLiteralLoose(["\n && {\n box-shadow: none;\n border: none;\n background-color: ", ";\n p {\n font-size: 0.9em;\n font-family: 'karla-fonts';\n }\n .max {\n min-width: max-content;\n }\n .red {\n color: red;\n font-weight: inherit;\n }\n .price {\n font-weight: 700;\n }\n }\n"])), function (props) {
2048
+ var StyledTableRow = styled(TableRow)(_templateObject10 || (_templateObject10 = _taggedTemplateLiteralLoose(["\n && {\n box-shadow: none;\n border: none;\n background-color: ", ";\n p {\n font-size: 0.9em;\n font-family: 'karla-fonts';\n }\n .max {\n min-width: max-content;\n }\n .red {\n color: red;\n font-weight: inherit;\n }\n .price {\n font-weight: 700;\n }\n @media only screen and (max-width: 640px) {\n p {\n font-size: 12px;\n }\n .sm {\n font-size: 8px;\n }\n .price,\n .red {\n font-size: 10px;\n }\n .total {\n font-size: 14px;\n }\n }\n }\n"])), function (props) {
2049
2049
  return props.colored ? 'rgba(255, 240, 236, 1)' : 'white';
2050
2050
  });
2051
- var StyledTableCell = styled(TableCell)(_templateObject11 || (_templateObject11 = _taggedTemplateLiteralLoose(["\n && {\n border: none;\n font-size: 1em;\n }\n"])));
2051
+ var StyledTableCell = styled(TableCell)(_templateObject11 || (_templateObject11 = _taggedTemplateLiteralLoose(["\n && {\n border: none;\n font-size: 1em;\n .noAboveSm {\n display: none;\n }\n @media only screen and (max-width: 748px) {\n display: ", ";\n padding: 0.5em 0.3em;\n .noAboveSm {\n display: inline-block;\n margin-right: 6px;\n }\n }\n }\n"])), function (props) {
2052
+ return props.noSmall ? 'none' : '';
2053
+ });
2052
2054
  var BottomGrid = styled(Grid)(_templateObject12 || (_templateObject12 = _taggedTemplateLiteralLoose(["\n .bold {\n font-weight: 700;\n text-transform: capitalize;\n margin: 1em 0;\n font-size: 1em;\n }\n .icon {\n font-size: 1.6em;\n color: rgba(253, 0, 21, 1);\n }\n textarea {\n width: 100%;\n resize: none;\n background: #fff8f6;\n border: 1px solid rgba(253, 0, 21, 0.5);\n border-radius: 4px;\n margin-bottom: 2em;\n padding: 1em;\n }\n p {\n font-size: 12px;\n .ul {\n text-decoration: underline;\n font-size: inherit;\n }\n }\n .bottom {\n margin-left: 3em;\n font-style: italic;\n span {\n font-weight: 700;\n color: rgba(253, 0, 21, 1);\n\n cursor: pointer;\n &:hover {\n text-decoration: underline;\n }\n }\n }\n"])));
2053
2055
 
2054
2056
  var CheckoutInput = function CheckoutInput(_ref) {
@@ -2641,11 +2643,12 @@ var Step4 = function Step4(_ref) {
2641
2643
  var _cartData$cartLineIte, _cartData$totalCartPr;
2642
2644
 
2643
2645
  var handleBack = _ref.handleBack,
2644
- handleNext = _ref.handleNext,
2645
2646
  cartData = _ref.cartData,
2646
2647
  vatPercentage = _ref.vat,
2647
2648
  clickRedirect = _ref.clickRedirect,
2648
- deliveryCharges = _ref.deliveryCharges;
2649
+ deliveryCharges = _ref.deliveryCharges,
2650
+ loading = _ref.loading,
2651
+ placeOrder = _ref.placeOrder;
2649
2652
 
2650
2653
  var _React$useState = React__default.useState(false),
2651
2654
  checked = _React$useState[0],
@@ -2662,7 +2665,6 @@ var Step4 = function Step4(_ref) {
2662
2665
  }
2663
2666
 
2664
2667
  var vat = vatPercentage / 100 * (cartData === null || cartData === void 0 ? void 0 : cartData.totalCartPrice);
2665
- console.log(vat);
2666
2668
  return /*#__PURE__*/React__default.createElement(StepContainer, null, /*#__PURE__*/React__default.createElement(StepsHeaderComponent, {
2667
2669
  text: 'Order Review',
2668
2670
  Icon: Icon
@@ -2678,14 +2680,20 @@ var Step4 = function Step4(_ref) {
2678
2680
  return /*#__PURE__*/React__default.createElement(StyledTableRow, {
2679
2681
  key: row.name,
2680
2682
  colored: i % 2 === 0
2681
- }, /*#__PURE__*/React__default.createElement(StyledTableCell, null, /*#__PURE__*/React__default.createElement("p", {
2683
+ }, /*#__PURE__*/React__default.createElement(StyledTableCell, {
2684
+ noSmall: true
2685
+ }, /*#__PURE__*/React__default.createElement("p", {
2682
2686
  className: "price max"
2683
2687
  }, "ID: #", row === null || row === void 0 ? void 0 : row.productId)), /*#__PURE__*/React__default.createElement(StyledTableCell, {
2684
- align: "left"
2685
- }, /*#__PURE__*/React__default.createElement("p", null, row.productName)), /*#__PURE__*/React__default.createElement(StyledTableCell, {
2688
+ align: "left",
2689
+ component: 'th',
2690
+ scope: "row"
2691
+ }, /*#__PURE__*/React__default.createElement("p", null, ' ', /*#__PURE__*/React__default.createElement("span", {
2692
+ className: "noAboveSm price"
2693
+ }, "ID: #", row === null || row === void 0 ? void 0 : row.productId), row.productName)), /*#__PURE__*/React__default.createElement(StyledTableCell, {
2686
2694
  align: "left"
2687
2695
  }, /*#__PURE__*/React__default.createElement("p", {
2688
- className: "price"
2696
+ className: "price max"
2689
2697
  }, (_row$standardPrice = row.standardPrice) === null || _row$standardPrice === void 0 ? void 0 : _row$standardPrice.toFixed(2), /*#__PURE__*/React__default.createElement("span", {
2690
2698
  className: "red"
2691
2699
  }, " x ", row.quantity))), /*#__PURE__*/React__default.createElement(StyledTableCell, {
@@ -2694,52 +2702,64 @@ var Step4 = function Step4(_ref) {
2694
2702
  className: "price max"
2695
2703
  }, (_ref2 = row.quantity * (row === null || row === void 0 ? void 0 : row.standardPrice)) === null || _ref2 === void 0 ? void 0 : _ref2.toFixed(2))));
2696
2704
  }), /*#__PURE__*/React__default.createElement(StyledTableRow, null, /*#__PURE__*/React__default.createElement(StyledTableCell, {
2697
- colSpan: 2
2705
+ colSpan: 1,
2706
+ noSmall: true
2707
+ }), /*#__PURE__*/React__default.createElement(StyledTableCell, {
2708
+ colSpan: 1
2698
2709
  }), /*#__PURE__*/React__default.createElement(StyledTableCell, {
2699
2710
  colSpan: 1
2700
2711
  }, /*#__PURE__*/React__default.createElement("p", {
2701
- className: "max"
2712
+ className: "max sm"
2702
2713
  }, "Total(", cartData === null || cartData === void 0 ? void 0 : cartData.totalCartQuantity, " items)")), /*#__PURE__*/React__default.createElement(StyledTableCell, {
2703
2714
  align: "right"
2704
2715
  }, /*#__PURE__*/React__default.createElement("p", {
2705
- className: "max price"
2716
+ className: "max sm price"
2706
2717
  }, "$", cartData === null || cartData === void 0 ? void 0 : (_cartData$totalCartPr = cartData.totalCartPrice) === null || _cartData$totalCartPr === void 0 ? void 0 : _cartData$totalCartPr.toFixed(2)))), /*#__PURE__*/React__default.createElement(StyledTableRow, null, /*#__PURE__*/React__default.createElement(StyledTableCell, {
2707
- colSpan: 2
2718
+ colSpan: 1,
2719
+ noSmall: true
2720
+ }), /*#__PURE__*/React__default.createElement(StyledTableCell, {
2721
+ colSpan: 1
2708
2722
  }), /*#__PURE__*/React__default.createElement(StyledTableCell, {
2709
2723
  colSpan: 1
2710
2724
  }, /*#__PURE__*/React__default.createElement("p", {
2711
- className: "max"
2725
+ className: "max sm"
2712
2726
  }, "Value added tax (VAT)")), /*#__PURE__*/React__default.createElement(StyledTableCell, {
2713
2727
  align: "right"
2714
2728
  }, /*#__PURE__*/React__default.createElement("p", {
2715
- className: "max price"
2729
+ className: "max sm price"
2716
2730
  }, "$", vat === null || vat === void 0 ? void 0 : vat.toFixed(2)))), /*#__PURE__*/React__default.createElement(StyledTableRow, null, /*#__PURE__*/React__default.createElement(StyledTableCell, {
2717
- colSpan: 2
2731
+ colSpan: 1,
2732
+ noSmall: true
2733
+ }), /*#__PURE__*/React__default.createElement(StyledTableCell, {
2734
+ colSpan: 1
2718
2735
  }), /*#__PURE__*/React__default.createElement(StyledTableCell, {
2719
2736
  colSpan: 1
2720
2737
  }, /*#__PURE__*/React__default.createElement("p", {
2721
- className: "max"
2738
+ className: "max sm"
2722
2739
  }, "Delivery Charge")), /*#__PURE__*/React__default.createElement(StyledTableCell, {
2723
2740
  align: "right"
2724
2741
  }, /*#__PURE__*/React__default.createElement("p", {
2725
- className: "max price red"
2742
+ className: "max sm price red"
2726
2743
  }, deliveryCharges && deliveryCharges > 0 ? deliveryCharges === null || deliveryCharges === void 0 ? void 0 : deliveryCharges.toFixed(2) : 'Free'))), /*#__PURE__*/React__default.createElement(StyledTableRow, null, /*#__PURE__*/React__default.createElement(StyledTableCell, {
2727
- colSpan: 2
2744
+ colSpan: 1,
2745
+ noSmall: true
2746
+ }), /*#__PURE__*/React__default.createElement(StyledTableCell, {
2747
+ colSpan: 1
2728
2748
  }), /*#__PURE__*/React__default.createElement(StyledTableCell, {
2729
2749
  sx: {
2730
2750
  paddingTop: '1em'
2731
2751
  },
2732
2752
  colSpan: 1
2733
2753
  }, /*#__PURE__*/React__default.createElement("p", {
2734
- className: "max price red"
2754
+ className: "max sm price red"
2735
2755
  }, "Subtotal")), /*#__PURE__*/React__default.createElement(StyledTableCell, {
2736
2756
  sx: {
2737
2757
  paddingTop: '1em'
2738
2758
  },
2739
2759
  align: "right"
2740
2760
  }, /*#__PURE__*/React__default.createElement("p", {
2741
- className: "max price red"
2742
- }, "$", ((cartData === null || cartData === void 0 ? void 0 : cartData.totalCartPrice) + vat).toFixed(2)))))), /*#__PURE__*/React__default.createElement(BottomGrid, {
2761
+ className: "max sm total price red"
2762
+ }, "$", ((cartData === null || cartData === void 0 ? void 0 : cartData.totalCartPrice) + vat + deliveryCharges).toFixed(2)))))), /*#__PURE__*/React__default.createElement(BottomGrid, {
2743
2763
  container: true,
2744
2764
  columnSpacing: 0,
2745
2765
  rowSpacing: 0
@@ -2750,12 +2770,16 @@ var Step4 = function Step4(_ref) {
2750
2770
  className: "bold"
2751
2771
  }, "Your Comment")), /*#__PURE__*/React__default.createElement(Grid, {
2752
2772
  item: true,
2753
- xs: 0.5
2773
+ xs: 1,
2774
+ sm: 1,
2775
+ md: 0.5
2754
2776
  }, /*#__PURE__*/React__default.createElement(CgProfile, {
2755
2777
  className: "icon"
2756
2778
  })), /*#__PURE__*/React__default.createElement(Grid, {
2757
2779
  item: true,
2758
- xs: 11.5
2780
+ xs: 11,
2781
+ sm: 11,
2782
+ md: 11.5
2759
2783
  }, /*#__PURE__*/React__default.createElement("textarea", {
2760
2784
  rows: "3",
2761
2785
  cols: "4",
@@ -2774,7 +2798,8 @@ var Step4 = function Step4(_ref) {
2774
2798
  return setChecked(function (checked) {
2775
2799
  return !checked;
2776
2800
  });
2777
- }
2801
+ },
2802
+ required: true
2778
2803
  }), /*#__PURE__*/React__default.createElement("p", null, "I Accept the ", /*#__PURE__*/React__default.createElement("span", {
2779
2804
  className: "ul"
2780
2805
  }, "Tearms and Conditions"), ' ', "& ", /*#__PURE__*/React__default.createElement("span", {
@@ -2794,12 +2819,23 @@ var Step4 = function Step4(_ref) {
2794
2819
  return handleBack();
2795
2820
  }
2796
2821
  }, "back"), /*#__PURE__*/React__default.createElement("button", {
2797
- onClick: function onClick() {
2822
+ onClick: function onClick(e) {
2823
+ e.preventDefault();
2824
+
2798
2825
  if (checked) {
2799
- handleNext();
2826
+ placeOrder(comments);
2827
+ } else {
2828
+ alert('please accept the privacy policy');
2800
2829
  }
2830
+ },
2831
+ type: "submit"
2832
+ }, loading ? /*#__PURE__*/React__default.createElement(CircularProgress, {
2833
+ color: "inherit",
2834
+ size: 15,
2835
+ style: {
2836
+ margin: '0 2.8em'
2801
2837
  }
2802
- }, "place order")))))));
2838
+ }) : 'place order')))))));
2803
2839
  };
2804
2840
 
2805
2841
  var steps = [{
@@ -2864,7 +2900,8 @@ var CheckoutPageComponent = function CheckoutPageComponent(_ref) {
2864
2900
  showShipping = _ref.showShipping,
2865
2901
  clickRedirect = _ref.clickRedirect,
2866
2902
  ordering = _ref.ordering,
2867
- deliveryCharges = _ref.deliveryCharges;
2903
+ deliveryCharges = _ref.deliveryCharges,
2904
+ placeOrder = _ref.placeOrder;
2868
2905
  return /*#__PURE__*/React__default.createElement(CheckoutPageContainer, {
2869
2906
  className: "checkout"
2870
2907
  }, /*#__PURE__*/React__default.createElement(CheckoutMain, null, /*#__PURE__*/React__default.createElement(CheckoutHeader, null, steps.map(function (item, i) {
@@ -2972,7 +3009,9 @@ var CheckoutPageComponent = function CheckoutPageComponent(_ref) {
2972
3009
  vat: vat,
2973
3010
  clickRedirect: clickRedirect,
2974
3011
  loading: ordering,
2975
- deliveryCharges: deliveryCharges
3012
+ deliveryCharges: deliveryCharges,
3013
+ ordering: loading,
3014
+ placeOrder: placeOrder
2976
3015
  })));
2977
3016
  }))), /*#__PURE__*/React__default.createElement(CheckoutSummary, {
2978
3017
  billingInformation: billingAddress,