@shopgate/pwa-ui-shared 7.20.0-beta.10 → 7.20.0-beta.12

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.
@@ -11,7 +11,8 @@ import _regeneratorRuntime from"@babel/runtime/regenerator";function _typeof(obj
11
11
  * - Show cart icon again.
12
12
  * @param {Event} e Event
13
13
  */_defineProperty(_this2,"handleClick",function(e){// Ignore clicks when check mark or loading spinner is shown or the button is disabled.
14
- if(_this2.state.showCheckmark||_this2.props.isLoading||_this2.props.isDisabled){return;}/** */var handleCompletion=function handleCompletion(){_this2.setState({showCheckmark:true});setTimeout(function(){_this2.setState({showCheckmark:false});},900);};var result=_this2.props.onClick(e);if(result instanceof Promise){_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(){return _regeneratorRuntime.wrap(function _callee$(_context){while(1)switch(_context.prev=_context.next){case 0:_context.prev=0;_context.next=3;return result;case 3:handleCompletion();_context.next=8;break;case 6:_context.prev=6;_context.t0=_context["catch"](0);case 8:case"end":return _context.stop();}},_callee,null,[[0,6]]);}))();return;}handleCompletion();});/**
14
+ if(_this2.state.showCheckmark||_this2.props.isLoading||_this2.props.isDisabled){return;}/** */var handleCompletion=function handleCompletion(){_this2.setState({showCheckmark:true});setTimeout(function(){_this2.setState({showCheckmark:false});},900);};var result=_this2.props.onClick(e);if(result===false){// Do not trigger animation when adding to cart was aborted by the parent component (PWA-2764)
15
+ return;}if(result instanceof Promise){_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(){return _regeneratorRuntime.wrap(function _callee$(_context){while(1)switch(_context.prev=_context.next){case 0:_context.prev=0;_context.next=3;return result;case 3:handleCompletion();_context.next=8;break;case 6:_context.prev=6;_context.t0=_context["catch"](0);case 8:case"end":return _context.stop();}},_callee,null,[[0,6]]);}))();return;}handleCompletion();});/**
15
16
  * Handles the cart animation end event.
16
17
  * Resets the showCheckmark state to null in order to
17
18
  * prevent the icon from animating after changing visibility
package/package.json CHANGED
@@ -1,17 +1,17 @@
1
1
  {
2
2
  "name": "@shopgate/pwa-ui-shared",
3
- "version": "7.20.0-beta.10",
3
+ "version": "7.20.0-beta.12",
4
4
  "description": "Shopgate's shared UI components.",
5
5
  "main": "index.js",
6
6
  "license": "Apache-2.0",
7
7
  "dependencies": {
8
- "@shopgate/pwa-ui-ios": "7.20.0-beta.10",
9
- "@shopgate/pwa-ui-material": "7.20.0-beta.10",
8
+ "@shopgate/pwa-ui-ios": "7.20.0-beta.12",
9
+ "@shopgate/pwa-ui-material": "7.20.0-beta.12",
10
10
  "react-day-picker": "^7.4.8"
11
11
  },
12
12
  "devDependencies": {
13
- "@shopgate/pwa-common": "7.20.0-beta.10",
14
- "@shopgate/pwa-common-commerce": "7.20.0-beta.10",
13
+ "@shopgate/pwa-common": "7.20.0-beta.12",
14
+ "@shopgate/pwa-common-commerce": "7.20.0-beta.12",
15
15
  "classnames": "2.3.3",
16
16
  "react": "~16.12.0"
17
17
  },