@salesgenterp/ui-components 0.4.458 → 0.4.459

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
@@ -59,6 +59,7 @@ var ReCAPTCHA = _interopDefault(require('react-google-recaptcha'));
59
59
  var paramCase = require('param-case');
60
60
  var cg = require('react-icons/cg');
61
61
  var fi = require('react-icons/fi');
62
+ var Confetti = _interopDefault(require('react-confetti'));
62
63
  var fa6 = require('react-icons/fa6');
63
64
 
64
65
  function _extends() {
@@ -10504,11 +10505,30 @@ var DiscountSummaryModal = function DiscountSummaryModal(_ref) {
10504
10505
  primaryColor = _ref.primaryColor,
10505
10506
  open = _ref.open,
10506
10507
  onCancel = _ref.onCancel;
10507
- return /*#__PURE__*/React__default.createElement(material.Dialog, {
10508
+ var _useState = React.useState(false),
10509
+ showConfetti = _useState[0],
10510
+ setShowConfetti = _useState[1];
10511
+ React.useEffect(function () {
10512
+ if (open) {
10513
+ setShowConfetti(true);
10514
+ setTimeout(function () {
10515
+ return setShowConfetti(false);
10516
+ }, 5000);
10517
+ }
10518
+ }, [open]);
10519
+ return /*#__PURE__*/React__default.createElement("div", null, showConfetti && /*#__PURE__*/React__default.createElement(Confetti, {
10520
+ width: window.innerWidth,
10521
+ height: window.innerHeight
10522
+ }), /*#__PURE__*/React__default.createElement(material.Dialog, {
10508
10523
  open: open,
10509
10524
  onClose: onCancel,
10510
10525
  fullWidth: true,
10511
- maxWidth: "sm"
10526
+ maxWidth: "sm",
10527
+ BackdropProps: {
10528
+ style: {
10529
+ backgroundColor: 'rgba(0, 0, 0, 0.1)'
10530
+ }
10531
+ }
10512
10532
  }, /*#__PURE__*/React__default.createElement(material.DialogTitle, null, /*#__PURE__*/React__default.createElement(material.Typography, {
10513
10533
  variant: "h4",
10514
10534
  fontWeight: "bold",
@@ -10636,7 +10656,7 @@ var DiscountSummaryModal = function DiscountSummaryModal(_ref) {
10636
10656
  padding: '0.5rem 2rem',
10637
10657
  fontWeight: 700
10638
10658
  }
10639
- }, "Okay")));
10659
+ }, "Okay"))));
10640
10660
  };
10641
10661
 
10642
10662
  var _templateObject$K, _templateObject2$v, _templateObject3$m, _templateObject4$i, _templateObject5$e, _templateObject6$c, _templateObject7$8, _templateObject8$6;
@@ -13077,6 +13097,7 @@ var CheckoutPageComponent = function CheckoutPageComponent(_ref) {
13077
13097
  var taxAmount = (orderTotal === null || orderTotal === void 0 ? void 0 : orderTotal.taxAmount) || 0;
13078
13098
  var _temp11 = function (_cartData$cartLineIte) {
13079
13099
  if (shippingAddressId && (cartData === null || cartData === void 0 ? void 0 : (_cartData$cartLineIte = cartData.cartLineItemDtoList) === null || _cartData$cartLineIte === void 0 ? void 0 : _cartData$cartLineIte.length) > 0 && shippingAddressId !== previousShippingAddressIdRef.current) {
13100
+ previousShippingAddressIdRef.current = shippingAddressId;
13080
13101
  var _temp10 = _catch(function () {
13081
13102
  return Promise.resolve(getTaxData({
13082
13103
  apiEndPoint: apiEndPoint,
@@ -13085,7 +13106,6 @@ var CheckoutPageComponent = function CheckoutPageComponent(_ref) {
13085
13106
  })).then(function (taxData) {
13086
13107
  var _customer$customerDto;
13087
13108
  taxAmount = !(customer !== null && customer !== void 0 && (_customer$customerDto = customer.customerDto) !== null && _customer$customerDto !== void 0 && _customer$customerDto.taxable) ? 0 : lodash.sumBy(taxData, 'taxAmount') || 0;
13088
- previousShippingAddressIdRef.current = shippingAddressId;
13089
13109
  });
13090
13110
  }, function () {});
13091
13111
  if (_temp10 && _temp10.then) return _temp10.then(function () {});
@@ -13104,6 +13124,7 @@ var CheckoutPageComponent = function CheckoutPageComponent(_ref) {
13104
13124
  var couponDiscountTotal = parseFloat((_ref2 = lodash.sumBy(discountCoupons === null || discountCoupons === void 0 ? void 0 : discountCoupons.discountCouponsData, 'amount') || 0) === null || _ref2 === void 0 ? void 0 : _ref2.toFixed(2));
13105
13125
  var _temp14 = function () {
13106
13126
  if (!isNullUndefined(cartData === null || cartData === void 0 ? void 0 : cartData.cartSubTotal) && (cartData === null || cartData === void 0 ? void 0 : cartData.cartSubTotal) !== previousSubTotalRef.current) {
13127
+ previousSubTotalRef.current = cartData === null || cartData === void 0 ? void 0 : cartData.cartSubTotal;
13107
13128
  var _temp13 = _catch(function () {
13108
13129
  return Promise.resolve(autoApplyCoupon({
13109
13130
  apiEndPoint: apiEndPoint,
@@ -13124,7 +13145,6 @@ var CheckoutPageComponent = function CheckoutPageComponent(_ref) {
13124
13145
  }),
13125
13146
  discountCouponsData: discountCouponsData
13126
13147
  });
13127
- previousSubTotalRef.current = cartData === null || cartData === void 0 ? void 0 : cartData.cartSubTotal;
13128
13148
  });
13129
13149
  }
13130
13150
  return fetchCartData ? Promise.resolve(fetchCartData()).then(_temp12) : _temp12(fetchCartData);