nice-ui
Version:
React design system, components, and utilities
20 lines (19 loc) • 669 B
JavaScript
Object.defineProperty(exports, "__esModule", { value: true });
exports.ToolbarMenuState = void 0;
const OpenPanelState_1 = require("../../ContextMenu/ContextMenu/OpenPanelState");
class ToolbarMenuState {
constructor(props, openPanel = new OpenPanelState_1.OpenPanelState()) {
this.props = props;
this.openPanel = openPanel;
this.execute = (item, event) => {
const id = item.id ?? item.name;
this.openPanel.onClick(id);
if (item.onSelect) {
item.onSelect(event);
this.onclose?.();
}
};
}
}
exports.ToolbarMenuState = ToolbarMenuState;
;