@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.
package/dist/index.js CHANGED
@@ -2019,8 +2019,8 @@ var CheckoutSummary = function CheckoutSummary(_ref) {
2019
2019
  };
2020
2020
 
2021
2021
  var _templateObject$8, _templateObject2$8, _templateObject3$8, _templateObject4$6, _templateObject5$6, _templateObject6$5, _templateObject7$3, _templateObject8$1, _templateObject9, _templateObject10, _templateObject11, _templateObject12;
2022
- 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"])));
2023
- 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"])));
2022
+ 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"])));
2023
+ 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"])));
2024
2024
  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) {
2025
2025
  return props.single ? '1.8em 2em' : '1em 0';
2026
2026
  }, function (props) {
@@ -2048,10 +2048,12 @@ var CheckBoxRow = styled.div(_templateObject7$3 || (_templateObject7$3 = _tagged
2048
2048
  });
2049
2049
  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"])));
2050
2050
  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"])));
2051
- var StyledTableRow = styled(material.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) {
2051
+ var StyledTableRow = styled(material.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) {
2052
2052
  return props.colored ? 'rgba(255, 240, 236, 1)' : 'white';
2053
2053
  });
2054
- var StyledTableCell = styled(material.TableCell)(_templateObject11 || (_templateObject11 = _taggedTemplateLiteralLoose(["\n && {\n border: none;\n font-size: 1em;\n }\n"])));
2054
+ var StyledTableCell = styled(material.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) {
2055
+ return props.noSmall ? 'none' : '';
2056
+ });
2055
2057
  var BottomGrid = styled(material.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"])));
2056
2058
 
2057
2059
  var CheckoutInput = function CheckoutInput(_ref) {
@@ -2556,7 +2558,8 @@ var Step3 = function Step3(_ref) {
2556
2558
  }
2557
2559
  }, /*#__PURE__*/React__default.createElement(material.Grid, {
2558
2560
  item: true,
2559
- xs: 10
2561
+ xs: 12,
2562
+ md: 10
2560
2563
  }, /*#__PURE__*/React__default.createElement(CheckoutInput, {
2561
2564
  controlls: {
2562
2565
  name: 'cardName',
@@ -2570,7 +2573,8 @@ var Step3 = function Step3(_ref) {
2570
2573
  }
2571
2574
  })), /*#__PURE__*/React__default.createElement(material.Grid, {
2572
2575
  item: true,
2573
- xs: 10
2576
+ xs: 12,
2577
+ md: 10
2574
2578
  }, /*#__PURE__*/React__default.createElement(CheckoutInput, {
2575
2579
  controlls: {
2576
2580
  name: 'cardNumber',
@@ -2642,10 +2646,12 @@ var Step4 = function Step4(_ref) {
2642
2646
  var _cartData$cartLineIte, _cartData$totalCartPr;
2643
2647
 
2644
2648
  var handleBack = _ref.handleBack,
2645
- handleNext = _ref.handleNext,
2646
2649
  cartData = _ref.cartData,
2647
2650
  vatPercentage = _ref.vat,
2648
- clickRedirect = _ref.clickRedirect;
2651
+ clickRedirect = _ref.clickRedirect,
2652
+ deliveryCharges = _ref.deliveryCharges,
2653
+ loading = _ref.loading,
2654
+ placeOrder = _ref.placeOrder;
2649
2655
 
2650
2656
  var _React$useState = React__default.useState(false),
2651
2657
  checked = _React$useState[0],
@@ -2662,7 +2668,6 @@ var Step4 = function Step4(_ref) {
2662
2668
  }
2663
2669
 
2664
2670
  var vat = vatPercentage / 100 * (cartData === null || cartData === void 0 ? void 0 : cartData.totalCartPrice);
2665
- console.log(vat);
2666
2671
  return /*#__PURE__*/React__default.createElement(StepContainer, null, /*#__PURE__*/React__default.createElement(StepsHeaderComponent, {
2667
2672
  text: 'Order Review',
2668
2673
  Icon: Icon
@@ -2678,14 +2683,20 @@ var Step4 = function Step4(_ref) {
2678
2683
  return /*#__PURE__*/React__default.createElement(StyledTableRow, {
2679
2684
  key: row.name,
2680
2685
  colored: i % 2 === 0
2681
- }, /*#__PURE__*/React__default.createElement(StyledTableCell, null, /*#__PURE__*/React__default.createElement("p", {
2686
+ }, /*#__PURE__*/React__default.createElement(StyledTableCell, {
2687
+ noSmall: true
2688
+ }, /*#__PURE__*/React__default.createElement("p", {
2682
2689
  className: "price max"
2683
2690
  }, "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, {
2691
+ align: "left",
2692
+ component: 'th',
2693
+ scope: "row"
2694
+ }, /*#__PURE__*/React__default.createElement("p", null, ' ', /*#__PURE__*/React__default.createElement("span", {
2695
+ className: "noAboveSm price"
2696
+ }, "ID: #", row === null || row === void 0 ? void 0 : row.productId), row.productName)), /*#__PURE__*/React__default.createElement(StyledTableCell, {
2686
2697
  align: "left"
2687
2698
  }, /*#__PURE__*/React__default.createElement("p", {
2688
- className: "price"
2699
+ className: "price max"
2689
2700
  }, (_row$standardPrice = row.standardPrice) === null || _row$standardPrice === void 0 ? void 0 : _row$standardPrice.toFixed(2), /*#__PURE__*/React__default.createElement("span", {
2690
2701
  className: "red"
2691
2702
  }, " x ", row.quantity))), /*#__PURE__*/React__default.createElement(StyledTableCell, {
@@ -2694,52 +2705,64 @@ var Step4 = function Step4(_ref) {
2694
2705
  className: "price max"
2695
2706
  }, (_ref2 = row.quantity * (row === null || row === void 0 ? void 0 : row.standardPrice)) === null || _ref2 === void 0 ? void 0 : _ref2.toFixed(2))));
2696
2707
  }), /*#__PURE__*/React__default.createElement(StyledTableRow, null, /*#__PURE__*/React__default.createElement(StyledTableCell, {
2697
- colSpan: 2
2708
+ colSpan: 1,
2709
+ noSmall: true
2710
+ }), /*#__PURE__*/React__default.createElement(StyledTableCell, {
2711
+ colSpan: 1
2698
2712
  }), /*#__PURE__*/React__default.createElement(StyledTableCell, {
2699
2713
  colSpan: 1
2700
2714
  }, /*#__PURE__*/React__default.createElement("p", {
2701
- className: "max"
2715
+ className: "max sm"
2702
2716
  }, "Total(", cartData === null || cartData === void 0 ? void 0 : cartData.totalCartQuantity, " items)")), /*#__PURE__*/React__default.createElement(StyledTableCell, {
2703
2717
  align: "right"
2704
2718
  }, /*#__PURE__*/React__default.createElement("p", {
2705
- className: "max price"
2719
+ className: "max sm price"
2706
2720
  }, "$", 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
2721
+ colSpan: 1,
2722
+ noSmall: true
2723
+ }), /*#__PURE__*/React__default.createElement(StyledTableCell, {
2724
+ colSpan: 1
2708
2725
  }), /*#__PURE__*/React__default.createElement(StyledTableCell, {
2709
2726
  colSpan: 1
2710
2727
  }, /*#__PURE__*/React__default.createElement("p", {
2711
- className: "max"
2728
+ className: "max sm"
2712
2729
  }, "Value added tax (VAT)")), /*#__PURE__*/React__default.createElement(StyledTableCell, {
2713
2730
  align: "right"
2714
2731
  }, /*#__PURE__*/React__default.createElement("p", {
2715
- className: "max price"
2732
+ className: "max sm price"
2716
2733
  }, "$", vat === null || vat === void 0 ? void 0 : vat.toFixed(2)))), /*#__PURE__*/React__default.createElement(StyledTableRow, null, /*#__PURE__*/React__default.createElement(StyledTableCell, {
2717
- colSpan: 2
2734
+ colSpan: 1,
2735
+ noSmall: true
2736
+ }), /*#__PURE__*/React__default.createElement(StyledTableCell, {
2737
+ colSpan: 1
2718
2738
  }), /*#__PURE__*/React__default.createElement(StyledTableCell, {
2719
2739
  colSpan: 1
2720
2740
  }, /*#__PURE__*/React__default.createElement("p", {
2721
- className: "max"
2741
+ className: "max sm"
2722
2742
  }, "Delivery Charge")), /*#__PURE__*/React__default.createElement(StyledTableCell, {
2723
2743
  align: "right"
2724
2744
  }, /*#__PURE__*/React__default.createElement("p", {
2725
- className: "max price red"
2726
- }, "Free"))), /*#__PURE__*/React__default.createElement(StyledTableRow, null, /*#__PURE__*/React__default.createElement(StyledTableCell, {
2727
- colSpan: 2
2745
+ className: "max sm price red"
2746
+ }, 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, {
2747
+ colSpan: 1,
2748
+ noSmall: true
2749
+ }), /*#__PURE__*/React__default.createElement(StyledTableCell, {
2750
+ colSpan: 1
2728
2751
  }), /*#__PURE__*/React__default.createElement(StyledTableCell, {
2729
2752
  sx: {
2730
2753
  paddingTop: '1em'
2731
2754
  },
2732
2755
  colSpan: 1
2733
2756
  }, /*#__PURE__*/React__default.createElement("p", {
2734
- className: "max price red"
2757
+ className: "max sm price red"
2735
2758
  }, "Subtotal")), /*#__PURE__*/React__default.createElement(StyledTableCell, {
2736
2759
  sx: {
2737
2760
  paddingTop: '1em'
2738
2761
  },
2739
2762
  align: "right"
2740
2763
  }, /*#__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, {
2764
+ className: "max sm total price red"
2765
+ }, "$", ((cartData === null || cartData === void 0 ? void 0 : cartData.totalCartPrice) + vat + deliveryCharges).toFixed(2)))))), /*#__PURE__*/React__default.createElement(BottomGrid, {
2743
2766
  container: true,
2744
2767
  columnSpacing: 0,
2745
2768
  rowSpacing: 0
@@ -2750,12 +2773,16 @@ var Step4 = function Step4(_ref) {
2750
2773
  className: "bold"
2751
2774
  }, "Your Comment")), /*#__PURE__*/React__default.createElement(material.Grid, {
2752
2775
  item: true,
2753
- xs: 0.5
2776
+ xs: 1,
2777
+ sm: 1,
2778
+ md: 0.5
2754
2779
  }, /*#__PURE__*/React__default.createElement(cg.CgProfile, {
2755
2780
  className: "icon"
2756
2781
  })), /*#__PURE__*/React__default.createElement(material.Grid, {
2757
2782
  item: true,
2758
- xs: 11.5
2783
+ xs: 11,
2784
+ sm: 11,
2785
+ md: 11.5
2759
2786
  }, /*#__PURE__*/React__default.createElement("textarea", {
2760
2787
  rows: "3",
2761
2788
  cols: "4",
@@ -2774,7 +2801,8 @@ var Step4 = function Step4(_ref) {
2774
2801
  return setChecked(function (checked) {
2775
2802
  return !checked;
2776
2803
  });
2777
- }
2804
+ },
2805
+ required: true
2778
2806
  }), /*#__PURE__*/React__default.createElement("p", null, "I Accept the ", /*#__PURE__*/React__default.createElement("span", {
2779
2807
  className: "ul"
2780
2808
  }, "Tearms and Conditions"), ' ', "& ", /*#__PURE__*/React__default.createElement("span", {
@@ -2794,12 +2822,23 @@ var Step4 = function Step4(_ref) {
2794
2822
  return handleBack();
2795
2823
  }
2796
2824
  }, "back"), /*#__PURE__*/React__default.createElement("button", {
2797
- onClick: function onClick() {
2825
+ onClick: function onClick(e) {
2826
+ e.preventDefault();
2827
+
2798
2828
  if (checked) {
2799
- handleNext();
2829
+ placeOrder(comments);
2830
+ } else {
2831
+ alert('please accept the privacy policy');
2800
2832
  }
2833
+ },
2834
+ type: "submit"
2835
+ }, loading ? /*#__PURE__*/React__default.createElement(material.CircularProgress, {
2836
+ color: "inherit",
2837
+ size: 15,
2838
+ style: {
2839
+ margin: '0 2.8em'
2801
2840
  }
2802
- }, "place order")))))));
2841
+ }) : 'place order')))))));
2803
2842
  };
2804
2843
 
2805
2844
  var steps = [{
@@ -2863,7 +2902,9 @@ var CheckoutPageComponent = function CheckoutPageComponent(_ref) {
2863
2902
  userAddresses = _ref.userAddresses,
2864
2903
  showShipping = _ref.showShipping,
2865
2904
  clickRedirect = _ref.clickRedirect,
2866
- ordering = _ref.ordering;
2905
+ ordering = _ref.ordering,
2906
+ deliveryCharges = _ref.deliveryCharges,
2907
+ placeOrder = _ref.placeOrder;
2867
2908
  return /*#__PURE__*/React__default.createElement(CheckoutPageContainer, {
2868
2909
  className: "checkout"
2869
2910
  }, /*#__PURE__*/React__default.createElement(CheckoutMain, null, /*#__PURE__*/React__default.createElement(CheckoutHeader, null, steps.map(function (item, i) {
@@ -2970,7 +3011,10 @@ var CheckoutPageComponent = function CheckoutPageComponent(_ref) {
2970
3011
  cartData: cartData,
2971
3012
  vat: vat,
2972
3013
  clickRedirect: clickRedirect,
2973
- loading: ordering
3014
+ loading: ordering,
3015
+ deliveryCharges: deliveryCharges,
3016
+ ordering: loading,
3017
+ placeOrder: placeOrder
2974
3018
  })));
2975
3019
  }))), /*#__PURE__*/React__default.createElement(CheckoutSummary, {
2976
3020
  billingInformation: billingAddress,