tdesign-react
Version:
TDesign Component for React
38 lines (30 loc) • 1.15 kB
JavaScript
/**
* tdesign v1.16.6
* (c) 2026 tdesign
* @license MIT
*/
;
Object.defineProperty(exports, '__esModule', { value: true });
var React = require('react');
var menu__util_checkMenuType = require('./checkMenuType.js');
require('./type.js');
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
var _getSubMenuChildCount = function getSubMenuChildCount(children) {
var count = 0;
React__default["default"].Children.forEach(children, function (child) {
if (menu__util_checkMenuType.checkIsSubMenu(child) || menu__util_checkMenuType.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;
};
exports.getSubMenuChildCount = _getSubMenuChildCount;
exports.getSubMenuMaxHeight = getSubMenuMaxHeight;
//# sourceMappingURL=getSubMenuChildStyle.js.map