UNPKG

tdesign-react

Version:
29 lines (25 loc) 797 B
/** * tdesign v1.15.1 * (c) 2025 tdesign * @license MIT */ import React from 'react'; import { checkIsSubMenu, checkIsMenuGroup } from './checkMenuType.js'; import './type.js'; var _getSubMenuChildCount = function getSubMenuChildCount(children) { var count = 0; React.Children.forEach(children, function (child) { if (checkIsSubMenu(child) || checkIsMenuGroup(child)) { count += _getSubMenuChildCount(child.props.children) + 1; } else { count += 1; } }); return count; }; var MENU_ITEM_HEIGHT = 50; var getSubMenuMaxHeight = function getSubMenuMaxHeight(children) { return _getSubMenuChildCount(children) * MENU_ITEM_HEIGHT; }; export { _getSubMenuChildCount as getSubMenuChildCount, getSubMenuMaxHeight }; //# sourceMappingURL=getSubMenuChildStyle.js.map