UNPKG

2.14 kBJavaScriptView Raw
1/*
2 * Copyright 2015 Palantir Technologies, Inc. All rights reserved.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16import { __assign, __decorate, __extends, __rest } from "tslib";
17import classNames from "classnames";
18import * as React from "react";
19import { polyfill } from "react-lifecycles-compat";
20import { AbstractPureComponent2, Classes } from "../../common";
21import { DISPLAYNAME_PREFIX } from "../../common/props";
22import { MenuDivider } from "./menuDivider";
23// this cyclic import can be removed in v4.0 (https://github.com/palantir/blueprint/issues/3829)
24// eslint-disable-next-line import/no-cycle
25import { MenuItem } from "./menuItem";
26var Menu = /** @class */ (function (_super) {
27 __extends(Menu, _super);
28 function Menu() {
29 return _super !== null && _super.apply(this, arguments) || this;
30 }
31 Menu.prototype.render = function () {
32 var _a;
33 var _b = this.props, className = _b.className, children = _b.children, large = _b.large, ulRef = _b.ulRef, htmlProps = __rest(_b, ["className", "children", "large", "ulRef"]);
34 var classes = classNames(Classes.MENU, (_a = {}, _a[Classes.LARGE] = large, _a), className);
35 return (React.createElement("ul", __assign({}, htmlProps, { className: classes, ref: ulRef }), children));
36 };
37 Menu.displayName = DISPLAYNAME_PREFIX + ".Menu";
38 /** @deprecated use MenuDivider */
39 Menu.Divider = MenuDivider;
40 /** @deprecated use MenuItem*/
41 Menu.Item = MenuItem;
42 Menu = __decorate([
43 polyfill
44 ], Menu);
45 return Menu;
46}(AbstractPureComponent2));
47export { Menu };
48//# sourceMappingURL=menu.js.map
\No newline at end of file