ordering-ui-external 14.1.86 → 14.1.87

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.
@@ -43,6 +43,7 @@ function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r)
43
43
  function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
44
44
  function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
45
45
  function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
46
+ var deliveryTypes = [1, 7];
46
47
  var CartUI = function CartUI(props) {
47
48
  var _configs$driver_tip_o, _configs$driver_tip_o2, _configs$driver_tip_o3, _configs$driver_tip_a, _orderState$options, _validationFields$fie, _configs$checkout_mul, _orderState$carts, _props$cart, _validationFields$fie2, _theme$viewString, _validationFields$fie3, _theme$viewString2, _orderState$options2, _orderState$options3, _cart$metafields, _cart$metafields$find, _cart$metafields2, _cart$metafields2$fin, _cart$taxes, _orderState$option, _orderState$option2, _props$beforeElements, _props$beforeComponen, _cart$products, _cart$offers, _cart$offers2, _cart$offers3, _cart$offers4, _cart$business, _ref, _cart$subtotal_with_d, _cart$taxes3, _cart$taxes4, _cart$fees, _cart$fees2, _cart$offers5, _cart$offers6, _orderState$options4, _cart$taxes5, _cart$taxes6, _cart$offers7, _cart$offers8, _configs$driver_tip_t, _configs$driver_tip_u, _extraValueAdjustment, _orderState$options5, _validationFields$fie4, _configs$driver_tip_t2, _configs$driver_tip_u2, _configs$driver_tip_t3, _cart$payment_events, _cart$payment_events2, _orderState$options6, _cart$business2, _cart$business3, _curProduct$calendar_, _openTaxModal$data, _openTaxModal$data2, _openTaxModal$data3, _openTaxModal$data4, _openTaxModal$data$fi, _openTaxModal$data5, _openTaxModal$data6, _props$afterComponent, _props$afterElements;
48
49
  var currentCartUuid = props.currentCartUuid,
@@ -492,7 +493,7 @@ var CartUI = function CartUI(props) {
492
493
  return onRemoveOffer(offer === null || offer === void 0 ? void 0 : offer.id);
493
494
  }
494
495
  }))), /*#__PURE__*/_react.default.createElement("td", null, "- ", parsePrice(offer === null || offer === void 0 || (_offer$summary2 = offer.summary) === null || _offer$summary2 === void 0 ? void 0 : _offer$summary2.discount)));
495
- })), (orderState === null || orderState === void 0 || (_orderState$options4 = orderState.options) === null || _orderState$options4 === void 0 ? void 0 : _orderState$options4.type) === 1 && !hideDeliveryFee && /*#__PURE__*/_react.default.createElement("tr", null, /*#__PURE__*/_react.default.createElement("td", null, t('DELIVERY_FEE', 'Delivery Fee')), /*#__PURE__*/_react.default.createElement("td", null, parsePrice((cart === null || cart === void 0 ? void 0 : cart.delivery_price_with_discount) + getIncludedTaxes(true)))), (cart === null || cart === void 0 ? void 0 : cart.extra_value_checkprice) && (cart === null || cart === void 0 ? void 0 : cart.extra_value_checkprice) > 0 && /*#__PURE__*/_react.default.createElement("tr", null, /*#__PURE__*/_react.default.createElement("td", null, t('EXTRA_VALUE_CHECKPRICE', 'Extra value checkprice')), /*#__PURE__*/_react.default.createElement("td", null, parsePrice(cart === null || cart === void 0 ? void 0 : cart.extra_value_checkprice))), (cart === null || cart === void 0 || (_cart$taxes5 = cart.taxes) === null || _cart$taxes5 === void 0 ? void 0 : _cart$taxes5.length) > 0 && (cart === null || cart === void 0 || (_cart$taxes6 = cart.taxes) === null || _cart$taxes6 === void 0 ? void 0 : _cart$taxes6.filter(function (tax) {
496
+ })), deliveryTypes.includes(orderState === null || orderState === void 0 || (_orderState$options4 = orderState.options) === null || _orderState$options4 === void 0 ? void 0 : _orderState$options4.type) && !hideDeliveryFee && /*#__PURE__*/_react.default.createElement("tr", null, /*#__PURE__*/_react.default.createElement("td", null, t('DELIVERY_FEE', 'Delivery Fee')), /*#__PURE__*/_react.default.createElement("td", null, parsePrice((cart === null || cart === void 0 ? void 0 : cart.delivery_price_with_discount) + getIncludedTaxes(true)))), (cart === null || cart === void 0 ? void 0 : cart.extra_value_checkprice) && (cart === null || cart === void 0 ? void 0 : cart.extra_value_checkprice) > 0 && /*#__PURE__*/_react.default.createElement("tr", null, /*#__PURE__*/_react.default.createElement("td", null, t('EXTRA_VALUE_CHECKPRICE', 'Extra value checkprice')), /*#__PURE__*/_react.default.createElement("td", null, parsePrice(cart === null || cart === void 0 ? void 0 : cart.extra_value_checkprice))), (cart === null || cart === void 0 || (_cart$taxes5 = cart.taxes) === null || _cart$taxes5 === void 0 ? void 0 : _cart$taxes5.length) > 0 && (cart === null || cart === void 0 || (_cart$taxes6 = cart.taxes) === null || _cart$taxes6 === void 0 ? void 0 : _cart$taxes6.filter(function (tax) {
496
497
  return (tax === null || tax === void 0 ? void 0 : tax.type) === 2 && (tax === null || tax === void 0 ? void 0 : tax.rate) !== 0 && (tax === null || tax === void 0 ? void 0 : tax.target) === 'delivery_fee';
497
498
  }).map(function (tax) {
498
499
  var _ref4, _tax$summary$tax_afte3, _tax$summary6, _tax$summary7;
@@ -540,7 +541,7 @@ var CartUI = function CartUI(props) {
540
541
  })), (cart === null || cart === void 0 ? void 0 : cart.driver_tip) > 0 && !hideDriverTip && /*#__PURE__*/_react.default.createElement("tr", null, /*#__PURE__*/_react.default.createElement("td", null, t('DRIVER_TIP', 'Driver tip'), ' ', (cart === null || cart === void 0 ? void 0 : cart.driver_tip_rate) > 0 && parseInt(configs === null || configs === void 0 || (_configs$driver_tip_t = configs.driver_tip_type) === null || _configs$driver_tip_t === void 0 ? void 0 : _configs$driver_tip_t.value, 10) === 2 && !parseInt(configs === null || configs === void 0 || (_configs$driver_tip_u = configs.driver_tip_use_custom) === null || _configs$driver_tip_u === void 0 ? void 0 : _configs$driver_tip_u.value, 10) && /*#__PURE__*/_react.default.createElement("span", null, "(".concat((0, _utils.verifyDecimals)(cart === null || cart === void 0 ? void 0 : cart.driver_tip_rate, parseNumber), "%)"))), /*#__PURE__*/_react.default.createElement("td", null, parsePrice(cart === null || cart === void 0 ? void 0 : cart.driver_tip))), extraValueAdjustment && !!parseFloat(extraValueAdjustment === null || extraValueAdjustment === void 0 ? void 0 : extraValueAdjustment.value) && /*#__PURE__*/_react.default.createElement("tr", null, /*#__PURE__*/_react.default.createElement("td", null, pulseCouponName ? pulseCouponName === null || pulseCouponName === void 0 ? void 0 : pulseCouponName.value : t(extraValueAdjustment === null || extraValueAdjustment === void 0 || (_extraValueAdjustment = extraValueAdjustment.key) === null || _extraValueAdjustment === void 0 ? void 0 : _extraValueAdjustment.toUpperCase(), extraValueAdjustment === null || extraValueAdjustment === void 0 ? void 0 : extraValueAdjustment.key), ' '), /*#__PURE__*/_react.default.createElement("td", null, parseFloat(extraValueAdjustment === null || extraValueAdjustment === void 0 ? void 0 : extraValueAdjustment.value) > 0 ? parsePrice(parseFloat(extraValueAdjustment === null || extraValueAdjustment === void 0 ? void 0 : extraValueAdjustment.value)) : "- ".concat(parsePrice(parseFloat(extraValueAdjustment === null || extraValueAdjustment === void 0 ? void 0 : extraValueAdjustment.value) * -1)))))), isCouponEnabled && !isCartPending && (isCheckout || isCartPopover || isMultiCheckout) && !(isCheckout && isCartPopover) && !hideCartDiscount && !hideCouponInput && /*#__PURE__*/_react.default.createElement(_styles.CouponContainer, null, /*#__PURE__*/_react.default.createElement(_CouponControl.CouponControl, {
541
542
  businessId: cart === null || cart === void 0 ? void 0 : cart.business_id,
542
543
  price: cart === null || cart === void 0 ? void 0 : cart.total
543
- })), !isStore && !isMultiCheckout && cart && (cart === null || cart === void 0 ? void 0 : cart.business_id) && ((orderState === null || orderState === void 0 || (_orderState$options5 = orderState.options) === null || _orderState$options5 === void 0 ? void 0 : _orderState$options5.type) === 1 || allowDriverTipPickup) && (cart === null || cart === void 0 ? void 0 : cart.status) !== 2 && (validationFields === null || validationFields === void 0 || (_validationFields$fie4 = validationFields.fields) === null || _validationFields$fie4 === void 0 || (_validationFields$fie4 = _validationFields$fie4.checkout) === null || _validationFields$fie4 === void 0 || (_validationFields$fie4 = _validationFields$fie4.driver_tip) === null || _validationFields$fie4 === void 0 ? void 0 : _validationFields$fie4.enabled) && driverTipsOptions.length > 0 && !useKioskApp && !isCheckout && /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_styles.DriverTipContainer, null, /*#__PURE__*/_react.default.createElement("h1", null, t('DRIVER_TIPS', 'Driver Tips')), /*#__PURE__*/_react.default.createElement("p", null, t('100%_OF_THE_TIP_YOUR_DRIVER', '100% of the tip goes to your driver')), /*#__PURE__*/_react.default.createElement(_DriverTips.DriverTips, {
544
+ })), !isStore && !isMultiCheckout && cart && (cart === null || cart === void 0 ? void 0 : cart.business_id) && (deliveryTypes.includes(orderState === null || orderState === void 0 || (_orderState$options5 = orderState.options) === null || _orderState$options5 === void 0 ? void 0 : _orderState$options5.type) || allowDriverTipPickup) && (cart === null || cart === void 0 ? void 0 : cart.status) !== 2 && (validationFields === null || validationFields === void 0 || (_validationFields$fie4 = validationFields.fields) === null || _validationFields$fie4 === void 0 || (_validationFields$fie4 = _validationFields$fie4.checkout) === null || _validationFields$fie4 === void 0 || (_validationFields$fie4 = _validationFields$fie4.driver_tip) === null || _validationFields$fie4 === void 0 ? void 0 : _validationFields$fie4.enabled) && driverTipsOptions.length > 0 && !useKioskApp && !isCheckout && /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_styles.DriverTipContainer, null, /*#__PURE__*/_react.default.createElement("h1", null, t('DRIVER_TIPS', 'Driver Tips')), /*#__PURE__*/_react.default.createElement("p", null, t('100%_OF_THE_TIP_YOUR_DRIVER', '100% of the tip goes to your driver')), /*#__PURE__*/_react.default.createElement(_DriverTips.DriverTips, {
544
545
  businessId: cart === null || cart === void 0 ? void 0 : cart.business_id,
545
546
  driverTipsOptions: driverTipsOptions,
546
547
  isFixedPrice: parseInt(configs === null || configs === void 0 || (_configs$driver_tip_t2 = configs.driver_tip_type) === null || _configs$driver_tip_t2 === void 0 ? void 0 : _configs$driver_tip_t2.value, 10) === 1,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ordering-ui-external",
3
- "version": "14.1.86",
3
+ "version": "14.1.87",
4
4
  "description": "Ordering UI Components",
5
5
  "main": "./_modules/index.js",
6
6
  "exports": {
@@ -46,7 +46,7 @@ import { getCateringValues, verifyDecimals } from '../../../../../utils'
46
46
  import BsInfoCircle from '@meronex/icons/bs/BsInfoCircle'
47
47
  import MdCloseCircle from '@meronex/icons/ios/MdCloseCircle'
48
48
  import { MomentContent } from '../MomentContent'
49
-
49
+ const deliveryTypes = [1, 7]
50
50
  const CartUI = (props) => {
51
51
  const {
52
52
  currentCartUuid,
@@ -452,7 +452,7 @@ const CartUI = (props) => {
452
452
  </tr>
453
453
  ))
454
454
  }
455
- {orderState?.options?.type === 1 && !hideDeliveryFee && (
455
+ {deliveryTypes.includes(orderState?.options?.type) && !hideDeliveryFee && (
456
456
  <tr>
457
457
  <td>{t('DELIVERY_FEE', 'Delivery Fee')}</td>
458
458
  <td>{parsePrice(cart?.delivery_price_with_discount + getIncludedTaxes(true))}</td>
@@ -539,7 +539,7 @@ const CartUI = (props) => {
539
539
  !isMultiCheckout &&
540
540
  cart &&
541
541
  cart?.business_id &&
542
- (orderState?.options?.type === 1 || allowDriverTipPickup) &&
542
+ (deliveryTypes.includes(orderState?.options?.type) || allowDriverTipPickup) &&
543
543
  cart?.status !== 2 &&
544
544
  validationFields?.fields?.checkout?.driver_tip?.enabled &&
545
545
  driverTipsOptions.length > 0 &&