ordering-ui-external 1.4.3 → 1.4.4

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.
@@ -728,13 +728,16 @@ var ProductOptionsUI = function ProductOptionsUI(props) {
728
728
  }));
729
729
  };
730
730
  var ProductForm = function ProductForm(props) {
731
- var _props$product;
731
+ var _props$productCart, _props$productCart2, _props$product;
732
732
  var productOptionsProps = _objectSpread(_objectSpread({}, props), {}, {
733
733
  productCart: _objectSpread(_objectSpread({}, props.productCart), {}, {
734
- quantity: (props === null || props === void 0 ? void 0 : (_props$product = props.product) === null || _props$product === void 0 ? void 0 : _props$product.minimum_per_order) || 1
734
+ quantity: (_props$productCart = props.productCart) !== null && _props$productCart !== void 0 && _props$productCart.code ? (_props$productCart2 = props.productCart) === null || _props$productCart2 === void 0 ? void 0 : _props$productCart2.quantity : (props === null || props === void 0 ? void 0 : (_props$product = props.product) === null || _props$product === void 0 ? void 0 : _props$product.minimum_per_order) || 1
735
735
  }),
736
736
  UIComponent: ProductOptionsUI
737
737
  });
738
738
  return /*#__PURE__*/_react.default.createElement(_orderingComponentsExternal.ProductForm, productOptionsProps);
739
739
  };
740
- exports.ProductForm = ProductForm;
740
+ exports.ProductForm = ProductForm;
741
+ ProductForm.defaultProps = {
742
+ productAddedToCartLength: 0
743
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ordering-ui-external",
3
- "version": "1.4.3",
3
+ "version": "1.4.4",
4
4
  "description": "Ordering UI Components",
5
5
  "main": "./_modules/index.js",
6
6
  "exports": {
@@ -817,7 +817,12 @@ const ProductOptionsUI = (props) => {
817
817
  export const ProductForm = (props) => {
818
818
  const productOptionsProps = {
819
819
  ...props,
820
- productCart: { ...props.productCart, quantity: props?.product?.minimum_per_order || 1 },
820
+ productCart: {
821
+ ...props.productCart,
822
+ quantity: props.productCart?.code
823
+ ? props.productCart?.quantity
824
+ : props?.product?.minimum_per_order || 1
825
+ },
821
826
  UIComponent: ProductOptionsUI
822
827
  }
823
828
 
@@ -825,3 +830,7 @@ export const ProductForm = (props) => {
825
830
  <ProductOptions {...productOptionsProps} />
826
831
  )
827
832
  }
833
+
834
+ ProductForm.defaultProps = {
835
+ productAddedToCartLength: 0
836
+ }