UNPKG

@skbkontur/ui-kit

Version:

27 lines 1.25 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var tslib_1 = require("tslib"); var React = tslib_1.__importStar(require("react")); var PopupMenu_1 = tslib_1.__importDefault(require("../internal/PopupMenu")); /** * Меню, раскрывающееся по клику на переданный в ```caption``` элемент */ var DropdownMenu = /** @class */ (function (_super) { tslib_1.__extends(DropdownMenu, _super); function DropdownMenu(props) { var _this = _super.call(this, props) || this; if (!props.caption) { throw new Error('Prop "caption" is required!!!'); } return _this; } DropdownMenu.prototype.render = function () { if (!this.props.caption) { return null; } return (React.createElement(PopupMenu_1.default, { caption: this.props.caption, menuMaxHeight: this.props.menuMaxHeight, menuWidth: this.props.menuWidth, popupHasPin: false, popupMargin: 0, positions: ['bottom left', 'bottom right', 'top left', 'top right'], disabled: this.props.disabled }, this.props.children)); }; return DropdownMenu; }(React.Component)); exports.default = DropdownMenu; //# sourceMappingURL=DropdownMenu.js.map