You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
32 lines
679 B
32 lines
679 B
"use strict";
|
|
|
|
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard");
|
|
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.IdContext = void 0;
|
|
exports.getMenuId = getMenuId;
|
|
exports.useMenuId = useMenuId;
|
|
|
|
var React = _interopRequireWildcard(require("react"));
|
|
|
|
var IdContext = /*#__PURE__*/React.createContext(null);
|
|
exports.IdContext = IdContext;
|
|
|
|
function getMenuId(uuid, eventKey) {
|
|
if (uuid === undefined) {
|
|
return null;
|
|
}
|
|
|
|
return "".concat(uuid, "-").concat(eventKey);
|
|
}
|
|
/**
|
|
* Get `data-menu-id`
|
|
*/
|
|
|
|
|
|
function useMenuId(eventKey) {
|
|
var id = React.useContext(IdContext);
|
|
return getMenuId(id, eventKey);
|
|
} |