UNPKG

@hitachivantara/uikit-react-core

Version:
23 lines (22 loc) 909 B
import { HvIcon } from "../icons.js"; import { HvDropDownMenu } from "../DropDownMenu/DropDownMenu.js"; import { jsx } from "react/jsx-runtime"; //#region src/BreadCrumb/utils.tsx var removeExtension = (label) => label.includes(".") ? label.slice(0, label.lastIndexOf(".")) : label; var pathWithSubMenu = (id, listRoute, maxVisible, onClick, dropDownMenuProps) => { const nbrElemToSubMenu = listRoute.length - maxVisible; const subMenuList = listRoute.slice(1, nbrElemToSubMenu + 1); const handleClick = (event, data) => { event.preventDefault(); onClick?.(event, data); }; listRoute.splice(1, nbrElemToSubMenu, /* @__PURE__ */ jsx(HvDropDownMenu, { icon: /* @__PURE__ */ jsx(HvIcon, { name: "DotsHorizontal" }), dataList: subMenuList, ...dropDownMenuProps, onClick: onClick != null ? handleClick : void 0 })); return listRoute; }; //#endregion export { pathWithSubMenu, removeExtension };