@os-design/core
Advanced tools
Comparing version 1.0.206 to 1.0.207
@@ -150,7 +150,11 @@ "use strict"; | ||
}, [id]); | ||
var clickHandler = (0, _react2.useCallback)(function (e) { | ||
var containerClickHandler = (0, _react2.useCallback)(function (e) { | ||
e.stopPropagation(); | ||
onClose(); | ||
}, [onClose]); | ||
var contentClickHandler = (0, _react2.useCallback)(function (e) { | ||
e.stopPropagation(); | ||
onClick(e); | ||
}, [onClick]); | ||
var keyDownHandler = (0, _react2.useCallback)(function (e) { | ||
var contentKeyDownHandler = (0, _react2.useCallback)(function (e) { | ||
if (e.key === 'Escape') { | ||
@@ -168,6 +172,3 @@ e.stopPropagation(); | ||
}), /*#__PURE__*/_react2["default"].createElement(Container, { | ||
onClick: function onClick(e) { | ||
e.stopPropagation(); | ||
onClose(); | ||
} | ||
onClick: containerClickHandler | ||
}, /*#__PURE__*/_react2["default"].createElement(_reactFocusLock["default"], { | ||
@@ -181,4 +182,4 @@ autoFocus: true | ||
tabIndex: -1, | ||
onKeyDown: keyDownHandler, | ||
onClick: clickHandler, | ||
onKeyDown: contentKeyDownHandler, | ||
onClick: contentClickHandler, | ||
role: "dialog", | ||
@@ -185,0 +186,0 @@ "aria-modal": true, |
@@ -191,7 +191,11 @@ function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } | ||
const bodyId = useMemo(() => id || `modal-body-${Math.random().toString(36).slice(2, 11)}`, [id]); | ||
const clickHandler = useCallback(e => { | ||
const containerClickHandler = useCallback(e => { | ||
e.stopPropagation(); | ||
onClose(); | ||
}, [onClose]); | ||
const contentClickHandler = useCallback(e => { | ||
e.stopPropagation(); | ||
onClick(e); | ||
}, [onClick]); | ||
const keyDownHandler = useCallback(e => { | ||
const contentKeyDownHandler = useCallback(e => { | ||
if (e.key === 'Escape') { | ||
@@ -207,6 +211,3 @@ e.stopPropagation(); | ||
}), /*#__PURE__*/React.createElement(Container, { | ||
onClick: e => { | ||
e.stopPropagation(); | ||
onClose(); | ||
} | ||
onClick: containerClickHandler | ||
}, /*#__PURE__*/React.createElement(FocusLock, { | ||
@@ -220,4 +221,4 @@ autoFocus: true | ||
tabIndex: -1, | ||
onKeyDown: keyDownHandler, | ||
onClick: clickHandler, | ||
onKeyDown: contentKeyDownHandler, | ||
onClick: contentClickHandler, | ||
role: "dialog", | ||
@@ -224,0 +225,0 @@ "aria-modal": true, |
{ | ||
"name": "@os-design/core", | ||
"version": "1.0.206", | ||
"version": "1.0.207", | ||
"license": "UNLICENSED", | ||
@@ -62,3 +62,3 @@ "repository": "git@gitlab.com:os-team/libs/os-design.git", | ||
}, | ||
"gitHead": "a77891eed727fd74ad92fea16b7337eb6a797fcc" | ||
"gitHead": "e3bd1a9f6077b21d8b0fef0162434d2af735594c" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
2638239
26774