Comparing version 2.9.2 to 2.9.3
@@ -40,16 +40,22 @@ import _extends from "@babel/runtime/helpers/esm/extends"; | ||
_defineProperty(_assertThisInitialized(_this), "removeKey", function (removeKey) { | ||
var keyEntities = _this.state.keyEntities; | ||
var nextKeyEntities = keyEntities.map(function (entity) { | ||
if (entity.key !== removeKey) return entity; | ||
return _objectSpread(_objectSpread({}, entity), {}, { | ||
status: STATUS_REMOVED | ||
_this.setState(function (prevState) { | ||
var nextKeyEntities = prevState.keyEntities.map(function (entity) { | ||
if (entity.key !== removeKey) return entity; | ||
return _objectSpread(_objectSpread({}, entity), {}, { | ||
status: STATUS_REMOVED | ||
}); | ||
}); | ||
return { | ||
keyEntities: nextKeyEntities | ||
}; | ||
}, function () { | ||
var keyEntities = _this.state.keyEntities; | ||
var restKeysCount = keyEntities.filter(function (_ref) { | ||
var status = _ref.status; | ||
return status !== STATUS_REMOVED; | ||
}).length; | ||
if (restKeysCount === 0 && _this.props.onAllRemoved) { | ||
_this.props.onAllRemoved(); | ||
} | ||
}); | ||
_this.setState({ | ||
keyEntities: nextKeyEntities | ||
}); | ||
return nextKeyEntities.filter(function (_ref) { | ||
var status = _ref.status; | ||
return status !== STATUS_REMOVED; | ||
}).length; | ||
}); | ||
@@ -89,6 +95,3 @@ return _this; | ||
if (!changedVisible) { | ||
var restKeysCount = _this2.removeKey(eventProps.key); | ||
if (restKeysCount === 0 && onAllRemoved) { | ||
onAllRemoved(); | ||
} | ||
_this2.removeKey(eventProps.key); | ||
} | ||
@@ -95,0 +98,0 @@ } |
@@ -51,16 +51,22 @@ "use strict"; | ||
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "removeKey", function (removeKey) { | ||
var keyEntities = _this.state.keyEntities; | ||
var nextKeyEntities = keyEntities.map(function (entity) { | ||
if (entity.key !== removeKey) return entity; | ||
return (0, _objectSpread2.default)((0, _objectSpread2.default)({}, entity), {}, { | ||
status: _diff.STATUS_REMOVED | ||
_this.setState(function (prevState) { | ||
var nextKeyEntities = prevState.keyEntities.map(function (entity) { | ||
if (entity.key !== removeKey) return entity; | ||
return (0, _objectSpread2.default)((0, _objectSpread2.default)({}, entity), {}, { | ||
status: _diff.STATUS_REMOVED | ||
}); | ||
}); | ||
return { | ||
keyEntities: nextKeyEntities | ||
}; | ||
}, function () { | ||
var keyEntities = _this.state.keyEntities; | ||
var restKeysCount = keyEntities.filter(function (_ref) { | ||
var status = _ref.status; | ||
return status !== _diff.STATUS_REMOVED; | ||
}).length; | ||
if (restKeysCount === 0 && _this.props.onAllRemoved) { | ||
_this.props.onAllRemoved(); | ||
} | ||
}); | ||
_this.setState({ | ||
keyEntities: nextKeyEntities | ||
}); | ||
return nextKeyEntities.filter(function (_ref) { | ||
var status = _ref.status; | ||
return status !== _diff.STATUS_REMOVED; | ||
}).length; | ||
}); | ||
@@ -100,6 +106,3 @@ return _this; | ||
if (!changedVisible) { | ||
var restKeysCount = _this2.removeKey(eventProps.key); | ||
if (restKeysCount === 0 && onAllRemoved) { | ||
onAllRemoved(); | ||
} | ||
_this2.removeKey(eventProps.key); | ||
} | ||
@@ -106,0 +109,0 @@ } |
{ | ||
"name": "rc-motion", | ||
"version": "2.9.2", | ||
"version": "2.9.3", | ||
"description": "React lifecycle controlled motion library", | ||
@@ -36,3 +36,3 @@ "keywords": [ | ||
"prepare": "husky install", | ||
"prepublishOnly": "npm run compile && np --yolo --no-publish", | ||
"prepublishOnly": "npm run compile", | ||
"prettier": "prettier --write \"**/*.{js,jsx,tsx,ts,less,md,json}\"", | ||
@@ -39,0 +39,0 @@ "postpublish": "npm run docs:build && npm run docs:deploy", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
106008
2192