"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.AutoExpandableToolbar = void 0;
const tslib_1 = require("tslib");
const React = tslib_1.__importStar(require("react"));
// import {ExpandableToolbar, type ExpandableToolbarProps} from 'nice-ui/lib/4-card/Toolbar/ToolbarMenu/ExpandableToolbar';
const ExpandableToolbar_1 = require("./ExpandableToolbar");
const AutoExpandableToolbar = ({ menu, disabled, onPopupClose, ...rest }) => {
    const expandPoint = React.useRef({ x: 32, y: 32, dx: 1, dy: 1 });
    return (React.createElement("div", { ref: (el) => {
            if (!el)
                return;
            const rect = el.getBoundingClientRect();
            if (!rect)
                return;
            expandPoint.current.dx = 1;
            expandPoint.current.dy = 1;
            expandPoint.current.x = rect.x - 100;
            expandPoint.current.y = rect.y - 48;
        } },
        React.createElement(ExpandableToolbar_1.ExpandableToolbar, { ...rest, menu: menu, expandPoint: () => expandPoint.current, disabled: disabled, onPopupClose: onPopupClose })));
};
exports.AutoExpandableToolbar = AutoExpandableToolbar;
//# sourceMappingURL=AutoExpandableToolbar.js.map