@salesgenterp/ui-components 0.4.28 → 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,8 +2016,8 @@ 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"])));
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"])));
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
+ 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';
2023
2023
  }, function (props) {
@@ -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) {
@@ -2553,7 +2555,8 @@ var Step3 = function Step3(_ref) {
2553
2555
  }
2554
2556
  }, /*#__PURE__*/React__default.createElement(Grid, {
2555
2557
  item: true,
2556
- xs: 10
2558
+ xs: 12,
2559
+ md: 10
2557
2560
  }, /*#__PURE__*/React__default.createElement(CheckoutInput, {
2558
2561
  controlls: {
2559
2562
  name: 'cardName',
@@ -2567,7 +2570,8 @@ var Step3 = function Step3(_ref) {
2567
2570
  }
2568
2571
  })), /*#__PURE__*/React__default.createElement(Grid, {
2569
2572
  item: true,
2570
- xs: 10
2573
+ xs: 12,
2574
+ md: 10
2571
2575
  }, /*#__PURE__*/React__default.createElement(CheckoutInput, {
2572
2576
  controlls: {
2573
2577
  name: 'cardNumber',
@@ -2639,10 +2643,12 @@ var Step4 = function Step4(_ref) {
2639
2643
  var _cartData$cartLineIte, _cartData$totalCartPr;
2640
2644
 
2641
2645
  var handleBack = _ref.handleBack,
2642
- handleNext = _ref.handleNext,
2643
2646
  cartData = _ref.cartData,
2644
2647
  vatPercentage = _ref.vat,
2645
- clickRedirect = _ref.clickRedirect;
2648
+ clickRedirect = _ref.clickRedirect,
2649
+ deliveryCharges = _ref.deliveryCharges,
2650
+ loading = _ref.loading,
2651
+ placeOrder = _ref.placeOrder;
2646
2652
 
2647
2653
  var _React$useState = React__default.useState(false),
2648
2654
  checked = _React$useState[0],
@@ -2659,7 +2665,6 @@ var Step4 = function Step4(_ref) {
2659
2665
  }
2660
2666
 
2661
2667
  var vat = vatPercentage / 100 * (cartData === null || cartData === void 0 ? void 0 : cartData.totalCartPrice);
2662
- console.log(vat);
2663
2668
  return /*#__PURE__*/React__default.createElement(StepContainer, null, /*#__PURE__*/React__default.createElement(StepsHeaderComponent, {
2664
2669
  text: 'Order Review',
2665
2670
  Icon: Icon
@@ -2675,14 +2680,20 @@ var Step4 = function Step4(_ref) {
2675
2680
  return /*#__PURE__*/React__default.createElement(StyledTableRow, {
2676
2681
  key: row.name,
2677
2682
  colored: i % 2 === 0
2678
- }, /*#__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", {
2679
2686
  className: "price max"
2680
2687
  }, "ID: #", row === null || row === void 0 ? void 0 : row.productId)), /*#__PURE__*/React__default.createElement(StyledTableCell, {
2681
- align: "left"
2682
- }, /*#__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, {
2683
2694
  align: "left"
2684
2695
  }, /*#__PURE__*/React__default.createElement("p", {
2685
- className: "price"
2696
+ className: "price max"
2686
2697
  }, (_row$standardPrice = row.standardPrice) === null || _row$standardPrice === void 0 ? void 0 : _row$standardPrice.toFixed(2), /*#__PURE__*/React__default.createElement("span", {
2687
2698
  className: "red"
2688
2699
  }, " x ", row.quantity))), /*#__PURE__*/React__default.createElement(StyledTableCell, {
@@ -2691,52 +2702,64 @@ var Step4 = function Step4(_ref) {
2691
2702
  className: "price max"
2692
2703
  }, (_ref2 = row.quantity * (row === null || row === void 0 ? void 0 : row.standardPrice)) === null || _ref2 === void 0 ? void 0 : _ref2.toFixed(2))));
2693
2704
  }), /*#__PURE__*/React__default.createElement(StyledTableRow, null, /*#__PURE__*/React__default.createElement(StyledTableCell, {
2694
- colSpan: 2
2705
+ colSpan: 1,
2706
+ noSmall: true
2707
+ }), /*#__PURE__*/React__default.createElement(StyledTableCell, {
2708
+ colSpan: 1
2695
2709
  }), /*#__PURE__*/React__default.createElement(StyledTableCell, {
2696
2710
  colSpan: 1
2697
2711
  }, /*#__PURE__*/React__default.createElement("p", {
2698
- className: "max"
2712
+ className: "max sm"
2699
2713
  }, "Total(", cartData === null || cartData === void 0 ? void 0 : cartData.totalCartQuantity, " items)")), /*#__PURE__*/React__default.createElement(StyledTableCell, {
2700
2714
  align: "right"
2701
2715
  }, /*#__PURE__*/React__default.createElement("p", {
2702
- className: "max price"
2716
+ className: "max sm price"
2703
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, {
2704
- colSpan: 2
2718
+ colSpan: 1,
2719
+ noSmall: true
2720
+ }), /*#__PURE__*/React__default.createElement(StyledTableCell, {
2721
+ colSpan: 1
2705
2722
  }), /*#__PURE__*/React__default.createElement(StyledTableCell, {
2706
2723
  colSpan: 1
2707
2724
  }, /*#__PURE__*/React__default.createElement("p", {
2708
- className: "max"
2725
+ className: "max sm"
2709
2726
  }, "Value added tax (VAT)")), /*#__PURE__*/React__default.createElement(StyledTableCell, {
2710
2727
  align: "right"
2711
2728
  }, /*#__PURE__*/React__default.createElement("p", {
2712
- className: "max price"
2729
+ className: "max sm price"
2713
2730
  }, "$", vat === null || vat === void 0 ? void 0 : vat.toFixed(2)))), /*#__PURE__*/React__default.createElement(StyledTableRow, null, /*#__PURE__*/React__default.createElement(StyledTableCell, {
2714
- colSpan: 2
2731
+ colSpan: 1,
2732
+ noSmall: true
2733
+ }), /*#__PURE__*/React__default.createElement(StyledTableCell, {
2734
+ colSpan: 1
2715
2735
  }), /*#__PURE__*/React__default.createElement(StyledTableCell, {
2716
2736
  colSpan: 1
2717
2737
  }, /*#__PURE__*/React__default.createElement("p", {
2718
- className: "max"
2738
+ className: "max sm"
2719
2739
  }, "Delivery Charge")), /*#__PURE__*/React__default.createElement(StyledTableCell, {
2720
2740
  align: "right"
2721
2741
  }, /*#__PURE__*/React__default.createElement("p", {
2722
- className: "max price red"
2723
- }, "Free"))), /*#__PURE__*/React__default.createElement(StyledTableRow, null, /*#__PURE__*/React__default.createElement(StyledTableCell, {
2724
- colSpan: 2
2742
+ className: "max sm price red"
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, {
2744
+ colSpan: 1,
2745
+ noSmall: true
2746
+ }), /*#__PURE__*/React__default.createElement(StyledTableCell, {
2747
+ colSpan: 1
2725
2748
  }), /*#__PURE__*/React__default.createElement(StyledTableCell, {
2726
2749
  sx: {
2727
2750
  paddingTop: '1em'
2728
2751
  },
2729
2752
  colSpan: 1
2730
2753
  }, /*#__PURE__*/React__default.createElement("p", {
2731
- className: "max price red"
2754
+ className: "max sm price red"
2732
2755
  }, "Subtotal")), /*#__PURE__*/React__default.createElement(StyledTableCell, {
2733
2756
  sx: {
2734
2757
  paddingTop: '1em'
2735
2758
  },
2736
2759
  align: "right"
2737
2760
  }, /*#__PURE__*/React__default.createElement("p", {
2738
- className: "max price red"
2739
- }, "$", ((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, {
2740
2763
  container: true,
2741
2764
  columnSpacing: 0,
2742
2765
  rowSpacing: 0
@@ -2747,12 +2770,16 @@ var Step4 = function Step4(_ref) {
2747
2770
  className: "bold"
2748
2771
  }, "Your Comment")), /*#__PURE__*/React__default.createElement(Grid, {
2749
2772
  item: true,
2750
- xs: 0.5
2773
+ xs: 1,
2774
+ sm: 1,
2775
+ md: 0.5
2751
2776
  }, /*#__PURE__*/React__default.createElement(CgProfile, {
2752
2777
  className: "icon"
2753
2778
  })), /*#__PURE__*/React__default.createElement(Grid, {
2754
2779
  item: true,
2755
- xs: 11.5
2780
+ xs: 11,
2781
+ sm: 11,
2782
+ md: 11.5
2756
2783
  }, /*#__PURE__*/React__default.createElement("textarea", {
2757
2784
  rows: "3",
2758
2785
  cols: "4",
@@ -2771,7 +2798,8 @@ var Step4 = function Step4(_ref) {
2771
2798
  return setChecked(function (checked) {
2772
2799
  return !checked;
2773
2800
  });
2774
- }
2801
+ },
2802
+ required: true
2775
2803
  }), /*#__PURE__*/React__default.createElement("p", null, "I Accept the ", /*#__PURE__*/React__default.createElement("span", {
2776
2804
  className: "ul"
2777
2805
  }, "Tearms and Conditions"), ' ', "& ", /*#__PURE__*/React__default.createElement("span", {
@@ -2791,12 +2819,23 @@ var Step4 = function Step4(_ref) {
2791
2819
  return handleBack();
2792
2820
  }
2793
2821
  }, "back"), /*#__PURE__*/React__default.createElement("button", {
2794
- onClick: function onClick() {
2822
+ onClick: function onClick(e) {
2823
+ e.preventDefault();
2824
+
2795
2825
  if (checked) {
2796
- handleNext();
2826
+ placeOrder(comments);
2827
+ } else {
2828
+ alert('please accept the privacy policy');
2797
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'
2798
2837
  }
2799
- }, "place order")))))));
2838
+ }) : 'place order')))))));
2800
2839
  };
2801
2840
 
2802
2841
  var steps = [{
@@ -2860,7 +2899,9 @@ var CheckoutPageComponent = function CheckoutPageComponent(_ref) {
2860
2899
  userAddresses = _ref.userAddresses,
2861
2900
  showShipping = _ref.showShipping,
2862
2901
  clickRedirect = _ref.clickRedirect,
2863
- ordering = _ref.ordering;
2902
+ ordering = _ref.ordering,
2903
+ deliveryCharges = _ref.deliveryCharges,
2904
+ placeOrder = _ref.placeOrder;
2864
2905
  return /*#__PURE__*/React__default.createElement(CheckoutPageContainer, {
2865
2906
  className: "checkout"
2866
2907
  }, /*#__PURE__*/React__default.createElement(CheckoutMain, null, /*#__PURE__*/React__default.createElement(CheckoutHeader, null, steps.map(function (item, i) {
@@ -2967,7 +3008,10 @@ var CheckoutPageComponent = function CheckoutPageComponent(_ref) {
2967
3008
  cartData: cartData,
2968
3009
  vat: vat,
2969
3010
  clickRedirect: clickRedirect,
2970
- loading: ordering
3011
+ loading: ordering,
3012
+ deliveryCharges: deliveryCharges,
3013
+ ordering: loading,
3014
+ placeOrder: placeOrder
2971
3015
  })));
2972
3016
  }))), /*#__PURE__*/React__default.createElement(CheckoutSummary, {
2973
3017
  billingInformation: billingAddress,