bianic-ui 1.16.0-alpha.2 → 1.16.0-alpha.3
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 +5 -4
- package/dist/esm/index.js +5 -4
- package/package.json +1 -1
package/dist/cjs/index.js
CHANGED
|
@@ -1825,16 +1825,17 @@ var usePopupPosition = function (anchorRef, popupRef, position) {
|
|
|
1825
1825
|
};
|
|
1826
1826
|
|
|
1827
1827
|
var MenuContainer = function (props) {
|
|
1828
|
-
var _a
|
|
1829
|
-
|
|
1828
|
+
var _a;
|
|
1829
|
+
var _b = props.isTopFlat, isTopFlat = _b === void 0 ? false : _b, children = props.children, _c = props.open, open = _c === void 0 ? true : _c, _d = props.onClose, onClose = _d === void 0 ? function () { } : _d, _e = props.className, className = _e === void 0 ? '' : _e, _f = props.isWithOverlay, isWithOverlay = _f === void 0 ? true : _f, _g = props.zIndex, zIndex = _g === void 0 ? 100 : _g, _h = props.onClickItem, onClickItem = _h === void 0 ? function () { } : _h, anchorRef = props.anchorRef, restProps = __rest(props, ["isTopFlat", "children", "open", "onClose", "className", "isWithOverlay", "zIndex", "onClickItem", "anchorRef"]);
|
|
1830
|
+
if (!open)
|
|
1830
1831
|
return null;
|
|
1831
1832
|
var radiusClass = "rounded-b-radius-sm ".concat(!isTopFlat && 'rounded-t-radius-sm');
|
|
1832
1833
|
var MenuContainerRef = React.useRef(null);
|
|
1833
1834
|
var positionStyle = usePopupPosition(anchorRef, MenuContainerRef)[0];
|
|
1834
1835
|
return (React.createElement(React.Fragment, null,
|
|
1835
1836
|
isWithOverlay && (React.createElement("div", { className: "bianic-menu-overlay fixed left-0 top-0 z-0 h-screen w-screen", onClick: function () { return onClose(); }, style: { zIndex: zIndex } })),
|
|
1836
|
-
reactDom.createPortal(React.createElement("div", __assign({ ref: MenuContainerRef, className: "absolute w-fit bg-bia-white shadow-[0px_3px_20px_0px_rgba(0,0,0,0.20)] ".concat(radiusClass, " ").concat(className), style: __assign({ zIndex: zIndex + 10, minWidth: anchorRef.current
|
|
1837
|
-
? anchorRef.current.offsetWidth
|
|
1837
|
+
reactDom.createPortal(React.createElement("div", __assign({ ref: MenuContainerRef, className: "absolute w-fit bg-bia-white shadow-[0px_3px_20px_0px_rgba(0,0,0,0.20)] ".concat(radiusClass, " ").concat(className), style: __assign({ zIndex: zIndex + 10, minWidth: (anchorRef === null || anchorRef === void 0 ? void 0 : anchorRef.current)
|
|
1838
|
+
? (_a = anchorRef === null || anchorRef === void 0 ? void 0 : anchorRef.current) === null || _a === void 0 ? void 0 : _a.offsetWidth
|
|
1838
1839
|
: undefined }, positionStyle) }, restProps), React.Children.map(children, function (child) {
|
|
1839
1840
|
return React.isValidElement(child)
|
|
1840
1841
|
? // Kirimkan handleItemClick sebagai props onClick ke setiap MenuItem
|
package/dist/esm/index.js
CHANGED
|
@@ -1823,16 +1823,17 @@ var usePopupPosition = function (anchorRef, popupRef, position) {
|
|
|
1823
1823
|
};
|
|
1824
1824
|
|
|
1825
1825
|
var MenuContainer = function (props) {
|
|
1826
|
-
var _a
|
|
1827
|
-
|
|
1826
|
+
var _a;
|
|
1827
|
+
var _b = props.isTopFlat, isTopFlat = _b === void 0 ? false : _b, children = props.children, _c = props.open, open = _c === void 0 ? true : _c, _d = props.onClose, onClose = _d === void 0 ? function () { } : _d, _e = props.className, className = _e === void 0 ? '' : _e, _f = props.isWithOverlay, isWithOverlay = _f === void 0 ? true : _f, _g = props.zIndex, zIndex = _g === void 0 ? 100 : _g, _h = props.onClickItem, onClickItem = _h === void 0 ? function () { } : _h, anchorRef = props.anchorRef, restProps = __rest(props, ["isTopFlat", "children", "open", "onClose", "className", "isWithOverlay", "zIndex", "onClickItem", "anchorRef"]);
|
|
1828
|
+
if (!open)
|
|
1828
1829
|
return null;
|
|
1829
1830
|
var radiusClass = "rounded-b-radius-sm ".concat(!isTopFlat && 'rounded-t-radius-sm');
|
|
1830
1831
|
var MenuContainerRef = useRef(null);
|
|
1831
1832
|
var positionStyle = usePopupPosition(anchorRef, MenuContainerRef)[0];
|
|
1832
1833
|
return (React.createElement(React.Fragment, null,
|
|
1833
1834
|
isWithOverlay && (React.createElement("div", { className: "bianic-menu-overlay fixed left-0 top-0 z-0 h-screen w-screen", onClick: function () { return onClose(); }, style: { zIndex: zIndex } })),
|
|
1834
|
-
createPortal(React.createElement("div", __assign({ ref: MenuContainerRef, className: "absolute w-fit bg-bia-white shadow-[0px_3px_20px_0px_rgba(0,0,0,0.20)] ".concat(radiusClass, " ").concat(className), style: __assign({ zIndex: zIndex + 10, minWidth: anchorRef.current
|
|
1835
|
-
? anchorRef.current.offsetWidth
|
|
1835
|
+
createPortal(React.createElement("div", __assign({ ref: MenuContainerRef, className: "absolute w-fit bg-bia-white shadow-[0px_3px_20px_0px_rgba(0,0,0,0.20)] ".concat(radiusClass, " ").concat(className), style: __assign({ zIndex: zIndex + 10, minWidth: (anchorRef === null || anchorRef === void 0 ? void 0 : anchorRef.current)
|
|
1836
|
+
? (_a = anchorRef === null || anchorRef === void 0 ? void 0 : anchorRef.current) === null || _a === void 0 ? void 0 : _a.offsetWidth
|
|
1836
1837
|
: undefined }, positionStyle) }, restProps), Children.map(children, function (child) {
|
|
1837
1838
|
return React.isValidElement(child)
|
|
1838
1839
|
? // Kirimkan handleItemClick sebagai props onClick ke setiap MenuItem
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"publishConfig": {
|
|
4
4
|
"@biaenergi:registry": "https://gitlab.com/api/v4/projects/50905269/packages/npm/"
|
|
5
5
|
},
|
|
6
|
-
"version": "1.16.0-alpha.
|
|
6
|
+
"version": "1.16.0-alpha.3",
|
|
7
7
|
"description": "Design Language System develop by BIAENERGI",
|
|
8
8
|
"scripts": {
|
|
9
9
|
"rollup": "rollup -c",
|