x-ui-design 0.8.33 → 0.8.35
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.
- package/dist/index.esm.js +14 -3
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +14 -3
- package/dist/index.js.map +1 -1
- package/lib/components/Popover/Popover.tsx +11 -3
- package/lib/hooks/usePosition.ts +6 -0
- package/package.json +1 -1
- package/src/app/page.tsx +2 -1
package/dist/index.esm.js
CHANGED
|
@@ -2614,6 +2614,11 @@ const usePosition = ({
|
|
|
2614
2614
|
const [showPlacement, setShowPlacement] = useState('');
|
|
2615
2615
|
const [_dropdownPosition, setDropdownPosition] = useState({});
|
|
2616
2616
|
const dropdownPosition = useCallback(() => {
|
|
2617
|
+
console.log({
|
|
2618
|
+
getPopupContainer,
|
|
2619
|
+
popupRef: popupRef.current,
|
|
2620
|
+
triggerRef: triggerRef.current
|
|
2621
|
+
});
|
|
2617
2622
|
if (!triggerRef.current) {
|
|
2618
2623
|
return {};
|
|
2619
2624
|
}
|
|
@@ -5597,18 +5602,24 @@ const Popover = ({
|
|
|
5597
5602
|
onMouseEnter: handleOnMouseEnter,
|
|
5598
5603
|
onMouseLeave: handleOnMouseLeave
|
|
5599
5604
|
}, [trigger]);
|
|
5600
|
-
|
|
5605
|
+
const _children = useMemo(() => {
|
|
5606
|
+
if (Children.count(children) > 1) {
|
|
5607
|
+
return /*#__PURE__*/React.createElement("div", null, children);
|
|
5608
|
+
}
|
|
5609
|
+
return children;
|
|
5610
|
+
}, [children]);
|
|
5611
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, Children.map(_children, (child, index) => {
|
|
5601
5612
|
if (! /*#__PURE__*/isValidElement(child)) {
|
|
5602
5613
|
child = /*#__PURE__*/React.createElement("div", null, child);
|
|
5603
5614
|
}
|
|
5604
5615
|
return /*#__PURE__*/cloneElement(child, {
|
|
5605
5616
|
key: index,
|
|
5606
|
-
...
|
|
5617
|
+
...{
|
|
5607
5618
|
style,
|
|
5608
5619
|
...childProps,
|
|
5609
5620
|
ref: triggerRef,
|
|
5610
5621
|
className: `${prefixCls}-wrapper-content`
|
|
5611
|
-
}
|
|
5622
|
+
}
|
|
5612
5623
|
});
|
|
5613
5624
|
}), isOpen && /*#__PURE__*/React.createElement(ConditionalWrapper, {
|
|
5614
5625
|
condition: !!getPopupContainer,
|