bianic-ui 1.15.0-alpha.2 → 1.15.0-alpha.4
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/cjs/index.js +10 -0
- package/dist/cjs/lib.css +1 -1
- package/dist/esm/index.js +11 -1
- package/dist/esm/lib.css +1 -1
- package/package.json +1 -1
package/dist/cjs/index.js
CHANGED
|
@@ -2436,6 +2436,16 @@ var DropdownContainer = function (propsComp) {
|
|
|
2436
2436
|
window.removeEventListener('resize', handleScrollOrResize);
|
|
2437
2437
|
};
|
|
2438
2438
|
}, [anchorRef]);
|
|
2439
|
+
var rect = React.useMemo(function () {
|
|
2440
|
+
var _a;
|
|
2441
|
+
return (_a = anchorRef === null || anchorRef === void 0 ? void 0 : anchorRef.current) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect();
|
|
2442
|
+
}, [anchorRef === null || anchorRef === void 0 ? void 0 : anchorRef.current]);
|
|
2443
|
+
React.useEffect(function () {
|
|
2444
|
+
if (!anchorRef || !anchorRef.current || !rect)
|
|
2445
|
+
return;
|
|
2446
|
+
setPositionStyle(getDropdownStyle(anchorRef, dropdownRef));
|
|
2447
|
+
console.log('rect changed', rect);
|
|
2448
|
+
}, [rect]);
|
|
2439
2449
|
return (React.createElement(React.Fragment, null,
|
|
2440
2450
|
isWithOverlay && (React.createElement("div", { className: "bianic-dropdown-overlay fixed left-0 top-0 h-screen w-screen", style: { zIndex: zIndex }, onClick: function () { return onClose(); } })),
|
|
2441
2451
|
reactDom.createPortal(React.createElement("div", __assign({ ref: dropdownRef, className: "absolute max-w-fit bianic-dropdown-container bg-bia-white shadow-[0px_3px_20px_0px_rgba(0,0,0,0.20)] ".concat(containerClass), style: __assign({ zIndex: zIndex + 10 }, positionStyle) }, restProps), React.Children.map(children, function (child) {
|