@chakra-ui/popper
Advanced tools
Comparing version 1.0.1 to 1.0.2
# Change Log | ||
## 1.0.2 | ||
### Patch Changes | ||
- Updated dependencies | ||
[[`e73878ee`](https://github.com/chakra-ui/chakra-ui/commit/e73878ee686c11d3f94ad6ac61b19ae9508d75a5)]: | ||
- @chakra-ui/utils@1.0.2 | ||
- @chakra-ui/hooks@1.0.2 | ||
## 1.0.1 | ||
@@ -4,0 +13,0 @@ |
@@ -59,4 +59,2 @@ "use strict"; | ||
setArrowNode = _React$useState3[1]; | ||
var offset = offsetProp != null ? offsetProp : [0, gutter]; | ||
/** | ||
@@ -67,3 +65,5 @@ * recommended via popper docs | ||
var customModifiers = React.useMemo(function () { | ||
var offset = offsetProp != null ? offsetProp : [0, gutter]; | ||
return [// @see https://popper.js.org/docs/v2/modifiers/offset/ | ||
@@ -133,3 +133,3 @@ { | ||
}]; | ||
}, [arrowNode, arrowPadding, flip, preventOverflow, offset, gutter, matchWidth]); | ||
}, [arrowNode, arrowPadding, flip, preventOverflow, offsetProp, gutter, matchWidth]); | ||
var popperJS = (0, _reactPopper.usePopper)(referenceNode, popperNode, { | ||
@@ -136,0 +136,0 @@ placement: placement, |
@@ -30,3 +30,2 @@ function _extends() { _extends = Object.assign || 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); } | ||
var [arrowNode, setArrowNode] = React.useState(null); | ||
var offset = offsetProp != null ? offsetProp : [0, gutter]; | ||
/** | ||
@@ -37,76 +36,79 @@ * recommended via popper docs | ||
var customModifiers = React.useMemo(() => [// @see https://popper.js.org/docs/v2/modifiers/offset/ | ||
{ | ||
name: "offset", | ||
options: { | ||
offset: offset != null ? offset : [0, gutter] | ||
}, | ||
phase: "main" | ||
}, // @see https://popper.js.org/docs/v2/modifiers/prevent-overflow/ | ||
{ | ||
name: "preventOverflow", | ||
enabled: !!preventOverflow, | ||
phase: "main" | ||
}, // @see https://popper.js.org/docs/v2/modifiers/arrow/ | ||
{ | ||
name: "arrow", | ||
enabled: !!arrowNode, | ||
options: { | ||
element: arrowNode, | ||
padding: arrowPadding | ||
}, | ||
phase: "main" | ||
}, // @see https://popper.js.org/docs/v2/modifiers/flip/ | ||
{ | ||
name: "flip", | ||
enabled: flip, | ||
options: { | ||
padding: 8 | ||
}, | ||
phase: "main" | ||
}, { | ||
name: "matchWidth", | ||
enabled: !!matchWidth, | ||
phase: "beforeWrite", | ||
requires: ["computeStyles"], | ||
fn: (_ref2) => { | ||
var { | ||
state | ||
} = _ref2; | ||
state.styles.popper.width = state.rects.reference.width + "px"; | ||
}, | ||
effect: (_ref3) => { | ||
var { | ||
state | ||
} = _ref3; | ||
return () => { | ||
var reference = state.elements.reference; | ||
state.elements.popper.style.width = reference.offsetWidth + "px"; | ||
}; | ||
} | ||
}, { | ||
name: "applyArrowHide", | ||
enabled: true, | ||
phase: "write", | ||
var customModifiers = React.useMemo(() => { | ||
var offset = offsetProp != null ? offsetProp : [0, gutter]; | ||
return [// @see https://popper.js.org/docs/v2/modifiers/offset/ | ||
{ | ||
name: "offset", | ||
options: { | ||
offset: offset != null ? offset : [0, gutter] | ||
}, | ||
phase: "main" | ||
}, // @see https://popper.js.org/docs/v2/modifiers/prevent-overflow/ | ||
{ | ||
name: "preventOverflow", | ||
enabled: !!preventOverflow, | ||
phase: "main" | ||
}, // @see https://popper.js.org/docs/v2/modifiers/arrow/ | ||
{ | ||
name: "arrow", | ||
enabled: !!arrowNode, | ||
options: { | ||
element: arrowNode, | ||
padding: arrowPadding | ||
}, | ||
phase: "main" | ||
}, // @see https://popper.js.org/docs/v2/modifiers/flip/ | ||
{ | ||
name: "flip", | ||
enabled: flip, | ||
options: { | ||
padding: 8 | ||
}, | ||
phase: "main" | ||
}, { | ||
name: "matchWidth", | ||
enabled: !!matchWidth, | ||
phase: "beforeWrite", | ||
requires: ["computeStyles"], | ||
fn: (_ref2) => { | ||
var { | ||
state | ||
} = _ref2; | ||
state.styles.popper.width = state.rects.reference.width + "px"; | ||
}, | ||
effect: (_ref3) => { | ||
var { | ||
state | ||
} = _ref3; | ||
return () => { | ||
var reference = state.elements.reference; | ||
state.elements.popper.style.width = reference.offsetWidth + "px"; | ||
}; | ||
} | ||
}, { | ||
name: "applyArrowHide", | ||
enabled: true, | ||
phase: "write", | ||
fn(_ref4) { | ||
var { | ||
state | ||
} = _ref4; | ||
var { | ||
arrow | ||
} = state.elements; | ||
fn(_ref4) { | ||
var { | ||
state | ||
} = _ref4; | ||
var { | ||
arrow | ||
} = state.elements; | ||
if (arrow) { | ||
var _state$modifiersData$; | ||
if (arrow) { | ||
var _state$modifiersData$; | ||
if (((_state$modifiersData$ = state.modifiersData.arrow) == null ? void 0 : _state$modifiersData$.centerOffset) !== 0) { | ||
arrow.setAttribute("data-hide", ""); | ||
} else { | ||
arrow.removeAttribute("data-hide"); | ||
if (((_state$modifiersData$ = state.modifiersData.arrow) == null ? void 0 : _state$modifiersData$.centerOffset) !== 0) { | ||
arrow.setAttribute("data-hide", ""); | ||
} else { | ||
arrow.removeAttribute("data-hide"); | ||
} | ||
} | ||
} | ||
} | ||
}], [arrowNode, arrowPadding, flip, preventOverflow, offset, gutter, matchWidth]); | ||
}]; | ||
}, [arrowNode, arrowPadding, flip, preventOverflow, offsetProp, gutter, matchWidth]); | ||
var popperJS = useBasePopper(referenceNode, popperNode, { | ||
@@ -113,0 +115,0 @@ placement, |
{ | ||
"name": "@chakra-ui/popper", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"description": "A React component and hooks wrapper for popper.js", | ||
@@ -59,4 +59,4 @@ "keywords": [ | ||
"dependencies": { | ||
"@chakra-ui/hooks": "1.0.1", | ||
"@chakra-ui/utils": "1.0.1", | ||
"@chakra-ui/hooks": "1.0.2", | ||
"@chakra-ui/utils": "1.0.2", | ||
"@popperjs/core": "2.4.4", | ||
@@ -63,0 +63,0 @@ "dequal": "2.0.2" |
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
89885
791
+ Added@chakra-ui/hooks@1.0.2(transitive)
+ Added@chakra-ui/utils@1.0.2(transitive)
- Removed@chakra-ui/hooks@1.0.1(transitive)
- Removed@chakra-ui/utils@1.0.1(transitive)
Updated@chakra-ui/hooks@1.0.2
Updated@chakra-ui/utils@1.0.2