ordering-ui-external 14.1.95 → 14.1.96

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.
Files changed (19) hide show
  1. package/_bundles/{0.ordering-ui.0b571dd6190fcd9360b1.js → 0.ordering-ui.28639f4ec524b2ae68b7.js} +1 -1
  2. package/_bundles/{4.ordering-ui.0b571dd6190fcd9360b1.js → 4.ordering-ui.28639f4ec524b2ae68b7.js} +1 -1
  3. package/_bundles/{7.ordering-ui.0b571dd6190fcd9360b1.js → 7.ordering-ui.28639f4ec524b2ae68b7.js} +1 -1
  4. package/_bundles/{ordering-ui.0b571dd6190fcd9360b1.js → ordering-ui.28639f4ec524b2ae68b7.js} +2 -2
  5. package/_modules/themes/five/src/components/BusinessProductsListing/index.js +2 -1
  6. package/_modules/themes/five/src/components/ProductForm/index.js +10 -10
  7. package/_modules/themes/five/src/components/SingleProductCard/layouts/original/index.js +2 -2
  8. package/package.json +2 -2
  9. package/src/themes/five/src/components/BusinessProductsListing/index.js +1 -1
  10. package/src/themes/five/src/components/ProductForm/index.js +2 -2
  11. package/src/themes/five/src/components/SingleProductCard/layouts/original/index.js +2 -2
  12. /package/_bundles/{1.ordering-ui.0b571dd6190fcd9360b1.js → 1.ordering-ui.28639f4ec524b2ae68b7.js} +0 -0
  13. /package/_bundles/{2.ordering-ui.0b571dd6190fcd9360b1.js → 2.ordering-ui.28639f4ec524b2ae68b7.js} +0 -0
  14. /package/_bundles/{5.ordering-ui.0b571dd6190fcd9360b1.js → 5.ordering-ui.28639f4ec524b2ae68b7.js} +0 -0
  15. /package/_bundles/{6.ordering-ui.0b571dd6190fcd9360b1.js → 6.ordering-ui.28639f4ec524b2ae68b7.js} +0 -0
  16. /package/_bundles/{7.ordering-ui.0b571dd6190fcd9360b1.js.LICENSE.txt → 7.ordering-ui.28639f4ec524b2ae68b7.js.LICENSE.txt} +0 -0
  17. /package/_bundles/{8.ordering-ui.0b571dd6190fcd9360b1.js → 8.ordering-ui.28639f4ec524b2ae68b7.js} +0 -0
  18. /package/_bundles/{9.ordering-ui.0b571dd6190fcd9360b1.js → 9.ordering-ui.28639f4ec524b2ae68b7.js} +0 -0
  19. /package/_bundles/{ordering-ui.0b571dd6190fcd9360b1.js.LICENSE.txt → ordering-ui.28639f4ec524b2ae68b7.js.LICENSE.txt} +0 -0
@@ -196,11 +196,12 @@ var BusinessProductsListingUI = function BusinessProductsListingUI(props) {
196
196
  };
197
197
  var onProductClick = /*#__PURE__*/function () {
198
198
  var _ref = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(product) {
199
+ var _product$extras;
199
200
  var _currentCart$products, isProductAddedToCart, productQuantity, minimumPerOrder, addCurrentProduct, updateCurrentProduct, cartData, _product$category, _business$professiona, productSlug, categorySlug;
200
201
  return _regeneratorRuntime().wrap(function _callee$(_context) {
201
202
  while (1) switch (_context.prev = _context.next) {
202
203
  case 0:
203
- if (!(product.extras.length === 0 && !product.inventoried && auth && isQuickAddProduct)) {
204
+ if (!(((_product$extras = product.extras) === null || _product$extras === void 0 ? void 0 : _product$extras.length) === 0 && !product.inventoried && auth && isQuickAddProduct)) {
204
205
  _context.next = 18;
205
206
  break;
206
207
  }
@@ -54,7 +54,7 @@ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" !=
54
54
  function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
55
55
  _swiper.default.use([_swiper.Navigation, _swiper.Thumbs]);
56
56
  var ProductOptionsUI = function ProductOptionsUI(props) {
57
- var _configs$unaddressed_, _configs$guest_checko, _orderState$options, _configs$allowed_orde, _orderState$options2, _theme$business_view, _theme$business_view2, _theme$business_view3, _theme$defaultLanguag, _product$tags, _product$ingredients2, _product$extras3, _product$ingredients3, _product$extras4, _product$ingredients4, _product$ingredients5, _product$extras5, _theme$defaultLanguag2, _theme$defaultLanguag3, _props$afterMidElemen, _props$afterMidCompon, _orderState$options3, _orderState$options4, _orderState$options5, _orderState$options6, _theme$defaultLanguag4, _theme$defaultLanguag5, _theme$defaultLanguag6, _orderState$options7, _orderState$options8, _theme$defaultLanguag7, _orderState$options9, _theme$defaultLanguag8, _theme$defaultLanguag9, _theme$defaultLanguag0, _theme$defaultLanguag1, _theme$defaultLanguag10, _theme$defaultLanguag11, _error$;
57
+ var _configs$unaddressed_, _configs$guest_checko, _orderState$options, _configs$allowed_orde, _orderState$options2, _theme$business_view, _theme$business_view2, _theme$business_view3, _theme$defaultLanguag, _product$tags, _product$ingredients3, _product$extras3, _product$ingredients4, _product$extras4, _product$ingredients5, _product$ingredients6, _product$extras5, _theme$defaultLanguag2, _theme$defaultLanguag3, _props$afterMidElemen, _props$afterMidCompon, _orderState$options3, _orderState$options4, _orderState$options5, _orderState$options6, _theme$defaultLanguag4, _theme$defaultLanguag5, _theme$defaultLanguag6, _orderState$options7, _orderState$options8, _theme$defaultLanguag7, _orderState$options9, _theme$defaultLanguag8, _theme$defaultLanguag9, _theme$defaultLanguag0, _theme$defaultLanguag1, _theme$defaultLanguag10, _theme$defaultLanguag11, _error$;
58
58
  var businessSlug = props.businessSlug,
59
59
  editMode = props.editMode,
60
60
  isSoldOut = props.isSoldOut,
@@ -308,12 +308,12 @@ var ProductOptionsUI = function ProductOptionsUI(props) {
308
308
  (0, _react.useEffect)(function () {
309
309
  var scrollElement = document.querySelector('.popup-dialog');
310
310
  var handleScroll = function handleScroll() {
311
- var _product$extras;
311
+ var _product$ingredients, _product$extras;
312
312
  var extraHeight = 60;
313
- if ((product === null || product === void 0 ? void 0 : product.ingredients.length) > 0 || (product === null || product === void 0 || (_product$extras = product.extras) === null || _product$extras === void 0 ? void 0 : _product$extras.length) > 0) {
314
- var _product$ingredients, _product$extras2;
313
+ if ((product === null || product === void 0 || (_product$ingredients = product.ingredients) === null || _product$ingredients === void 0 ? void 0 : _product$ingredients.length) > 0 || (product === null || product === void 0 || (_product$extras = product.extras) === null || _product$extras === void 0 ? void 0 : _product$extras.length) > 0) {
314
+ var _product$ingredients2, _product$extras2;
315
315
  var menuList = [];
316
- if ((product === null || product === void 0 || (_product$ingredients = product.ingredients) === null || _product$ingredients === void 0 ? void 0 : _product$ingredients.length) > 0) {
316
+ if ((product === null || product === void 0 || (_product$ingredients2 = product.ingredients) === null || _product$ingredients2 === void 0 ? void 0 : _product$ingredients2.length) > 0) {
317
317
  menuList.push('ingredients');
318
318
  }
319
319
  ((product === null || product === void 0 || (_product$extras2 = product.extras) === null || _product$extras2 === void 0 ? void 0 : _product$extras2.length) > 0 && (product === null || product === void 0 ? void 0 : product.extras) || []).sort(function (a, b) {
@@ -556,7 +556,7 @@ var ProductOptionsUI = function ProductOptionsUI(props) {
556
556
  }
557
557
  }, product !== null && product !== void 0 && product.favorite ? /*#__PURE__*/_react.default.createElement(_reactBootstrapIcons.HeartFill, null) : /*#__PURE__*/_react.default.createElement(_reactBootstrapIcons.Heart, null))), /*#__PURE__*/_react.default.createElement(_styles.Properties, null, isHaveWeight ? /*#__PURE__*/_react.default.createElement(_styles.PriceContent, null, parsePrice(pricePerWeightUnit), " / ", product === null || product === void 0 ? void 0 : product.weight_unit) : /*#__PURE__*/_react.default.createElement(_styles.PriceContent, null, /*#__PURE__*/_react.default.createElement("p", null, product !== null && product !== void 0 && product.price ? parsePrice(product === null || product === void 0 ? void 0 : product.price) : ''), (product === null || product === void 0 ? void 0 : product.in_offer) && /*#__PURE__*/_react.default.createElement("span", {
558
558
  className: "offer-price"
559
- }, product !== null && product !== void 0 && product.offer_price ? parsePrice(product === null || product === void 0 ? void 0 : product.offer_price) : '')), /*#__PURE__*/_react.default.createElement(_styles.ProductMeta, null, (product === null || product === void 0 ? void 0 : product.calories) && /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("span", {
559
+ }, product !== null && product !== void 0 && product.offer_price ? parsePrice(product === null || product === void 0 ? void 0 : product.offer_price) : '')), /*#__PURE__*/_react.default.createElement(_styles.ProductMeta, null, !!(product !== null && product !== void 0 && product.calories) && /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("span", {
560
560
  className: "calories"
561
561
  }, product === null || product === void 0 ? void 0 : product.calories, ' ', "cal"), /*#__PURE__*/_react.default.createElement("span", null, "\xA0\xB7\xA0")), (product === null || product === void 0 ? void 0 : product.sku) && (product === null || product === void 0 ? void 0 : product.sku) !== '-1' && (product === null || product === void 0 ? void 0 : product.sku) !== '1' && /*#__PURE__*/_react.default.createElement(_styles.SkuContent, null, /*#__PURE__*/_react.default.createElement("span", null, t('SKU', (theme === null || theme === void 0 || (_theme$defaultLanguag = theme.defaultLanguages) === null || _theme$defaultLanguag === void 0 ? void 0 : _theme$defaultLanguag.SKU) || 'Sku'), "\xA0"), /*#__PURE__*/_react.default.createElement("span", null, product === null || product === void 0 ? void 0 : product.sku)), (product === null || product === void 0 ? void 0 : product.sku) && (product === null || product === void 0 ? void 0 : product.sku) !== '-1' && (product === null || product === void 0 ? void 0 : product.sku) !== '1' && (product === null || product === void 0 ? void 0 : product.estimated_person) && /*#__PURE__*/_react.default.createElement("span", null, "\xA0\xB7\xA0"), (product === null || product === void 0 ? void 0 : product.estimated_person) && /*#__PURE__*/_react.default.createElement(_styles.EstimatedPersons, null, /*#__PURE__*/_react.default.createElement("span", null, product === null || product === void 0 ? void 0 : product.estimated_person, "\xA0"), /*#__PURE__*/_react.default.createElement("span", null, t('ESTIMATED_PERSONS', 'persons'))))), (product === null || product === void 0 ? void 0 : product.description) && !hideProductDescription && /*#__PURE__*/_react.default.createElement(_styles.ProductDescription, null, /*#__PURE__*/_react.default.createElement(_LinkableText.LinkableText, {
562
562
  text: product === null || product === void 0 ? void 0 : product.description
@@ -568,11 +568,11 @@ var ProductOptionsUI = function ProductOptionsUI(props) {
568
568
  src: optimizeImage((tag === null || tag === void 0 ? void 0 : tag.image) || ((_theme$images2 = theme.images) === null || _theme$images2 === void 0 || (_theme$images2 = _theme$images2.dummies) === null || _theme$images2 === void 0 ? void 0 : _theme$images2.product), 'h_40,c_limit'),
569
569
  alt: ""
570
570
  }), /*#__PURE__*/_react.default.createElement("span", null, tag.name));
571
- })), /*#__PURE__*/_react.default.createElement(_styles.Divider, null), /*#__PURE__*/_react.default.createElement(_styles.ProductEdition, null, ((product === null || product === void 0 || (_product$ingredients2 = product.ingredients) === null || _product$ingredients2 === void 0 ? void 0 : _product$ingredients2.length) > 0 || (product === null || product === void 0 || (_product$extras3 = product.extras) === null || _product$extras3 === void 0 ? void 0 : _product$extras3.length) > 0) && /*#__PURE__*/_react.default.createElement(_styles.ProductTabContainer, {
571
+ })), /*#__PURE__*/_react.default.createElement(_styles.Divider, null), /*#__PURE__*/_react.default.createElement(_styles.ProductEdition, null, ((product === null || product === void 0 || (_product$ingredients3 = product.ingredients) === null || _product$ingredients3 === void 0 ? void 0 : _product$ingredients3.length) > 0 || (product === null || product === void 0 || (_product$extras3 = product.extras) === null || _product$extras3 === void 0 ? void 0 : _product$extras3.length) > 0) && /*#__PURE__*/_react.default.createElement(_styles.ProductTabContainer, {
572
572
  id: "all"
573
573
  }, /*#__PURE__*/_react.default.createElement(_Tabs.Tabs, null, /*#__PURE__*/_react.default.createElement(_AutoScroll.AutoScroll, {
574
574
  scrollId: "optionList"
575
- }, (product === null || product === void 0 || (_product$ingredients3 = product.ingredients) === null || _product$ingredients3 === void 0 ? void 0 : _product$ingredients3.length) > 0 && /*#__PURE__*/_react.default.createElement(_Tabs.Tab, {
575
+ }, (product === null || product === void 0 || (_product$ingredients4 = product.ingredients) === null || _product$ingredients4 === void 0 ? void 0 : _product$ingredients4.length) > 0 && /*#__PURE__*/_react.default.createElement(_Tabs.Tab, {
576
576
  key: "ingredients",
577
577
  id: "menu_ingredients",
578
578
  active: tabValue === 'ingredients',
@@ -597,9 +597,9 @@ var ProductOptionsUI = function ProductOptionsUI(props) {
597
597
  borderBottom: true
598
598
  }, option === null || option === void 0 ? void 0 : option.name);
599
599
  });
600
- })))), (product === null || product === void 0 || (_product$ingredients4 = product.ingredients) === null || _product$ingredients4 === void 0 ? void 0 : _product$ingredients4.length) > 0 && /*#__PURE__*/_react.default.createElement("div", {
600
+ })))), (product === null || product === void 0 || (_product$ingredients5 = product.ingredients) === null || _product$ingredients5 === void 0 ? void 0 : _product$ingredients5.length) > 0 && /*#__PURE__*/_react.default.createElement("div", {
601
601
  id: "ingredients"
602
- }, (product === null || product === void 0 || (_product$ingredients5 = product.ingredients) === null || _product$ingredients5 === void 0 ? void 0 : _product$ingredients5.length) > 0 && /*#__PURE__*/_react.default.createElement(_styles.SectionTitle, null, t('INGREDIENTS', (theme === null || theme === void 0 ? void 0 : theme.defaultLanguages.INGREDIENTS) || 'Ingredients')), /*#__PURE__*/_react.default.createElement(_styles.WrapperIngredients, {
602
+ }, (product === null || product === void 0 || (_product$ingredients6 = product.ingredients) === null || _product$ingredients6 === void 0 ? void 0 : _product$ingredients6.length) > 0 && /*#__PURE__*/_react.default.createElement(_styles.SectionTitle, null, t('INGREDIENTS', (theme === null || theme === void 0 ? void 0 : theme.defaultLanguages.INGREDIENTS) || 'Ingredients')), /*#__PURE__*/_react.default.createElement(_styles.WrapperIngredients, {
603
603
  isProductSoldout: isSoldOut || maxProductQuantity <= 0
604
604
  }, product === null || product === void 0 ? void 0 : product.ingredients.map(function (ingredient) {
605
605
  return /*#__PURE__*/_react.default.createElement(_ProductIngredient.ProductIngredient, {
@@ -130,10 +130,10 @@ var SingleProductCardUI = /*#__PURE__*/_react.default.memo(function (props) {
130
130
  return;
131
131
  }
132
132
  if (isFavorite) {
133
- onProductClick && onProductClick();
133
+ onProductClick && onProductClick(product);
134
134
  return;
135
135
  }
136
- !isSkeleton && !useCustomFunctionality && onProductClick && onProductClick(product, product === null || product === void 0 || (_product$business = product.business) === null || _product$business === void 0 ? void 0 : _product$business.slug) || useCustomFunctionality && onCustomClick && onCustomClick();
136
+ !isSkeleton && !useCustomFunctionality && onProductClick && onProductClick(product, product === null || product === void 0 || (_product$business = product.business) === null || _product$business === void 0 ? void 0 : _product$business.slug) || useCustomFunctionality && onCustomClick && onCustomClick(product);
137
137
  };
138
138
  var closeAlert = function closeAlert() {
139
139
  setAlertState({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ordering-ui-external",
3
- "version": "14.1.95",
3
+ "version": "14.1.96",
4
4
  "description": "Ordering UI Components",
5
5
  "main": "./_modules/index.js",
6
6
  "exports": {
@@ -88,7 +88,7 @@
88
88
  "lodash": "^4.17.19",
89
89
  "moment": "^2.29.4",
90
90
  "nanoid": "^4.0.0",
91
- "ordering-components-external": "13.2.27",
91
+ "ordering-components-external": "13.2.28",
92
92
  "payment": "^2.4.6",
93
93
  "polished": "^3.6.6",
94
94
  "react-bootstrap-icons": "^1.7.2",
@@ -143,7 +143,7 @@ const BusinessProductsListingUI = (props) => {
143
143
  }
144
144
 
145
145
  const onProductClick = async (product) => {
146
- if (product.extras.length === 0 && !product.inventoried && auth && isQuickAddProduct) {
146
+ if (product.extras?.length === 0 && !product.inventoried && auth && isQuickAddProduct) {
147
147
  setProductLoading(true)
148
148
  const isProductAddedToCart = currentCart?.products?.find(Cproduct => Cproduct.id === product.id)
149
149
  const productQuantity = isProductAddedToCart?.quantity
@@ -289,7 +289,7 @@ const ProductOptionsUI = (props) => {
289
289
  const scrollElement = document.querySelector('.popup-dialog')
290
290
  const handleScroll = () => {
291
291
  const extraHeight = 60
292
- if (product?.ingredients.length > 0 || product?.extras?.length > 0) {
292
+ if (product?.ingredients?.length > 0 || product?.extras?.length > 0) {
293
293
  const menuList = []
294
294
  if (product?.ingredients?.length > 0) {
295
295
  menuList.push('ingredients')
@@ -542,7 +542,7 @@ const ProductOptionsUI = (props) => {
542
542
  </PriceContent>
543
543
  )}
544
544
  <ProductMeta>
545
- {product?.calories && (
545
+ {!!product?.calories && (
546
546
  <>
547
547
  <span className='calories'>{product?.calories}{' '}cal</span>
548
548
  <span>&nbsp;&#183;&nbsp;</span>
@@ -105,11 +105,11 @@ const SingleProductCardUI = React.memo((props) => {
105
105
  }
106
106
 
107
107
  if (isFavorite) {
108
- onProductClick && onProductClick()
108
+ onProductClick && onProductClick(product)
109
109
  return
110
110
  }
111
111
  (!isSkeleton && !useCustomFunctionality && onProductClick && onProductClick(product, product?.business?.slug)) ||
112
- (useCustomFunctionality && onCustomClick && onCustomClick())
112
+ (useCustomFunctionality && onCustomClick && onCustomClick(product))
113
113
  }
114
114
 
115
115
  const closeAlert = () => {